package com.its.op.controller.its.weather;

import com.its.op.dto.its.weather.TbAtmpPltnPnstDto;
import com.its.op.dto.its.weather.TbAtmpPltnSttnDto;
import com.its.op.dto.its.weather.TbVilgFrcsPnstDto;
import com.its.op.dto.its.weather.TbVilgFrcsZoneDto;
import com.its.op.service.its.weather.TbAtmpPltnSttnService;
import com.its.op.service.its.weather.TbVilgFrcsZoneService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "00.공통-02.기상정보")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/its/common/weather")
public class WeatherController {

    private final TbAtmpPltnSttnService atmpService;
    private final TbVilgFrcsZoneService frcsService;

    @ApiOperation(value = "대기 오염 측정소 정보", response = TbAtmpPltnSttnDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/atmp/list", produces = {"application/json; charset=utf8"})
    public List<TbAtmpPltnSttnDto> findAllListAtmp() {
        return this.atmpService.findAllList();
    }

    @ApiOperation(value = "대기 오염 실시간 현황", response = TbAtmpPltnPnstDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/atmp/status", produces = {"application/json; charset=utf8"})
    public List<TbAtmpPltnPnstDto> findAllRealtimeStatusAtmp() {
        return this.atmpService.findAllRealtimeStatus();
    }

    @ApiOperation(value = "동네 예보 구역 정보", response = TbVilgFrcsZoneDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/frcs/list", produces = {"application/json; charset=utf8"})
    public List<TbVilgFrcsZoneDto> findAllListFrcs() {
        return this.frcsService.findAllList();
    }

    @ApiOperation(value = "동네 예보 실시간 현황", response = TbVilgFrcsPnstDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/frcs/status", produces = {"application/json; charset=utf8"})
    public List<TbVilgFrcsPnstDto> findAllRealtimeStatusFrcs() {
        return this.frcsService.findAllRealtimeStatus();
    }

}
