|
|
@@ -60,7 +60,7 @@ public class KeycloakUserController {
|
|
|
@DubboReference
|
|
|
private SmsbLogService smsbLogService;
|
|
|
|
|
|
- @SmsbMethodLog(description = "公众号扫描关注")
|
|
|
+ @SmsbMethodLog(description = "公众号扫描关注",business = "公众号关注")
|
|
|
@PostMapping("/keycloak/update/user")
|
|
|
public Response updateUser(@RequestBody String json){
|
|
|
SubscribeDto subscribe = JSONObject.parseObject(json, SubscribeDto.class);
|
|
|
@@ -71,14 +71,14 @@ public class KeycloakUserController {
|
|
|
return Response.buildSuccess();
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "公众号二维码展示")
|
|
|
+ @SmsbMethodLog(description = "公众号二维码展示" , business = "公众号二维码获取")
|
|
|
@GetMapping("/keycloak/query/ticket/{userId}")
|
|
|
public SingleResponse getTicket(@PathVariable("userId") String userId,
|
|
|
@RequestHeader("Authorization") String authorization) {
|
|
|
return SingleResponse.of(iWeChatService.queryTicket(appKey, userId, authorization));
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "密码重置")
|
|
|
+ @SmsbMethodLog(description = "密码重置" , business = "密码重置")
|
|
|
@PutMapping("/keycloak/changePassword")
|
|
|
public Response changePassword(@RequestHeader("userId") String userId, String newPassword) {
|
|
|
if (StringUtils.isEmpty(userId)) {
|
|
|
@@ -102,7 +102,7 @@ public class KeycloakUserController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "密码重置")
|
|
|
+ @SmsbMethodLog(description = "密码重置" ,business = "密码重置")
|
|
|
@PutMapping("/admin/users/{userId}/resetPassword")
|
|
|
public Response resetPassword(@PathVariable("userId") String userId , @RequestBody CredentialRepresentation credential){
|
|
|
if(StringUtils.isEmpty(credential.getType()) || !credential.getType().equals(Constant.type)){
|
|
|
@@ -122,7 +122,7 @@ public class KeycloakUserController {
|
|
|
logDto.setUserId(userId);
|
|
|
logDto.setBusiness(3);
|
|
|
logDto.setDescription("账号角色分配");
|
|
|
- StringBuffer sbf = new StringBuffer("给用户:"+ usersRoleMappingDTO.getUserId());
|
|
|
+ StringBuffer sbf = new StringBuffer("给用户:"+ keycloakService.getUserMap().get(usersRoleMappingDTO.getUserId()));
|
|
|
if(!usersRoleMappingDTO.getAddRoleList().isEmpty()){
|
|
|
sbf.append(",分配角色:"+getRoleNameList(usersRoleMappingDTO.getAddRoleList()));
|
|
|
}
|
|
|
@@ -145,35 +145,36 @@ public class KeycloakUserController {
|
|
|
return roleRepList.stream().map(RoleRepresentation::getDescription).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "获取账号凭证")
|
|
|
+ @SysLogIgnore
|
|
|
@GetMapping("/admin/users/{userId}/credentials")
|
|
|
public Response queryUserCredentials(@PathVariable("userId")String userId){
|
|
|
return keycloakService.queryUserCredentials(userId);
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "删除账号凭证")
|
|
|
+ @SysLogIgnore
|
|
|
@DeleteMapping("/admin/users/{userId}/credentials/{credentialId}")
|
|
|
public Response removeUserCredentials(@PathVariable("userId")String userId,
|
|
|
@PathVariable("credentialId")String credentialId){
|
|
|
return keycloakService.removeUserCredentials(userId ,credentialId);
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "更新用户属性")
|
|
|
+ @SmsbMethodLog(description = "更新用户属性" ,business = "用户属性更新")
|
|
|
@PutMapping("/keycloak/users/attribute")
|
|
|
public Response updateUserAttribute(@RequestHeader String userId , @RequestBody UserRepresentation representation){
|
|
|
return keycloakService.updateUser(userId, representation, Constant.RESET_ATTRIBUTE);
|
|
|
}
|
|
|
|
|
|
@SmsbMethodLog(description = "新增账号",
|
|
|
- business = "添加账号:${smsbUserAdd.username}/${smsbUserAdd.name}于部门:${smsbUserAdd.departmentId}")
|
|
|
+ business = "添加账号:${smsbUserAdd.username}到部门:${smsbUserAdd.departmentName}")
|
|
|
@PostMapping("/admin/users")
|
|
|
public Response addKeyClaokUser(@RequestHeader String userId ,@Valid @RequestBody SmsbUserAdd smsbUserAdd){
|
|
|
Response checkResponse = departmentService.checkOperationAuthority(userId, smsbUserAdd.getTenant());
|
|
|
if(!checkResponse.isSuccess()){return checkResponse;}
|
|
|
return departmentService.addKeyClaokUser(userId ,smsbUserAdd);
|
|
|
}
|
|
|
+
|
|
|
@SmsbMethodLog(description = "账号分组",
|
|
|
- business = "将账号:${smsbRegrouping.userId}添加到部门:${smsbRegrouping.departmentId}")
|
|
|
+ business = "将账号:${smsbRegrouping.userId}添加到部门:${smsbRegrouping.departmentName}")
|
|
|
@PutMapping("/admin/users/regrouping")
|
|
|
public Response regrouping(@RequestHeader String userId,
|
|
|
@Valid @RequestBody SmsbRegrouping smsbRegrouping){
|
|
|
@@ -182,6 +183,7 @@ public class KeycloakUserController {
|
|
|
if(!checkResponse.isSuccess()){return checkResponse;}
|
|
|
return departmentService.regrouping(smsbRegrouping);
|
|
|
}
|
|
|
+
|
|
|
@SmsbMethodLog(description = "账号注销", business = "账号:${uId}注销")
|
|
|
@DeleteMapping("/admin/users/{uId}")
|
|
|
public Response enableSwitch(@RequestHeader String userId,
|
|
|
@@ -195,7 +197,7 @@ public class KeycloakUserController {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "部门用户分页列表展示", business = "获取部门:${departmentCmd.departmentId}用户列表")
|
|
|
+ @SysLogIgnore
|
|
|
@PostMapping("/admin/department/user/list")
|
|
|
public PageResponse<SmsbSimpleUserCO> queryDepartmentUserList(@RequestHeader String userId , @Valid @RequestBody SmsbDepartmentCmd departmentCmd){
|
|
|
Response checkResponse = departmentService.checkOperationAuthority(userId, departmentCmd.getTenant());
|
|
|
@@ -203,14 +205,15 @@ public class KeycloakUserController {
|
|
|
return departmentService.queryDepartmentUserList(departmentCmd);
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "账号部门迁移", business = "将账号:${userMigration.userName}迁移到部门:${userMigration.path}")
|
|
|
+ @SysLogIgnore
|
|
|
@PostMapping("/admin/users/temporary/migration")
|
|
|
public Response migration(@RequestHeader String userId , @RequestBody SmsbUserMigration userMigration){
|
|
|
Response checkResponse = departmentService.checkOperationAuthority(userId, userMigration.getTenant());
|
|
|
if(!checkResponse.isSuccess()){return checkResponse;}
|
|
|
return userService.migration(userMigration);
|
|
|
}
|
|
|
- @SmsbMethodLog(description = "账号启用/禁用", business = "账号:${switchDTO.userId}启用:${switchDTO.enabled}")
|
|
|
+
|
|
|
+ @SmsbMethodLog(description = "账号启用/禁用", business = "账号:${switchDTO.userName}启用:${switchDTO.enabled}")
|
|
|
@PutMapping("/admin/users/enabled")
|
|
|
public Response enableSwitch(@RequestHeader String userId,
|
|
|
@RequestBody SwitchDTO switchDTO){
|
|
|
@@ -223,6 +226,7 @@ public class KeycloakUserController {
|
|
|
}
|
|
|
return Response.buildFailure("500","账号启用/禁用失败!");
|
|
|
}
|
|
|
+
|
|
|
@SmsbMethodLog(description = "账号名称修改", business = "用户:${userUpdate.userId}将名称修改为:${userUpdate.name}")
|
|
|
@PutMapping("/admin/users/update")
|
|
|
public Response updateUserFirstName(@RequestHeader String userId ,
|
|
|
@@ -238,7 +242,7 @@ public class KeycloakUserController {
|
|
|
return Response.buildFailure("500", "用户名修改失败!");
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "消息推送预警级别", business = "将用户:${levelUpdate.userId}消息推送预警级别改为:${levelUpdate.informLevel}")
|
|
|
+ @SmsbMethodLog(description = "消息推送预警级别", business = "将用户账号:${levelUpdate.userName}消息推送预警级别改为:${levelUpdate.informName}")
|
|
|
@PutMapping("/admin/users/update/deviceExceptionLevel")
|
|
|
public Response updateUserFirstName(@RequestHeader String userId,
|
|
|
@RequestBody SmsbUserExceptionLevelUpdate levelUpdate) {
|
|
|
@@ -252,7 +256,7 @@ public class KeycloakUserController {
|
|
|
return Response.buildFailure("500", "接收级别修改失败!");
|
|
|
}
|
|
|
|
|
|
- @SmsbMethodLog(description = "个人部门树展示")
|
|
|
+ @SysLogIgnore
|
|
|
@GetMapping("/keycloak/oneself/tree")
|
|
|
public Response queryOneselfDepartTree(@RequestHeader String userId) {
|
|
|
return departmentService.queryOneselfDepartTree(userId);
|