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