refactor(系统设置): 优化系统用户邮箱邀请时邮箱重复的接口报错信息

This commit is contained in:
Jianguo-Genius 2024-07-04 18:00:47 +08:00 committed by 刘瑞斌
parent 95d103040c
commit 1d148639a3
2 changed files with 2 additions and 1 deletions

View File

@ -9,6 +9,7 @@ public enum SystemResultCode implements IResultCode {
USER_TOO_MANY(101511, "User too many"),
DEPT_USER_TOO_MANY(101512, "Department user too many"),
INVITE_EMAIL_EXIST(101513, "user_email_already_exists"),
/**
* 调用获取全局用户组接口如果操作的是非全局的用户组会返回该响应码

View File

@ -430,7 +430,7 @@ public class SimpleUserService {
//校验邮箱和角色的合法性
Map<String, String> errorMap = this.validateUserInfo(request.getInviteEmails());
if (MapUtils.isNotEmpty(errorMap)) {
throw new MSException(Translator.get("user.email.repeat") + " : " + StringUtils.join(errorMap.keySet(), ", "));
throw new MSException(SystemResultCode.INVITE_EMAIL_EXIST, JSON.toJSONString(errorMap.keySet()));
}
List<UserInvite> inviteList = userInviteService.batchInsert(request.getInviteEmails(), inviteUser.getId(), request.getUserRoleIds());
//记录日志