package cn.com.tenlion.systembase.controller.api.statistics;

import cn.com.tenlion.systembase.pojo.dtos.statistics.StatisticsDTO;
import cn.com.tenlion.systembase.pojo.dtos.statistics.StatisticsLineDTO;
import cn.com.tenlion.systembase.service.statistics.IStatisticsService;
import ink.wgink.common.base.DefaultBaseController;
import ink.wgink.interfaces.consts.ISystemConstant;
import ink.wgink.pojo.result.ErrorResult;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @ClassName: StatisticsController
 * @Description: 统计
 * @Author: CodeFactory
 * @Date: 2021-09-24 17:03:54
 * @Version: 3.0
 **/
@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "统计接口")
@RestController
@RequestMapping(ISystemConstant.API_PREFIX + "/statistics")
public class StatisticsController extends DefaultBaseController {

    @Autowired
    private IStatisticsService statisticsService;

    @ApiOperation(value = "9+x系统数据信息", notes = "9+x系统数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("base_sys_info")
    public List<StatisticsDTO> baseSysInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.baseSysInfo(params);
    }

    @ApiOperation(value = "学校类型数据信息", notes = "学校类型数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("school_info")
    public List<StatisticsDTO> schoolInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.schoolInfo(params);
    }

    @ApiOperation(value = "学校重点人员危害程度数据信息", notes = "学校重点人员危害程度数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("person_harm_info")
    public List<StatisticsDTO> personHarmInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.personHarmInfo(params);
    }

    @ApiOperation(value = "学校重点人员是否关注数据信息", notes = "学校重点人员是否关注数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("person_follow_info")
    public List<StatisticsDTO> personFollowInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.personFollowInfo(params);
    }

    @ApiOperation(value = "学校安全事件侦破情况数据信息", notes = "学校安全事件侦破情况数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("case_detect_info")
    public List<StatisticsDTO> caseDetectInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.caseDetectInfo(params);
    }

    @ApiOperation(value = "重点区域排查占比治安类型数据信息", notes = "重点区域排查占比治安类型数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("area_security_info")
    public List<StatisticsDTO> areaSecurityInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.areaSecurityInfo(params);
    }

    @ApiOperation(value = "重点区域排查占比区域类型数据信息", notes = "重点区域排查占比区域类型数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("area_type_info")
    public List<StatisticsDTO> areaTypeInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.areaTypeInfo(params);
    }

    @ApiOperation(value = "重特大案(事)件数据信息", notes = "重特大案(事)件数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("major_info")
    public List<StatisticsDTO> majorInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.majorInfo(params);
    }

    @ApiOperation(value = "重特大案(事)件数据信息", notes = "重特大案(事)件数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("case_info")
    public List<StatisticsLineDTO> caseInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.caseInfo(params);
    }

    @ApiOperation(value = "年度重点场所/区域巡查统计数据信息", notes = "年度重点场所/区域巡查统计数据信息接口")
    @ApiImplicitParams({})
    @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)})
    @GetMapping("key_place_info")
    public List<StatisticsLineDTO> keyPlaceInfo() {
        Map<String, Object> params = requestParams();
        return statisticsService.keyPlaceInfo(params);
    }

}