bd 邀请成为代理 邀请增加限制。
This commit is contained in:
parent
92ce1b2da0
commit
1f7f125ade
@ -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;
|
||||
|
||||
@ -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(),
|
||||
|
||||
@ -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,
|
||||
|
||||
@ -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())
|
||||
|
||||
@ -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));
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user