|
@@ -10,12 +10,12 @@ import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.PathVariable;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
+import springfox.documentation.annotations.ApiIgnore;
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
|
@@ -31,7 +31,7 @@ public class UserController {
|
|
|
@Autowired
|
|
|
private UserFacade userFacade;
|
|
|
|
|
|
- @ApiOperation(value = "注册", notes = "username和password为必选项")
|
|
|
+ @ApiOperation(value = "注册", notes = "username|password|organization|email|linkman|imgId|code为必填项")
|
|
|
@PostMapping("/registry")
|
|
|
@SysLogger("registry")
|
|
|
@Transactional
|
|
@@ -40,19 +40,18 @@ public class UserController {
|
|
|
return RespDTO.onSuc(user);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "登录", notes = "username和password为必选项")
|
|
|
+ @ApiOperation(value = "登录", notes = "username|password为必选项")
|
|
|
@PostMapping("/login")
|
|
|
@SysLogger("login")
|
|
|
- public RespDTO login(@RequestParam String username , @RequestParam String password){
|
|
|
- //参数判读省略
|
|
|
- return userFacade.login(username,password);
|
|
|
+ public RespDTO login(@RequestParam String username, @RequestParam String password){
|
|
|
+ return userFacade.login(username, password);
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "根据用户名获取用户", notes = "根据用户名获取用户")
|
|
|
- @PostMapping("/{username}")
|
|
|
- @SysLogger("getUserInfo")
|
|
|
+ @PostMapping("/getByUsername")
|
|
|
+ @SysLogger("getByUsername")
|
|
|
// @PreAuthorize("hasAnyAuthority('ROLE_USER')")
|
|
|
- public RespDTO getUserInfo(@PathVariable("username") String username){
|
|
|
+ public RespDTO getUserInfo(@RequestParam String username){
|
|
|
//参数判读省略
|
|
|
User user= userFacade.getUserInfo(username);
|
|
|
return RespDTO.onSuc(user);
|
|
@@ -128,6 +127,7 @@ public class UserController {
|
|
|
@GetMapping("/getUser")
|
|
|
@SysLogger("getUser")
|
|
|
@Transactional
|
|
|
+ @ApiIgnore
|
|
|
public RespDTO getUser(Long id){
|
|
|
return RespDTO.onSuc(userFacade.getById(id));
|
|
|
}
|