package com.its.op.controller.its.vms;

import com.its.op.dto.its.vms.TbVmsDsplSchDto;
import com.its.op.service.its.vms.TbVmsDsplSchService;
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.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "12.VMS-3.스케줄관리-2.고정 스케줄 관리")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/vms/schedule/fixed")
public class TbVmsDsplSchFixedController {

    private final TbVmsDsplSchService service;

    /**
     * VMS 제어기 관리 번호로 폼 표출 스케줄 목록 조회
     * @param id
     * @return
     */
    @ApiOperation(value = "VMS 폼 스케줄 목록 조회(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsDsplSchDto> findAllVmsDsplSchedule(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllFixed(id);
    }

}
