Search in sources :

Example 1 with AuthChecker

use of com.code.server.login.anotation.AuthChecker 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;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) OneLevelInfoVo(com.code.server.login.vo.OneLevelInfoVo) HashMap(java.util.HashMap) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) AuthChecker(com.code.server.login.anotation.AuthChecker) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 2 with AuthChecker

use of com.code.server.login.anotation.AuthChecker 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;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HashMap(java.util.HashMap) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) TwoLevelInfoVo(com.code.server.login.vo.TwoLevelInfoVo) AuthChecker(com.code.server.login.anotation.AuthChecker) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 3 with AuthChecker

use of com.code.server.login.anotation.AuthChecker in project summer by foxsugar.

the class RecommendDelegateAction method bindDelegate.

@AuthChecker
@RequestMapping("/bindDelegate")
public AgentResponse bindDelegate(long userId) {
    ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
    HttpServletRequest request = attributes.getRequest();
    long agentId = AgentUtil.getAgentByRequest(request);
    boolean ret = recommendDelegateService.bindDelegate(userId, agentId);
    Map<String, Object> result = new HashMap<>();
    AgentResponse agentResponse = null;
    if (ret) {
        result.put("msg", "绑定失败");
        agentResponse = new AgentResponse(500, result);
    } else {
        result.put("msg", "绑定成功");
        agentResponse = new AgentResponse(200, result);
    }
    return agentResponse;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) HashMap(java.util.HashMap) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) AuthChecker(com.code.server.login.anotation.AuthChecker) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 4 with AuthChecker

use of com.code.server.login.anotation.AuthChecker 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;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) RecommandUserVo(com.code.server.login.vo.RecommandUserVo) HashMap(java.util.HashMap) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) AuthChecker(com.code.server.login.anotation.AuthChecker) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Example 5 with AuthChecker

use of com.code.server.login.anotation.AuthChecker in project summer by foxsugar.

the class TodayChargeAction method waterRecord.

@AuthChecker
// 流水记录
@RequestMapping("/waterRecord")
public AgentResponse waterRecord() {
    ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
    HttpServletRequest request = attributes.getRequest();
    long agentId = AgentUtil.getAgentByRequest(request);
    List<WaterRecordVo> waterRecordVoList = todayChargeService.waterRecords(agentId);
    AgentResponse agentResponse = new AgentResponse(200, waterRecordVoList);
    return agentResponse;
}
Also used : HttpServletRequest(javax.servlet.http.HttpServletRequest) ServletRequestAttributes(org.springframework.web.context.request.ServletRequestAttributes) AuthChecker(com.code.server.login.anotation.AuthChecker) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

AuthChecker (com.code.server.login.anotation.AuthChecker)17 HttpServletRequest (javax.servlet.http.HttpServletRequest)17 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)17 ServletRequestAttributes (org.springframework.web.context.request.ServletRequestAttributes)17 HashMap (java.util.HashMap)6 AgentInfo (com.code.server.constant.db.AgentInfo)1 ChildCost (com.code.server.constant.db.ChildCost)1 AgentBean (com.code.server.constant.game.AgentBean)1 HomePageVo (com.code.server.login.vo.HomePageVo)1 OneLevelInfoVo (com.code.server.login.vo.OneLevelInfoVo)1 RecommandUserVo (com.code.server.login.vo.RecommandUserVo)1 TwoLevelInfoVo (com.code.server.login.vo.TwoLevelInfoVo)1 UserInfoVo (com.code.server.login.vo.UserInfoVo)1