|
@@ -98,27 +98,31 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
|
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- public boolean add(AgentAddParam param) {
|
|
|
- if (count(new LambdaQueryWrapper<Agent>()
|
|
|
- .eq(Agent::getAccountType, param.getAccountType())
|
|
|
- .eq(Agent::getAccountId, param.getAccountId())
|
|
|
- ) > 0) {
|
|
|
- throw new BaseException("一个账号只能建一个渠道,投一个游戏!!!");
|
|
|
+ public boolean add(AgentAddParam dto) {
|
|
|
+ AccountTypeEnum accountType = AccountTypeEnum.getByValue(dto.getAccountType());
|
|
|
+ if (accountType != AccountTypeEnum.UN_PUT) {
|
|
|
+ if (count(new LambdaQueryWrapper<Agent>()
|
|
|
+ .eq(Agent::getAccountType, dto.getAccountType())
|
|
|
+ .eq(Agent::getAccountId, dto.getAccountId())
|
|
|
+ ) > 0) {
|
|
|
+ throw new BaseException("一个账号只能建一个渠道,投一个游戏!!!");
|
|
|
+ }
|
|
|
}
|
|
|
return save(Agent.builder()
|
|
|
- .agentName(param.getAgentName())
|
|
|
+ .agentName(dto.getAgentName())
|
|
|
.agentKey(UUID.randomUUID().toString().replaceAll("-", ""))
|
|
|
- .accountType(param.getAccountType())
|
|
|
- .accountId(param.getAccountId())
|
|
|
- .gameId(param.getGameId())
|
|
|
- .userActionSetId(param.getUserActionSetId())
|
|
|
- .reportToken(param.getReportToken())
|
|
|
- .reportUrl(param.getReportUrl())
|
|
|
- .backPolicyId(param.getBackPolicyId())
|
|
|
- .putStatus(param.getPutStatus())
|
|
|
+ .accountType(dto.getAccountType())
|
|
|
+ .accountId(dto.getAccountId())
|
|
|
+ .gameId(dto.getGameId())
|
|
|
+ .userActionSetId(dto.getUserActionSetId())
|
|
|
+ .reportToken(dto.getReportToken())
|
|
|
+ .reportUrl(dto.getReportUrl())
|
|
|
+ .backPolicyId(dto.getBackPolicyId())
|
|
|
+ .putStatus(dto.getPutStatus())
|
|
|
.createTime(LocalDateTime.now())
|
|
|
.createBy(SecurityUtil.getUserId())
|
|
|
- .build());
|
|
|
+ .build()
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -200,6 +204,8 @@ public class AgentServiceImpl extends ServiceImpl<AgentMapper, Agent> implements
|
|
|
vo.setAgentKey("?agentKey=" + agent.getAgentKey());
|
|
|
} else if (accountType == AccountTypeEnum.TENCENT_H5 || accountType == AccountTypeEnum.TENCENT_MINI_GAME) {
|
|
|
vo.setAgentKey("?state=" + agent.getAgentKey());
|
|
|
+ } else {
|
|
|
+ vo.setAgentKey("?agentKey=" + agent.getAgentKey());
|
|
|
}
|
|
|
return vo;
|
|
|
}
|