use of com.code.server.login.vo.RecommandUserVo in project summer by foxsugar.
the class RecommendDelegateServiceImpl method findRecommandUser.
@Override
public RecommandUserVo findRecommandUser(long userId, long agentId) {
AgentBean agentBean = RedisManager.getAgentRedisService().getAgentBean(userId);
RecommandUserVo recommandUserVo = new RecommandUserVo();
if (agentBean != null) {
recommandUserVo.setUsername("用户不存在");
recommandUserVo.setUserId(new Long(0));
// 空头像
recommandUserVo.setImage("");
} else {
// 推荐代理
User user = userDao.findOne(userId);
logger.info("user:{}", user);
if (user == null) {
recommandUserVo.setUsername("用户不存在");
recommandUserVo.setUserId(new Long(0));
// 空头像
recommandUserVo.setImage("");
} else {
recommandUserVo.setImage(user.getImage() + "/96");
recommandUserVo.setUserId(userId);
recommandUserVo.setUsername(user.getUsername());
}
}
return recommandUserVo;
}
use of com.code.server.login.vo.RecommandUserVo in project summer by foxsugar.
the class RecommendDelegateAction method findUser.
@AuthChecker
@RequestMapping("/findUser")
public AgentResponse findUser(long userId) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long agentId = AgentUtil.getAgentByRequest(request);
RecommandUserVo vo = recommendDelegateService.findRecommandUser(userId, agentId);
Map<String, Object> result = new HashMap<>();
result.put("result", vo);
AgentResponse agentResponse = new AgentResponse(200, result);
return agentResponse;
}
Aggregations