package com.its.op.controller.its.analysis;

import com.its.op.dto.its.analysis.TbClctSystSttsHsPrcnDto;
import com.its.op.service.its.link.TbClctSystSttsHsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
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.RestController;

import java.util.List;

@Slf4j
@RequiredArgsConstructor
@RestController
@RequestMapping("/api/analysis/prcn-result")
@Api(tags = "04.분석-2.교통정보가공결과분석")
public class TbClctSystSttsHsPrcnController {

    private final TbClctSystSttsHsService service;

    @ApiOperation(value = "교통정보가공결과분석(TB_CLCT_SYST_STTS_HS, TB_TRFC_PRCN_STAT)", response = TbClctSystSttsHsPrcnDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbClctSystSttsHsPrcnDto> findAllByDateRange(
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24MI00)", example = "20220121000000", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20220121235959", required = true)
            @RequestParam String TO_DT) {

        return this.service.findAllPrcsSystByDateRange(FROM_DT, TO_DT);
    }

}
