use of com.code.server.login.vo.OneLevelInfoVo in project summer by foxsugar.
the class DelegateRelataionAction method fetchPlayers.
@AuthChecker
@RequestMapping("/fetchPlayers")
public AgentResponse fetchPlayers() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long agentId = AgentUtil.getAgentByRequest(request);
List<OneLevelInfoVo> levelInfoVoList = delegateRelataionService.fetchSelfPlayerList(agentId);
Map<String, Object> result = new HashMap<>();
result.put("result", levelInfoVoList);
AgentResponse agentResponse = new AgentResponse(200, result);
return agentResponse;
}
use of com.code.server.login.vo.OneLevelInfoVo in project summer by foxsugar.
the class DelegateRelataionServiceImpl method fetchSelfPlayerList.
@Override
public List<OneLevelInfoVo> fetchSelfPlayerList(long agentId) {
AgentBean agentBean = RedisManager.getAgentRedisService().getAgentBean(agentId);
List<Long> aList = new ArrayList<>();
for (long uid : agentBean.getChildList()) {
if (RedisManager.getAgentRedisService().isExit(uid))
continue;
aList.add(uid);
}
List<OneLevelInfoVo> result = new ArrayList<>();
List<User> userList = this.userDao.findUsersByIdIn(aList);
System.out.println("===========++++aList:" + aList);
System.out.println("===========++++aList:" + userList);
for (User user : userList) {
OneLevelInfoVo oneLevelInfoVo = new OneLevelInfoVo();
oneLevelInfoVo.setImage(user.getImage() + "/96");
oneLevelInfoVo.setUsername(user.getUsername());
oneLevelInfoVo.setUid(user.getId());
result.add(oneLevelInfoVo);
}
return result;
}
Aggregations