You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
42 lines
1.1 KiB
package com.qsd.orange.controller;
|
|
|
|
import com.qsd.orange.global.R;
|
|
import com.qsd.orange.po.SysUser;
|
|
import com.qsd.orange.service.UserService;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.validation.Valid;
|
|
|
|
@RestController
|
|
@RequestMapping("system/user")
|
|
public class SystemUserController {
|
|
|
|
@Autowired
|
|
private UserService userService;
|
|
|
|
@GetMapping("all")
|
|
public R all(){
|
|
return R.success().data("items", userService.all());
|
|
}
|
|
|
|
@PostMapping("add")
|
|
public R add(@Valid SysUser user){
|
|
return R.choose(userService.add(user) > 0);
|
|
}
|
|
|
|
@PostMapping("update")
|
|
public R update(@Valid SysUser user){
|
|
return R.choose(userService.update(user) > 0);
|
|
}
|
|
|
|
@GetMapping("reset")
|
|
public R reset(String username){
|
|
return R.choose(userService.reset(username) > 0);
|
|
}
|
|
|
|
}
|