Kaynağa Gözat

Merge remote-tracking branch 'origin/jiapu_aijiuyi' into dev

liyuliangjiazai 2 ay önce
ebeveyn
işleme
4fc94feb02

+ 5 - 1
code/backend/src/main/java/com/aijiuyi/admin/common/constant/ResultCode.java

@@ -157,7 +157,11 @@ public enum ResultCode {
     /** 内置用户分类不可删除 */
     USER_CATEGORY_BUILTIN_FORBIDDEN(1973, "内置用户分类不可删除或修改编码"),
     /** 用户分类已被使用 */
-    USER_CATEGORY_IN_USE(1974, "用户分类已被用户使用,不可删除");
+    USER_CATEGORY_IN_USE(1974, "用户分类已被用户使用,不可删除"),
+
+    // ======================== 群组相关 2000-2099 ========================
+    /** 不能移除当前账号在群组中的成员记录 */
+    GROUP_CANNOT_REMOVE_SELF(2000, "不能移除当前账号在群组中的成员记录");
 
     // ======================== 其他业务错误码在此区间之后继续添加 ========================
 

+ 1 - 1
code/backend/src/main/java/com/aijiuyi/admin/service/impl/AppDeviceGroupServiceImpl.java

@@ -266,7 +266,7 @@ public class AppDeviceGroupServiceImpl implements AppDeviceGroupService {
         }
         // 不允许删除当前账号自己的成员记录
         if (Objects.equals(member.getAppUserId(), appUserId)) {
-            throw new BusinessException(ResultCode.FORBIDDEN.getCode(), "不能移除当前账号在群组中的成员记录");
+            throw new BusinessException(ResultCode.GROUP_CANNOT_REMOVE_SELF);
         }
         DeviceGroupMember update = new DeviceGroupMember();
         update.setId(member.getId());