package cn.common.api;

import cn.common.common.redis.RedisRepository;
import cn.common.interaction.resp.base.ApiResponse;
import cn.common.interaction.resp.statistics.StatisticsVisitCountResp;
import cn.common.service.AuthUserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author Singer create by singer email:singer-coder@qq.com
 * @projectName health-platform-api
 * @Description: 系统统计前端控制器
 * @date 2019-08-22
 */
@RestController
@RequestMapping(value = "api/v1/platformStatistics")
public class PlatformStatisticsController extends BaseApiController {

    @Resource
    private AuthUserService authUserService;

    @Resource
    private RedisRepository redisRepository;



    /**
     *  统计系统访问总量
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2019-08-22
     * @param  userName 用户名
     * @return StatisticsVisitCountResp
     */
    @GetMapping("/statisticsVisitCount/{userName}")
    public ApiResponse<StatisticsVisitCountResp> statisticsVisitCount(@PathVariable(name = "userName") String userName){
        return apiResponse(authUserService.statisticsVisitCount(userName));
    }


}
