|
|
@@ -109,7 +109,7 @@ public class KeycloakController {
|
|
|
return keycloakService.removeGroup(id);
|
|
|
}
|
|
|
|
|
|
- @PostMapping("/admin/users/add")
|
|
|
+ @PostMapping("/admin/users")
|
|
|
public Response addKeyClaokUser(@RequestBody UserRepresentation userRepresentation){
|
|
|
if(StringUtils.isEmpty(userRepresentation.getUsername())){
|
|
|
return Response.buildFailure("500","userName不能为空!");
|
|
|
@@ -161,4 +161,28 @@ public class KeycloakController {
|
|
|
return keycloakService.queryUserCredentials(userId);
|
|
|
}
|
|
|
|
|
|
+ @PutMapping("/keycloak/users/attribute")
|
|
|
+ public Response updateUserAttribute(@RequestHeader String userId , @RequestBody UserRepresentation representation){
|
|
|
+ if(CollectionUtils.isEmpty(representation.getAttributes())){
|
|
|
+ return Response.buildFailure("500","用户属性不能为空!");
|
|
|
+ }
|
|
|
+ return keycloakService.updateUser(userId , representation ,Constant.RESET_ATTRBUTE);
|
|
|
+ }
|
|
|
+
|
|
|
+ @PostMapping("/super/damin/tenant")
|
|
|
+ public Response addKeyclaokTenant(@RequestBody GroupRepresentation groupRepresentation){
|
|
|
+ if(StringUtils.isEmpty(groupRepresentation.getName())){
|
|
|
+ return Response.buildFailure("500","name不能为空!");
|
|
|
+ }
|
|
|
+ if(CollectionUtils.isEmpty(groupRepresentation.getAttributes())){
|
|
|
+ return Response.buildFailure("500","attributes不能为空!");
|
|
|
+ }
|
|
|
+ return keycloakService.addKeyclaokTenant(groupRepresentation);
|
|
|
+ }
|
|
|
+
|
|
|
+ @DeleteMapping("/super/damin/tenant/{id}")
|
|
|
+ public Response addKeyclaokTenant(@PathVariable("id")String id){
|
|
|
+ return keycloakService.removeGroup(id);
|
|
|
+ }
|
|
|
+
|
|
|
}
|