package com.its.api.its.controller.vms;

import com.its.api.its.model.dto.vms.TbVmsMsgDsplSchDto;
import com.its.api.its.service.vms.TbVmsMsgDsplSchService;
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.스케줄관리-1.자동 스케줄 관리")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/vms/schedule/auto")
public class TbVmsMsgDsplSchAutoController {

    private final TbVmsMsgDsplSchService service;

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

    // 정체
    @ApiOperation(value = "VMS 폼 정보 조회-정체(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/congest/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllCongestByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllCongest(id);
    }

    // 돌발
    @ApiOperation(value = "VMS 폼 정보 조회-돌발(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/incident/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllIncidentByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllIncident(id);
    }

    // 공사/행사
    @ApiOperation(value = "VMS 폼 정보 조회-공사/행사(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/event/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllEventByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllEvent(id);
    }

    // 홍보
    @ApiOperation(value = "VMS 폼 정보 조회-홍보(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/notice/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllHongboByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllHongbo(id);
    }

    // 우회도로
    @ApiOperation(value = "VMS 폼 정보 조회-우회도로(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/detour/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllDetourByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllDetour(id);
    }

    // 재난안전
    @ApiOperation(value = "VMS 폼 정보 조회-재난안전(TB_VMS_TRFC_INFR_DSPL_SCH)", response = TbVmsMsgDsplSchDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list/safety/{id}", produces = {"application/json; charset=utf8"})
    public List<TbVmsMsgDsplSchDto> findAllSafetyByVmsType(
            @ApiParam(name = "id", value = "VMS 제어기 관리번호", example = "10005", required = true)
            @PathVariable final Long id
    ) {
        return this.service.findAllSafety(id);
    }

}
