|
|
@@ -1,9 +1,7 @@
|
|
|
package cn.reghao.devops.mgr.admin.controller;
|
|
|
|
|
|
-import cn.reghao.devops.mgr.admin.model.dto.AccountProfile;
|
|
|
import cn.reghao.devops.mgr.admin.model.dto.AccountRole;
|
|
|
import cn.reghao.devops.mgr.admin.model.dto.CreateAccountDto;
|
|
|
-import cn.reghao.devops.mgr.admin.model.dto.UpdatePasswordDto;
|
|
|
import cn.reghao.devops.mgr.admin.model.po.User;
|
|
|
import cn.reghao.devops.mgr.admin.model.vo.RoleVO;
|
|
|
import cn.reghao.devops.mgr.admin.model.vo.UserVO;
|
|
|
@@ -16,7 +14,6 @@ import cn.reghao.jutil.web.WebResult;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.PageImpl;
|
|
|
import org.springframework.data.domain.PageRequest;
|
|
|
import org.springframework.http.MediaType;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
@@ -24,7 +21,6 @@ import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
-import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.validation.constraints.NotNull;
|
|
|
import java.util.*;
|
|
|
@@ -59,16 +55,9 @@ public class UserPageController {
|
|
|
@ApiOperation(value = "用户列表页面", notes = "N")
|
|
|
@PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
@GetMapping
|
|
|
- public String userPage(@RequestParam(value = "screenName", required = false) String screenName, Model model) {
|
|
|
- Page<UserVO> page;
|
|
|
- if (screenName != null) {
|
|
|
- List<UserVO> list = accountService.getByMatchScreenName(screenName);
|
|
|
- page = new PageImpl<>(list);
|
|
|
- } else {
|
|
|
- PageRequest pageRequest = PageRequest.of(0, 100);
|
|
|
- page = accountService.getUserVOByPage(pageRequest);
|
|
|
- }
|
|
|
-
|
|
|
+ public String userPage(Model model) {
|
|
|
+ PageRequest pageRequest = PageRequest.of(0, 100);
|
|
|
+ Page<UserVO> page = accountService.getUserVOByPage(pageRequest);
|
|
|
Map<Integer, String> map = accountSessionService.getLastAccess();
|
|
|
page.getContent().forEach(userVO -> {
|
|
|
int userId = userVO.getUserId();
|
|
|
@@ -163,47 +152,4 @@ public class UserPageController {
|
|
|
Result result = accountService.updateAccountRole(accountRole);
|
|
|
return WebResult.result(result);
|
|
|
}
|
|
|
-
|
|
|
- @ApiOperation(value = "启用/禁用用户", notes = "N")
|
|
|
- @PreAuthorize("hasRole('ROLE_ADMIN')")
|
|
|
- @PostMapping(value = "/status/{userId}", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- @ResponseBody
|
|
|
- public String updateAccountStatus(@PathVariable("userId") Integer userId) {
|
|
|
- //userIds.forEach(userId -> accountService.updateAccountStatus(userId, enable));
|
|
|
- return WebResult.failWithMsg("接口未实现");
|
|
|
- }
|
|
|
-
|
|
|
- // *****************************************************************************************************************
|
|
|
- // TODO 待删除
|
|
|
- // *****************************************************************************************************************
|
|
|
- @ApiOperation(value = "修改个人密码页面", notes = "N")
|
|
|
- @GetMapping("/passwd/edit")
|
|
|
- @Deprecated
|
|
|
- public String editPasswdPage(Model model) {
|
|
|
- return "/admin/user/userpasswd";
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "修改个人头像", notes = "N")
|
|
|
- @PostMapping(value = "/avatar", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- @ResponseBody
|
|
|
- @Deprecated
|
|
|
- public String userAvatar(MultipartFile file) {
|
|
|
- return WebResult.failWithMsg("接口未实现");
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "修改个人信息", notes = "N")
|
|
|
- @PostMapping(value = "/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- @ResponseBody
|
|
|
- @Deprecated
|
|
|
- public String editUserInfo(@Validated AccountProfile accountProfile) {
|
|
|
- return WebResult.failWithMsg("接口未实现");
|
|
|
- }
|
|
|
-
|
|
|
- @ApiOperation(value = "修改个人密码", notes = "N")
|
|
|
- @PostMapping(value = "/passwd/update", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- @ResponseBody
|
|
|
- @Deprecated
|
|
|
- public String editPasswd(UpdatePasswordDto updatePasswordDto) {
|
|
|
- return WebResult.failWithMsg("接口未实现");
|
|
|
- }
|
|
|
}
|