From 208cfcbc4a8f69590660a8e96015b4758115f66b Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 16 Dec 2025 17:20:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E9=9D=93=E5=8F=B7=E5=B7=B2?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/red/circle/other/inner/asserts/OtherErrorCode.java | 6 ++++++ .../user/impl/UserBeautifulNumberClientServiceImpl.java | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/OtherErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/OtherErrorCode.java index 6c916ac6..e97b57b7 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/OtherErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/OtherErrorCode.java @@ -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; diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java index bf05c3b9..90241bb3 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/user/user/impl/UserBeautifulNumberClientServiceImpl.java @@ -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());