package com.mosty.rzzx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.base.model.dto.rzzx.TbRzXtfkInsertDto;
import com.mosty.base.model.entity.rzzx.TbRzXtfk;
import com.mosty.base.model.query.rzzx.TbRzHjQueryDto;
import com.mosty.base.model.query.rzzx.TbRzXtfkQueryDto;
import com.mosty.common.base.domain.ResponseResult;
import com.mosty.common.base.entity.log.BusinessType;
import com.mosty.common.base.entity.log.Log;
import com.mosty.common.token.JwtSysUser;
import com.mosty.rzzx.service.RzzxStatisticsService;
import com.mosty.rzzx.service.TbRzXtfkService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

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

/**
 * @author dw
 * @since 2022/8/4
 * 系统反馈日志接口
 **/
@Api(tags = "日志中心统计接口--原magic接口")
@RestController
@AllArgsConstructor
@RequestMapping("/yjsj")
public class RzzxStatisticsController {

    private final RzzxStatisticsService rzzxStatisticsService;

    @ApiOperation("列表查询")
    @JwtSysUser
    @GetMapping("/lbcx")
    public ResponseResult<IPage<Map<String, Object>>> lbcx(TbRzHjQueryDto dto) {
        return ResponseResult.success(this.rzzxStatisticsService.lbcx(dto));
    }

    @ApiOperation("各部门反馈统计(市级权限)")
    @JwtSysUser
    @GetMapping("/tjfx/sjfktj")
    public ResponseResult<List<Map<String, Object>>> sjfktj() {
        return ResponseResult.success(this.rzzxStatisticsService.sjfktj());
    }

    @ApiOperation("各部门反馈统计(县级权限)")
    @JwtSysUser
    @GetMapping("/tjfx/xjfktj")
    public ResponseResult<List<Map<String, Object>>> xjfktj() {
        return ResponseResult.success(this.rzzxStatisticsService.xjfktj());
    }

    @ApiOperation("各类反馈统计")
    @JwtSysUser
    @GetMapping("/tjfx/glfktj")
    public ResponseResult<List<Map<String, Object>>> glfktj() {
        return ResponseResult.success(this.rzzxStatisticsService.glfktj());
    }

    @ApiOperation("各系统反馈统计")
    @JwtSysUser
    @GetMapping("/tjfx/gxtfktj")
    public ResponseResult<List<Map<String, Object>>> gxtfktj() {
        return ResponseResult.success(this.rzzxStatisticsService.gxtfktj());
    }
}
