package com.its.op.controller.its.vds;

import com.its.op.dto.its.vds.TbVdsDtctClctDto;
import com.its.op.service.its.vds.TbVdsDtctClctService;
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 = "13.VDS-2.VDS 이력조회-2.검지기 원시수집 이력")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/vds/history/dtct-clct-hs")
public class TbVdsDtctClctController {

    private final TbVdsDtctClctService service;

    @ApiOperation(value = "VDS 검지기 원시 수집 이력조회(TB_VDS_DTCT_RAW_CLCT)", response = TbVdsDtctClctDto.class, responseContainer = "ArrayList")
    //@ApiModelProperty(position = 3, dataType="java.util.List<String>", example = "PRD1, PRD2, PRD3")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbVdsDtctClctDto> findAllByDateRange(
            @ApiParam(name = "FROM_DT", value = "조회시작시각(YYYYMMDDHH24MI00)", example = "20210112152000", required = true)
            @RequestParam String FROM_DT,
            @ApiParam(name = "TO_DT", value = "조회종료시각(YYYYMMDDHH24MI59)", example = "20221112152059", required = true)
            @RequestParam String TO_DT,
            @ApiParam(name = "id", value = "검지기 ID 목록", example = "[00010001, 0010002]", required = true)
            @RequestParam List<Long> id
    ) {
        return service.findAllByDateRange(FROM_DT, TO_DT, id);
    }

}
