package com.cpp.web.controller.accuracy;

import com.cpp.common.core.domain.R;
import com.cpp.web.domain.accuracy.AccuracyPassRate;
import com.cpp.web.domain.enums.DataSourcesEnum;
import com.cpp.web.domain.enums.ForecastTypeEnum;
import com.cpp.web.service.accuracy.AccuracyPassRateService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

@RestController
@RequiredArgsConstructor
@RequestMapping("accuracyPassRate")
public class AccuracyPassRateController {
    private final AccuracyPassRateService accuracyPassRateService;

    @GetMapping("/getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode")
    public R getByTimeBetweenAndForecastTypeAndDataSourcesAndForecastModelAndStationCode(Long startTime, Long endTime, ForecastTypeEnum forecastType, DataSourcesEnum dataSources,Integer ago, String forecastModel, String stationCode){
        List<AccuracyPassRate> accuracyPassRateList = accuracyPassRateService.findByTimeBetweenAndForecastTypeAndDataSourcesAndAgoAndForecastModelAndStationCode(new Date(startTime),new Date(endTime),forecastType,dataSources,ago,forecastModel,stationCode);
        return R.ok(accuracyPassRateList);
    }
}
