package com.its.api.its.controller.analysis;

import com.its.api.its.model.dto.analysis.TbClctSystSttsHsClctDto;
import com.its.api.its.service.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/clct-result")
@Api(tags = "04.분석-1.교통정보수집결과분석")
public class TbClctSystSttsHsClctController {

    private final TbClctSystSttsHsService service;

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

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

}
