新增靓号已存在处理

This commit is contained in:
tianfeng 2025-12-16 17:20:33 +08:00
parent 5fe5405dbb
commit 208cfcbc4a
2 changed files with 10 additions and 0 deletions

View File

@ -148,6 +148,12 @@ public enum OtherErrorCode implements IResponseErrorCode {
* 红包过期时间配置错误
*/
RED_PACKET_EXPIRE_TIME_ERROR(3271, "Invalid expire time configuration"),
/**
* 靓号已存在
*/
SPECIAL_ID_ALREADY_EXISTS(3272, "Special numbers already exist"),
;
private final int code;

View File

@ -17,6 +17,7 @@ import com.red.circle.other.infra.database.rds.entity.user.user.UserBeautifulNum
import com.red.circle.other.infra.database.rds.service.user.user.UserBeautifulNumberApplyService;
import com.red.circle.other.infra.database.rds.service.user.user.UserBeautifulNumberService;
import com.red.circle.other.app.inner.convertor.user.UserProfileInnerConvertor;
import com.red.circle.other.inner.asserts.OtherErrorCode;
import com.red.circle.other.inner.model.cmd.user.BeautifulNumberQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberApplyQryCmd;
import com.red.circle.other.inner.model.cmd.user.UserBeautifulNumberCmd;
@ -78,6 +79,9 @@ public class UserBeautifulNumberClientServiceImpl implements
userSpecialIdService.remove(userSpecialId.getId());
}
boolean exists = userSpecialIdService.exists(userRegion.getSysOrigin(), beautifulNumberApply.getApplyAccount());
ResponseAssert.isFalse(OtherErrorCode.SPECIAL_ID_ALREADY_EXISTS, exists);
// 创建新靓号
UserSpecialId specialIdCmd = new UserSpecialId();
specialIdCmd.setSysOrigin(beautifulNumberApply.getSysOrigin());