package com.gyee.frame.controller.photovoltaic;

import com.gyee.frame.common.domain.AjaxResult;
import com.gyee.frame.service.photovoltaic.PhotovoltaicService;
import io.swagger.annotations.ApiOperation;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

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

@Controller
@RequestMapping("//photovoltaic")
public class PhotovoltaicController {
    @Resource
    private PhotovoltaicService photovoltaicService;

    @GetMapping("/query")
    @ResponseBody
    @ApiOperation(value = "", notes = "")
    public AjaxResult query(@RequestParam(value = "pagenum")Integer pageNum,
                            @RequestParam(value = "pagesize")Integer pageSize,
                            @RequestParam(value = "stationid", required = false) String stId,
                            @RequestParam(value = "windturbineid",required = false) String wtId,
                            @RequestParam(value = "category1",required = false) String category1,
                            @RequestParam(value = "category2",required = false) String category2,
                            @RequestParam(value = "rank",required = false) String rank,
                            @RequestParam(value = "modelid",required = false) String modelId,
                            @RequestParam(value = "snapid",required = false) Long snapId,
                            @RequestParam(value = "messagetype",required = false) Integer messageType,
                            @RequestParam(value = "keyword",required = false) String keyWord,
                            @RequestParam(value = "starttime", required = false) String starttime,
                            @RequestParam(value = "endtime", required = false) String endtime)

    {
        List<Map> ph = photovoltaicService.qy(pageNum,pageSize,stId,wtId,category1,category2,rank,modelId,snapId,messageType,keyWord,starttime,endtime);

        return AjaxResult.successData(200, ph);
    }
}
