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 fc157b6d..c427f240 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 @@ -13,6 +13,7 @@ import com.red.circle.other.app.dto.clientobject.team.BdInviteMessageCO; import com.red.circle.other.app.dto.cmd.team.*; 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.infra.database.cache.service.other.EnumConfigCacheService; import com.red.circle.other.infra.database.mongo.entity.team.bd.BdInviteAgentMessage; import com.red.circle.other.infra.database.mongo.entity.team.bd.MessageInviteGroup; @@ -51,7 +52,7 @@ public class AgentInviteHostExe { private final TeamMemberService teamMemberService; private final TeamProfileService teamProfileService; private final OfficialNoticeClient officialNoticeClient; - private final EnumConfigCacheService enumConfigCacheService; + private final RegisterDeviceGateway registerDeviceGateway; private final UserProfileAppConvertor userProfileAppConvertor; private final BdInviteAgentMessageService bdInviteAgentMessageService; @@ -165,6 +166,11 @@ public class AgentInviteHostExe { cmd.getStatus(), MessageInviteGroup.AGENT_INVITE_HOST.name())); if (Objects.equals(cmd.getStatus(), 1)) { + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + message.getInviteUserId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_ANCHOR, hasAnchorWithSameDevice); + teamMemberService.addMember(new TeamMember() .setSortId(IdWorkerUtils.getId()) .setSysOrigin(cmd.requireReqSysOrigin()) 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 a3ef849c..fa04d281 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 @@ -15,6 +15,7 @@ import com.red.circle.mq.business.model.event.team.TeamSalaryCountEvent; import com.red.circle.mq.rocket.business.streams.TeamSalaryCountSink; import com.red.circle.other.app.inner.service.team.TeamProfileClientService; 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.model.user.UserProfile; import com.red.circle.other.infra.convertor.team.TeamInfraConvertor; import com.red.circle.other.infra.database.mongo.dto.team.TeamBillSettleResult; @@ -117,6 +118,7 @@ public class TeamProfileClientServiceImpl implements TeamProfileClientService { private final TeamApplicationProcessApprovalService teamApplicationProcessApprovalService; private final BillDiamondBalanceService billDiamondBalanceService; private final BillDiamondBalanceDetailsService billDiamondBalanceDetailsService; + private final RegisterDeviceGateway registerDeviceGateway; @Override public List listByIds(Set ids) { @@ -213,6 +215,11 @@ public class TeamProfileClientServiceImpl implements TeamProfileClientService { businessDevelopmentBaseInfoService.checkBD(cmd.getBdUserId())); } + // 主播设备指纹校验 + Boolean hasAnchorWithSameDevice = registerDeviceGateway.checkDeviceFingerprintHasAnchor( + userProfile.getId()); + ResponseAssert.isFalse(TeamErrorCode.DEVICE_FINGERPRINT_USED_BY_ANCHOR, hasAnchorWithSameDevice); + String key = "CreateTeam:" + userProfile.getId(); ResponseAssert.isTrue(CommonErrorCode.OPERATION_CONFLICT, redisService.lock(key, 60));