Search in sources :

Example 1 with ThreeLevelInfoVo

use of com.code.server.login.vo.ThreeLevelInfoVo in project summer by foxsugar.

the class DelegateRelataionServiceImpl method fetchThreeLevelDelegateList.

@Override
public List<ThreeLevelInfoVo> fetchThreeLevelDelegateList(long agentId) {
    AgentBean agentBean = RedisManager.getAgentRedisService().getAgentBean(agentId);
    logger.info("》》》》》》》》》》》》》{}", agentBean);
    List<Long> aList = new ArrayList<>();
    for (long uid : agentBean.getChildList()) {
        if (RedisManager.getAgentRedisService().isExit(uid)) {
            aList.add(uid);
        }
    }
    // List<Long> bList = new ArrayList<>();
    // for (Long id : aList){
    // AgentBean bean = RedisManager.getAgentRedisService().getAgentBean(id);
    // for (Long uid : bean.getChildList()){
    // if (RedisManager.getAgentRedisService().isExit(uid)){
    // bList.add(uid);
    // }
    // }
    // }
    // List<User> cList = userDao.findUsersByIdIn(bList);
    // List<ThreeLevelInfoVo> resultList = new ArrayList<>();
    // for (User user : cList){
    // ThreeLevelInfoVo threeLevelInfoVo = new ThreeLevelInfoVo();
    // threeLevelInfoVo.setImage(user.getImage() + "/96");
    // threeLevelInfoVo.setUsername(user.getUsername());
    // threeLevelInfoVo.setUid(user.getId());
    // resultList.add(threeLevelInfoVo);
    // }
    List<User> cList = userDao.findUsersByIdIn(aList);
    List<ThreeLevelInfoVo> resultList = new ArrayList<>();
    for (User user : cList) {
        ThreeLevelInfoVo threeLevelInfoVo = new ThreeLevelInfoVo();
        threeLevelInfoVo.setImage(user.getImage() + "/96");
        threeLevelInfoVo.setUsername(user.getUsername());
        threeLevelInfoVo.setUid(user.getId());
        resultList.add(threeLevelInfoVo);
    }
    return resultList;
}
Also used : AgentBean(com.code.server.constant.game.AgentBean) ThreeLevelInfoVo(com.code.server.login.vo.ThreeLevelInfoVo) User(com.code.server.db.model.User) ArrayList(java.util.ArrayList)

Aggregations

AgentBean (com.code.server.constant.game.AgentBean)1 User (com.code.server.db.model.User)1 ThreeLevelInfoVo (com.code.server.login.vo.ThreeLevelInfoVo)1 ArrayList (java.util.ArrayList)1