|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
import com.supervision.common.domain.R;
|
|
|
|
import com.supervision.common.domain.R;
|
|
|
|
import com.supervision.police.dto.user.*;
|
|
|
|
import com.supervision.police.dto.user.*;
|
|
|
|
import com.supervision.police.service.SystemUserService;
|
|
|
|
import com.supervision.police.service.SystemUserService;
|
|
|
|
|
|
|
|
import com.supervision.utils.UserUtil;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
import io.swagger.v3.oas.annotations.Parameter;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
@ -26,18 +27,25 @@ public class UserController {
|
|
|
|
return R.ok(login);
|
|
|
|
return R.ok(login);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "查看账号信息")
|
|
|
|
|
|
|
|
@GetMapping("/getCurrentUser")
|
|
|
|
|
|
|
|
public R<UserInfoDTO> getCurrentUser() {
|
|
|
|
|
|
|
|
UserInfoDTO currentUser = userService.getCurrentUser();
|
|
|
|
|
|
|
|
return R.ok(currentUser);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "新增用户信息")
|
|
|
|
@Operation(summary = "新增用户信息")
|
|
|
|
@PostMapping("/saveUserInfo")
|
|
|
|
@PostMapping("/saveUserInfo")
|
|
|
|
public R<String> saveUserInfo(@RequestBody UserInfoReqVo userInfoReqVo) {
|
|
|
|
public R<String> saveUserInfo(@RequestBody UserInfoVoDTO userInfoVoDTO) {
|
|
|
|
String userId = userService.saveUserInfo(userInfoReqVo);
|
|
|
|
String userId = userService.saveUserInfo(userInfoVoDTO.toUserInfoReqVo());
|
|
|
|
return R.ok(userId);
|
|
|
|
return R.ok(userId);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Operation(summary = "修改用户信息")
|
|
|
|
@Operation(summary = "修改用户信息")
|
|
|
|
@PostMapping("/update")
|
|
|
|
@PostMapping("/update")
|
|
|
|
public R<?> updateUser(@RequestBody UserInfoReqVo userInfoReqVo) {
|
|
|
|
public R<?> updateUser(@RequestBody UserInfoVoDTO userInfoVoDTO) {
|
|
|
|
userService.updateUserInfo(userInfoReqVo);
|
|
|
|
userService.updateUserInfo(userInfoVoDTO.toUserInfoReqVo());
|
|
|
|
return R.ok();
|
|
|
|
return R.ok();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -56,13 +64,15 @@ public class UserController {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@Operation(summary = "查看用户信息列表")
|
|
|
|
@Operation(summary = "查看用户信息列表")
|
|
|
|
@GetMapping("/list")
|
|
|
|
@GetMapping("/list")
|
|
|
|
public R<IPage<UserInfoDTO>> list(@Parameter(name = "userName",description = "用户名") @RequestParam(required = false) String userName,
|
|
|
|
public R<IPage<UserInfoVoDTO>> list(@Parameter(name = "userName",description = "用户名") @RequestParam(required = false) String userName,
|
|
|
|
@Parameter(name = "roleId",description = "角色id") @RequestParam(required = false) String roleId,
|
|
|
|
@Parameter(name = "roleId",description = "角色id") @RequestParam(required = false) String roleId,
|
|
|
|
@Parameter(name = "roleName",description = "角色名") @RequestParam(required = false) String roleName,
|
|
|
|
@Parameter(name = "roleName",description = "角色名") @RequestParam(required = false) String roleName,
|
|
|
|
@Parameter(name = "pageNum",description = "页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
@Parameter(name = "pageNum",description = "页码") @RequestParam(defaultValue = "1") Integer pageNum,
|
|
|
|
@Parameter(name = "pageSize",description = "每页大小") @RequestParam(defaultValue = "10") Integer pageSize) {
|
|
|
|
@Parameter(name = "pageSize",description = "每页大小") @RequestParam(defaultValue = "10") Integer pageSize) {
|
|
|
|
IPage<UserInfoDTO> list = userService.list(userName, roleId, roleName, pageNum, pageSize);
|
|
|
|
|
|
|
|
return R.ok(list);
|
|
|
|
IPage<UserInfoDTO> page = userService.list(userName, roleId, roleName, pageNum, pageSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return R.ok(page.convert(UserInfoVoDTO::new));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|