package com.mosty.yjzl.controller;

import com.mosty.base.model.vo.yjzl.TbYjzlZqtjVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjphVo;
import com.mosty.base.model.vo.yjzl.TbYjzltjxxVo;
import com.mosty.base.model.vo.yjzl.TbYzzlDjtjVo;
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.yjzl.service.TbYjzltjService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

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

@Api(tags = "指令中心统计接口")
@AllArgsConstructor
@RestController
@RequestMapping("/tbZlxxtj")
public class TbZlxxtjController {

    private TbYjzltjService tbYjzltjService;

    @ApiOperation("指令中心--首页指令状态统计信息")
    @GetMapping(value = "/ZlZtTjxx")
    @JwtSysUser
    public ResponseResult<List<TbYjzltjxxVo>> ZlZtTjxx() {
        return ResponseResult.success(tbYjzltjService.rwzttjxx());
    }

    @ApiOperation("指令中心--首页指令排行统计信息")
    @GetMapping(value = "/zlPhTjxx")
    @JwtSysUser
    @ApiImplicitParams({
        @ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
    })
    public ResponseResult<List<TbYjzltjphVo>> zlPhTjxx(String type) {
        return ResponseResult.success(tbYjzltjService.rwphtjxx(type));
    }

    @ApiOperation("指令中心--首页指令周期统计信息")
    @GetMapping(value = "/zlZqtjxx")
    @JwtSysUser
    @ApiImplicitParams({
        @ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
    })
    public ResponseResult<Map<String, Object>> zlZqtjxx(String type) {
        return ResponseResult.success(tbYjzltjService.zlZqtjxx(type));
    }

    @ApiOperation("指令中心--首页指令等级统计信息")
    @GetMapping(value = "/zlDjtjxx")
    @JwtSysUser
    @ApiImplicitParams({
            @ApiImplicitParam(name = "type", value = "1.今日 2.近7日 3.近30日 4.近90日", dataType = "String", required = true)
    })
    public ResponseResult<List<TbYzzlDjtjVo>> zlDjtjxx(String type) {
        return ResponseResult.success(tbYjzltjService.zlDjtjxx(type));
    }
}
