|
@@ -11,7 +11,13 @@ import com.diagbot.entity.Permission;
|
|
|
import com.diagbot.entity.User;
|
|
|
import com.diagbot.facade.PermissionFacade;
|
|
|
import com.diagbot.facade.UserFacade;
|
|
|
+import com.diagbot.vo.AppkeySecretVO;
|
|
|
+import com.diagbot.vo.BaseIdVO;
|
|
|
+import com.diagbot.vo.ResetPasswordVO;
|
|
|
+import com.diagbot.vo.UserInfoByIdPageVO;
|
|
|
+import com.diagbot.vo.UserLoginVO;
|
|
|
import com.diagbot.vo.UserSaveVO;
|
|
|
+import com.diagbot.vo.UsernameVO;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -66,8 +72,8 @@ public class UserController {
|
|
|
"password:密码, 必填<br> ")
|
|
|
@PostMapping("/login")
|
|
|
@SysLogger("login")
|
|
|
- public RespDTO<LoginDTO> login(@RequestParam String username, @RequestParam String password) {
|
|
|
- return userFacade.login(username, password);
|
|
|
+ public RespDTO<LoginDTO> login(@RequestBody UserLoginVO userLoginVO) {
|
|
|
+ return userFacade.login(userLoginVO.getUsername(), userLoginVO.getPassword());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -78,8 +84,8 @@ public class UserController {
|
|
|
@PostMapping("/resetPassword")
|
|
|
@SysLogger("resetPassword")
|
|
|
@Transactional
|
|
|
- public RespDTO<Boolean> resetPassword(String username, String password, String diffPassword) {
|
|
|
- return userFacade.resetPassword(username, password, diffPassword);
|
|
|
+ public RespDTO<Boolean> resetPassword(@RequestBody ResetPasswordVO resetPasswordVO) {
|
|
|
+ return userFacade.resetPassword(resetPasswordVO.getUsername(), resetPasswordVO.getPassword(), resetPasswordVO.getDiffPassword());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -112,16 +118,16 @@ public class UserController {
|
|
|
@SysLogger("index")
|
|
|
@ApiOperation(value = "用来测试分页,未用[by:zhoutg]")
|
|
|
@ApiIgnore
|
|
|
- public RespDTO<IPage<User>> indexUser(Page page, UserSaveVO userSaveVO) {
|
|
|
- return userFacade.index(page, userSaveVO);
|
|
|
+ public RespDTO<IPage<User>> indexUser(@RequestBody UserSaveVO userSaveVO) {
|
|
|
+ return userFacade.index(userSaveVO, userSaveVO);
|
|
|
}
|
|
|
|
|
|
- @ApiOperation(value = "获取资源信息[by:zhoutg]",
|
|
|
+ @ApiOperation(value = "获取资源信息,接口未用[by:zhoutg]",
|
|
|
notes = "appkey:用户名,必填<br>" +
|
|
|
"secret:密码, 必填<br> ")
|
|
|
@PostMapping("/getPermission")
|
|
|
- public RespDTO<Permission> getPermission(@RequestParam String appkey, @RequestParam String secret) {
|
|
|
- return permissionFacade.getPermission(appkey, secret);
|
|
|
+ public RespDTO<Permission> getPermission(@RequestBody AppkeySecretVO appkeySecretVO) {
|
|
|
+ return permissionFacade.getPermission(appkeySecretVO.getAppkey(), appkeySecretVO.getSecret());
|
|
|
}
|
|
|
|
|
|
|
|
@@ -130,9 +136,9 @@ public class UserController {
|
|
|
@SysLogger("getByUsername")
|
|
|
@ApiIgnore
|
|
|
// @PreAuthorize("hasAnyAuthority('ROLE_USER')")
|
|
|
- public RespDTO getUserInfo(@RequestParam String username) {
|
|
|
+ public RespDTO getUserInfo(@RequestBody UsernameVO usernameVO) {
|
|
|
//参数判读省略
|
|
|
- User user = userFacade.getUserInfo(username);
|
|
|
+ User user = userFacade.getUserInfo(usernameVO.getUsername());
|
|
|
return RespDTO.onSuc(user);
|
|
|
}
|
|
|
|
|
@@ -140,10 +146,10 @@ public class UserController {
|
|
|
@PostMapping("/getUserInfoByID")
|
|
|
@SysLogger("getUserInfoByID")
|
|
|
@ApiIgnore
|
|
|
- public RespDTO getUserInfoByID(Long id, Page page) {
|
|
|
+ public RespDTO getUserInfoByID(@RequestBody UserInfoByIdPageVO userInfoByIdPageVO) {
|
|
|
User userVo = new User();
|
|
|
- userVo.setId(id);
|
|
|
- IPage<User> user = userFacade.selectUserListPage(page, userVo);
|
|
|
+ userVo.setId(userInfoByIdPageVO.getId());
|
|
|
+ IPage<User> user = userFacade.selectUserListPage(userInfoByIdPageVO, userVo);
|
|
|
return RespDTO.onSuc(user);
|
|
|
}
|
|
|
|
|
@@ -203,7 +209,7 @@ public class UserController {
|
|
|
/**
|
|
|
* 查询用户信息
|
|
|
*
|
|
|
- * @param id 用户ID
|
|
|
+ * @param baseIdVO 用户ID
|
|
|
* @return 用户信息
|
|
|
*/
|
|
|
@ApiOperation(value = "查询用户(示例)[by:gaodm]", notes = "查询用户")
|
|
@@ -211,14 +217,14 @@ public class UserController {
|
|
|
@SysLogger("getUser")
|
|
|
@Transactional
|
|
|
@ApiIgnore
|
|
|
- public RespDTO getUser(Long id) {
|
|
|
- return RespDTO.onSuc(userFacade.getById(id));
|
|
|
+ public RespDTO getUser(@RequestBody BaseIdVO baseIdVO) {
|
|
|
+ return RespDTO.onSuc(userFacade.getById(baseIdVO.getId()));
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 删除用户
|
|
|
*
|
|
|
- * @param id 用户ID
|
|
|
+ * @param baseIdVO 用户ID
|
|
|
* @return 删除是否成功
|
|
|
*/
|
|
|
@ApiOperation(value = "删除用户(示例)[by:gaodm]", notes = "删除用户")
|
|
@@ -226,8 +232,8 @@ public class UserController {
|
|
|
@SysLogger("delUser")
|
|
|
@Transactional
|
|
|
@ApiIgnore
|
|
|
- public RespDTO delUser(Long id) {
|
|
|
- return RespDTO.onSuc(userFacade.removeById(id));
|
|
|
+ public RespDTO delUser(@RequestBody BaseIdVO baseIdVO) {
|
|
|
+ return RespDTO.onSuc(userFacade.removeById(baseIdVO.getId()));
|
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "控制台账户信息[by:rengb]", notes = "控制台账户信息")
|