use of com.code.server.login.anotation.AuthChecker in project summer by foxsugar.
the class DelegateRelataionAction method findSelfPlayerOrDelegates.
// 检查用户
@AuthChecker
@RequestMapping("/findUserInfo")
public AgentResponse findSelfPlayerOrDelegates(long userId) {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long agentId = AgentUtil.getAgentByRequest(request);
UserInfoVo userInfo = delegateRelataionService.findUserInfo(agentId, userId);
AgentResponse agentResponse = null;
if (userInfo == null) {
Map<String, Object> result = new HashMap<>();
result.put("result", userInfo);
agentResponse = new AgentResponse(NOT_SELF_USER, result);
} else {
Map<String, Object> result = new HashMap<>();
result.put("result", userInfo);
agentResponse = new AgentResponse(200, result);
}
return agentResponse;
}
use of com.code.server.login.anotation.AuthChecker in project summer by foxsugar.
the class HomeAction method showHomePage.
@AuthChecker
@RequestMapping("/show")
public AgentResponse showHomePage() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
HttpServletRequest request = attributes.getRequest();
long agentId = AgentUtil.getAgentByRequest(request);
HomePageVo homePageVo = homeService.showHomePage(agentId);
Map<String, Object> rs = new HashMap<>();
rs.put("result", homePageVo);
AgentResponse agentResponse = new AgentResponse(200, rs);
return agentResponse;
}
Aggregations