package com.gyee.frame.controller.radar;

import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.service.redar.RedarService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

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

@Controller
@RequestMapping("//radar")
@Api(value = "故障与预警分类统计", tags = "故障与预警分类统计")
public class RadarController {
    @Resource
    private RedarService RedarService;


    @GetMapping("/gzfx")
    @ResponseBody
    @ApiOperation(value = "故障分析雷达图", notes = "故障分析雷达图")
    public AjaxResult gzfx(@RequestParam(value = "stId", required = true) String stId,
                           @RequestParam(value = "Date", required = true) String Date) {
        List<List<Map>> hitch = RedarService.hitch(stId,Date);

        return AjaxResult.successData(200, hitch);
    }

    @GetMapping("/yjfx")
    @ResponseBody
    @ApiOperation(value = "预警分析雷达图", notes = "预警分析雷达图")
    public AjaxResult yjfx(@RequestParam(value = "stationid", required = true) String stationid,
                           @RequestParam(value = "date", required = true) String date){
        List<List<Map>> warning = RedarService.warning(stationid,date);

        return AjaxResult.successData(200, warning);
    }

}
