package cn.common.api;

import cn.common.common.anon.ApiLog;
import cn.common.interaction.resp.base.ApiResponse;
import cn.common.resp.AuthRoleCountResp;
import cn.common.service.StatisticsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author Singer create by Singer email:singer-coder@qq.com
 * @packageName cn.common.api
 * @Description: 系统统计相关前端控制器
 * @date 2022-04-16
 */
@RestController
@RequestMapping(value = "api/v1/statistics")
@Slf4j
public class StatisticsController extends BaseApiController{

    @Resource
    private StatisticsService statisticsService;

    /**
     * 查询系统角色对应的用户数量
     * @author: create by singer - Singer email:singer-coder@qq.com
     * @date 2022/4/16
     * @param
     * @return java.util.List
     */
    @PostMapping(value = "/queryAuthRoleCount")
    @ApiLog(value = "查询系统角色对应的用户数量")
    public ApiResponse<List<AuthRoleCountResp>> queryAuthRoleCount(){
        return apiResponse(statisticsService.queryAuthRoleCount());
    }
}
