use of io.github.tesla.ops.system.domain.RoleDO in project tesla by linking12.
the class UserController method edit.
@RequiresPermissions("sys:user:edit")
@Log("编辑用户")
@GetMapping("/edit/{id}")
String edit(Model model, @PathVariable("id") Long id) {
UserDO userDO = userService.get(id);
model.addAttribute("user", userDO);
List<RoleDO> roles = roleService.list(id);
model.addAttribute("roles", roles);
return prefix + "/edit";
}
use of io.github.tesla.ops.system.domain.RoleDO in project tesla by linking12.
the class RoleServiceImpl method list.
@Override
public List<RoleDO> list(Long userId) {
List<Long> rolesIds = userRoleMapper.listRoleId(userId);
List<RoleDO> roles = roleMapper.list(new HashMap<>(16));
for (RoleDO roleDO : roles) {
roleDO.setRoleSign("false");
for (Long roleId : rolesIds) {
if (Objects.equals(roleDO.getRoleId(), roleId)) {
roleDO.setRoleSign("true");
break;
}
}
}
return roles;
}
use of io.github.tesla.ops.system.domain.RoleDO in project tesla by linking12.
the class RoleController method edit.
@Log("编辑角色")
@RequiresPermissions("sys:role:edit")
@GetMapping("/edit/{id}")
String edit(@PathVariable("id") Long id, Model model) {
RoleDO roleDO = roleService.get(id);
model.addAttribute("role", roleDO);
return prefix + "/edit";
}
Aggregations