|
@@ -114,6 +114,29 @@ public class ApiController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 删除用户与分组关系表
|
|
|
+ * @param userId
|
|
|
+ * @param groupId
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @Transactional(rollbackFor=Exception.class)
|
|
|
+ @RequestMapping(value = "deleteUserGroup")
|
|
|
+ @ResponseBody
|
|
|
+ public BaseResult deleteUserGroup (@RequestParam("userId") String userId,
|
|
|
+ @RequestParam("groupId") String groupId){
|
|
|
+ BaseResult baseResult = new BaseResult();
|
|
|
+ // 查询用户是否存在
|
|
|
+ User dataUser = identityService.createUserQuery().userId(userId).singleResult();
|
|
|
+ if (dataUser != null) {
|
|
|
+ Group group = identityService.createGroupQuery().groupId(groupId).singleResult();
|
|
|
+ if (group != null) {
|
|
|
+ identityService.deleteMembership(userId, groupId);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return baseResult;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 删除用户
|
|
|
* @param id
|
|
|
* @return
|