|
@@ -11,7 +11,6 @@ import com.zanxiang.game.module.manage.service.IPushMsgStrategyService;
|
|
|
import com.zanxiang.game.module.mybatis.entity.PushMsgSendResult;
|
|
|
import com.zanxiang.game.module.mybatis.entity.PushMsgStrategy;
|
|
|
import com.zanxiang.module.redis.service.IDistributedLockComponent;
|
|
|
-import com.zanxiang.module.util.JsonUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.dubbo.config.annotation.DubboService;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -21,7 +20,6 @@ import java.time.Duration;
|
|
|
import java.time.LocalDate;
|
|
|
import java.time.LocalDateTime;
|
|
|
import java.time.LocalTime;
|
|
|
-import java.util.Objects;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
/**
|
|
@@ -64,24 +62,15 @@ public class PushMsgRpcImpl implements IPushMsgRpc {
|
|
|
@Async
|
|
|
@Override
|
|
|
public void pushMsgByLevelUpdate(PushMsgParam param) {
|
|
|
- if (Objects.equals(param.getRoleId(), "834271457244980635")) {
|
|
|
- log.error("接收到消息 , param : {}", JsonUtil.toString(param));
|
|
|
- }
|
|
|
- //等级变更, 过滤战力变化, 1小时执行一次
|
|
|
String lock = RedisKeyConstant.GAME_USER_ROLE_UP_LOCK + param.getUserId() + "_" + param.getGameId() + "_"
|
|
|
+ param.getServerId() + "_" + param.getRoleId();
|
|
|
+ //线程锁
|
|
|
if (!distributedLockComponent.doLock(lock, 0L, 10L, TimeUnit.MINUTES)) {
|
|
|
- if (Objects.equals(param.getRoleId(), "834271457244980635")) {
|
|
|
- log.error("接收到消息, 触发锁不执行 , param : {}", JsonUtil.toString(param));
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
try {
|
|
|
//全局策略控制是否限制
|
|
|
if (this.defaultStrategyCheck(param)) {
|
|
|
- if (Objects.equals(param.getRoleId(), "834271457244980635")) {
|
|
|
- log.error("接收到消息, 全局策略判断 , param : {}", JsonUtil.toString(param));
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
//查询等级策略
|
|
@@ -93,9 +82,6 @@ public class PushMsgRpcImpl implements IPushMsgRpc {
|
|
|
.orderByDesc(PushMsgStrategy::getCreateTime)
|
|
|
.last("limit 1"));
|
|
|
if (pushMsgStrategy == null) {
|
|
|
- if (Objects.equals(param.getRoleId(), "834271457244980635")) {
|
|
|
- log.error("等级策略匹配为空, 不执行策略, param : {}", JsonUtil.toString(param));
|
|
|
- }
|
|
|
return;
|
|
|
}
|
|
|
pushMsgStrategyService.strategyPushMsgRun(pushMsgStrategy, param);
|