package com.mosty.yjzl.controller;

import com.mosty.base.model.dto.yjzl.*;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.token.JwtSysUser;
import com.mosty.yjzl.service.YjzlStatisticsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
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;


@Api(tags = "预警信息相关统计接口，原magic旧接口--预警中心")
@AllArgsConstructor
@RestController
@RequestMapping("/yjzx")
public class YjzxStatisticsController {

    private YjzlStatisticsService yjzlStatisticsService;

    @ApiOperation("感知源预警排名")
    @JwtSysUser
    @GetMapping("/gzyyjpm")
    public ResponseResult<List<Map<String, Object>>> gzyyjpm(TbYjxxStatisticsDto dto) {
        return ResponseResult.success(yjzlStatisticsService.gzyyjpm(dto));
    }

    @ApiOperation("派出所预警排名")
    @JwtSysUser
    @GetMapping("/pcsyjpm")
    public ResponseResult<List<Map<String, Object>>> pcsyjpm(TbYjxxStatisticsDto dto) {
        return ResponseResult.success(yjzlStatisticsService.pcsyjpm(dto));
    }

    @ApiOperation("人员预警排名")
    @JwtSysUser
    @GetMapping("/ryyjpm")
    public ResponseResult<List<Map<String, Object>>> ryyjpm(TbYjxxStatisticsDto dto) {
        return ResponseResult.success(yjzlStatisticsService.ryyjpm(dto));
    }

    @ApiOperation("右侧预警统计")
    @JwtSysUser
    @GetMapping("/ycyjtj")
    public ResponseResult<List<Map<String, Object>>> ycyjtj(TbYjxxStatisticsQueryDto dto) {
        return ResponseResult.success(yjzlStatisticsService.ycyjtj(dto));
    }

    @ApiOperation("预警中心--预警统计")
    @JwtSysUser
    @GetMapping("/yjtj")
    public ResponseResult<List<Map<String, Object>>> ycyjtj() {
        return ResponseResult.success(yjzlStatisticsService.yjtj());
    }
}
