|
@@ -1,20 +1,13 @@
|
|
|
package com.zanxiang.game.module.sdk.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.github.sd4324530.jtuple.Tuple2;
|
|
|
-import com.zanxiang.game.module.mybatis.entity.Agent;
|
|
|
import com.zanxiang.game.module.mybatis.entity.Game;
|
|
|
-import com.zanxiang.game.module.mybatis.entity.User;
|
|
|
import com.zanxiang.game.module.mybatis.mapper.GameMapper;
|
|
|
import com.zanxiang.game.module.sdk.pojo.param.UserData;
|
|
|
-import com.zanxiang.game.module.sdk.service.IAgentService;
|
|
|
import com.zanxiang.game.module.sdk.service.IGameService;
|
|
|
-import com.zanxiang.game.module.sdk.service.IUserEventService;
|
|
|
-import com.zanxiang.game.module.sdk.service.IUserService;
|
|
|
import com.zanxiang.module.util.JsonUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.logging.log4j.util.Strings;
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.Collections;
|
|
@@ -29,15 +22,6 @@ import java.util.Map;
|
|
|
@Service
|
|
|
public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IGameService {
|
|
|
|
|
|
- @Autowired
|
|
|
- private IUserService userService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IAgentService agentService;
|
|
|
-
|
|
|
- @Autowired
|
|
|
- private IUserEventService userEventService;
|
|
|
-
|
|
|
@Override
|
|
|
public Map<String, Object> getAdSdkConfig(UserData userData) {
|
|
|
Game game = super.getById(userData.getGameId());
|
|
@@ -45,48 +29,5 @@ public class GameServiceImpl extends ServiceImpl<GameMapper, Game> implements IG
|
|
|
return Collections.singletonMap("adSdk", 0);
|
|
|
}
|
|
|
return JsonUtil.toMap(game.getAdSdkConfig(), Map.class, Object.class);
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- private Tuple2<User, Agent> getUserAndAgent(Long userId) {
|
|
|
- if (userId == null) {
|
|
|
- return Tuple2.with(null, null);
|
|
|
- }
|
|
|
- User user = userService.getById(userId);
|
|
|
- if (user == null) {
|
|
|
- return Tuple2.with(null, null);
|
|
|
- }
|
|
|
- return Tuple2.with(user, agentService.getById(user.getAgentId()));
|
|
|
}
|
|
|
}
|