From 1f7f125ade79386da0bf3f34ed85de3662c0579f Mon Sep 17 00:00:00 2001 From: tianfeng <769204422@qq.com> Date: Tue, 11 Nov 2025 15:47:08 +0800 Subject: [PATCH] =?UTF-8?q?bd=20=E9=82=80=E8=AF=B7=E6=88=90=E4=B8=BA?= =?UTF-8?q?=E4=BB=A3=E7=90=86=20=E9=82=80=E8=AF=B7=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E9=99=90=E5=88=B6=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circle/other/inner/asserts/team/TeamErrorCode.java | 7 ++++++- .../other/app/command/team/AgentInviteHostExe.java | 5 +++++ .../other/app/command/team/BdAgentInviteExe.java | 10 +++++++--- .../app/command/team/BdInviteMessageProcessExe.java | 5 +++++ .../team/impl/TeamProfileClientServiceImpl.java | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java index 7391d3fc..ad25a857 100644 --- a/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java +++ b/rc-service/rc-inner-api/other-inner/other-inner-model/src/main/java/com/red/circle/other/inner/asserts/team/TeamErrorCode.java @@ -231,7 +231,12 @@ public enum TeamErrorCode implements IResponseErrorCode { /** * 设备指纹已被其他主播使用 */ - DEVICE_FINGERPRINT_USED_BY_ANCHOR(6053, "This device is already being used by another anchor"), + DEVICE_FINGERPRINT_USED_BY_ANCHOR(6053, "The device cannot add any more hosts."), + + /** + * 设备指纹已被其他代理使用 + */ + DEVICE_FINGERPRINT_USED_BY_AGENCY(6054, "The device cannot add any more agency."), ; private final Integer code; diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/AgentInviteHostExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/AgentInviteHostExe.java index c427f240..a61543f2 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/AgentInviteHostExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/AgentInviteHostExe.java @@ -68,6 +68,11 @@ public class AgentInviteHostExe { //已经加入团队 ResponseAssert.isNull(TeamErrorCode.JOINED_TEAM, teamMemberService.getByMemberId(userProfile.getId())); + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + cmd.getInviteUserId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_ANCHOR, hasAnchorWithSameDevice); + // 消息已发送 ResponseAssert.isFalse(TeamErrorCode.MESSAGE_PROCESSED, bdInviteAgentMessageService.existsWaitMessage(cmd.requiredReqUserId(), diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdAgentInviteExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdAgentInviteExe.java index 35b0c181..44db814f 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdAgentInviteExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdAgentInviteExe.java @@ -10,6 +10,7 @@ import com.red.circle.other.app.convertor.user.UserProfileAppConvertor; import com.red.circle.other.app.dto.cmd.team.DbInviteAgentCmd; import com.red.circle.other.app.util.OfficialNoticeUtils; import com.red.circle.other.domain.gateway.user.UserProfileGateway; +import com.red.circle.other.domain.gateway.user.ability.RegisterDeviceGateway; import com.red.circle.other.domain.gateway.user.ability.UserRegionGateway; import com.red.circle.other.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.mongo.entity.team.bd.BdInviteAgentMessage; @@ -54,7 +55,7 @@ public class BdAgentInviteExe { private final UserProfileGateway userProfileGateway; private final TeamProfileService teamProfileService; private final OfficialNoticeClient officialNoticeClient; - private final EnumConfigCacheService enumConfigCacheService; + private final RegisterDeviceGateway registerDeviceGateway; private final UserProfileAppConvertor userProfileAppConvertor; private final LatestMobileDeviceService latestMobileDeviceService; private final BdInviteAgentMessageService bdInviteAgentMessageService; @@ -77,8 +78,11 @@ public class BdAgentInviteExe { ResponseAssert.isFalse(TeamErrorCode.USER_APPLY_JOIN_OTHER_AGENT, teamApplicationProcessService.existWaitByUserId(cmd.getInviteUserId())); - // 校验设备关联 - // ResponseAssert.isTrue(TeamErrorCode.JOIN_RESTRICTIONS, checkDeviceUser(cmd.getInviteUserId())); + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + cmd.getInviteUserId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_AGENCY, hasAnchorWithSameDevice); + // 消息已发送 ResponseAssert.isFalse(TeamErrorCode.MESSAGE_PROCESSED, diff --git a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java index d8ac10de..cef452c6 100644 --- a/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java +++ b/rc-service/rc-service-other/other-application/src/main/java/com/red/circle/other/app/command/team/BdInviteMessageProcessExe.java @@ -97,6 +97,11 @@ public class BdInviteMessageProcessExe { if (Objects.equals(cmd.getStatus(), 1)) { Long teamId = createTeam(cmd, message); + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + message.getInviteUserId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_AGENCY, hasAnchorWithSameDevice); + businessDevelopmentTeamService.save(new BusinessDevelopmentTeam() .setSysOrigin(message.getSysOrigin()) .setAgentId(message.getInviteUserId()) diff --git a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/team/impl/TeamProfileClientServiceImpl.java b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/team/impl/TeamProfileClientServiceImpl.java index fa04d281..1790e7f4 100644 --- a/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/team/impl/TeamProfileClientServiceImpl.java +++ b/rc-service/rc-service-other/other-inner-endpoint/src/main/java/com/red/circle/other/app/inner/service/team/impl/TeamProfileClientServiceImpl.java @@ -218,7 +218,7 @@ public class TeamProfileClientServiceImpl implements TeamProfileClientService { // 主播设备指纹校验 Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( userProfile.getId()); - ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_ANCHOR, hasAnchorWithSameDevice); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_AGENCY, hasAnchorWithSameDevice); String key = "CreateTeam:" + userProfile.getId(); ResponseAssert.isTrue(CommonErrorCode.OPERATION_CONFLICT, redisService.lock(key, 60));