|
|
@@ -1,9 +1,9 @@
|
|
|
package cn.reghao.devops.web.account.controller.page;
|
|
|
|
|
|
-import cn.reghao.devops.web.account.db.query.UserQuery;
|
|
|
import cn.reghao.devops.web.account.model.po.User;
|
|
|
import cn.reghao.devops.web.account.model.vo.RoleVO;
|
|
|
import cn.reghao.devops.web.account.model.vo.UserVO;
|
|
|
+import cn.reghao.devops.web.account.service.AccountService;
|
|
|
import cn.reghao.devops.web.account.service.AccountSessionService;
|
|
|
import cn.reghao.devops.web.account.service.RoleService;
|
|
|
import cn.reghao.devops.web.account.service.UserContext;
|
|
|
@@ -28,12 +28,12 @@ import java.util.stream.Collectors;
|
|
|
@RequestMapping("/rbac/user")
|
|
|
@Controller
|
|
|
public class UserPageController {
|
|
|
- private final UserQuery userQuery;
|
|
|
+ private final AccountService accountService;
|
|
|
private final RoleService roleService;
|
|
|
private final AccountSessionService accountSessionService;
|
|
|
|
|
|
- public UserPageController(UserQuery userQuery, RoleService roleService, AccountSessionService accountSessionService) {
|
|
|
- this.userQuery = userQuery;
|
|
|
+ public UserPageController(AccountService accountService, RoleService roleService, AccountSessionService accountSessionService) {
|
|
|
+ this.accountService = accountService;
|
|
|
this.roleService = roleService;
|
|
|
this.accountSessionService = accountSessionService;
|
|
|
}
|
|
|
@@ -57,11 +57,11 @@ public class UserPageController {
|
|
|
public String userPage(@RequestParam(value = "screenName", required = false) String screenName, Model model) {
|
|
|
Page<UserVO> page;
|
|
|
if (screenName != null) {
|
|
|
- List<UserVO> list = userQuery.getByMatchScreenName(screenName);
|
|
|
+ List<UserVO> list = accountService.getByMatchScreenName(screenName);
|
|
|
page = new PageImpl<>(list);
|
|
|
} else {
|
|
|
PageRequest pageRequest = PageSort.pageRequest();
|
|
|
- page = userQuery.getUserVOByPage(pageRequest);
|
|
|
+ page = accountService.getUserVOByPage(pageRequest);
|
|
|
}
|
|
|
|
|
|
Map<Integer, String> map = accountSessionService.getLastAccess();
|
|
|
@@ -90,7 +90,7 @@ public class UserPageController {
|
|
|
@ApiOperation(value = "用户详细信息页面")
|
|
|
@GetMapping("/detail/{id}")
|
|
|
public String userDetailPage(@PathVariable("id") int id, Model model) {
|
|
|
- User user = userQuery.findById(id);
|
|
|
+ User user = accountService.getById(id);
|
|
|
Set<RoleVO> roles = roleService.getUserRoles(user.getId());
|
|
|
List<String> names = roles.stream().map(RoleVO::getName).collect(Collectors.toList());
|
|
|
|