package com.its.op.controller.its.rse;

import com.its.op.dto.its.rse.TbRseObuClctHsDto;
import com.its.op.dto.its.rse.TbRseSectTrafHsDto;
import com.its.op.service.its.rse.TbRseObuClctHsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "14.RSE-1.RSE 관리-RSE OBU 수집 이력")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/rse/tb_rse_obu_clct_hs")
public class TbRseObuClctHsController {

    private final TbRseObuClctHsService service;

//    @ApiOperation(value = "RSE OBU 수집 이력 전체조회(TB_RSE_OBU_CLCT_HS)", response = TbRseObuClctHsDto.class, responseContainer = "ArrayList")
//    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbRseObuClctHsDto> findAll() {
//        return this.service.findAll();
//    }
    @ApiOperation(value = "RSE OBU 수집 이력조회(TB_RSE_CTLR_STTS_HS)", response = TbRseObuClctHsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbRseObuClctHsDto> findAllByDateRange(
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24MI00)", example = "20210112152000", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20221112152000", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "TYPE", value = "차종", example = "00", required = true)
            @RequestParam String TYPE,
            @ApiParam(name = "KIND", value = "OBU 종류", example = "00", required = true)
            @RequestParam String KIND,
            @ApiParam(name = "id", value = "RSE 구간 목록", example = "[00000001,00000002]", required = true)
            @RequestParam List<Long> id
    ) {
        return this.service.findAllByDateRange(FROM_DT, TO_DT, TYPE, KIND, id);
    }
}
