package com.its.op.controller.its.scrs;

import com.its.op.dto.its.scrs.TbScSgnlIxrSttsDto;
import com.its.op.service.its.scrs.TbScSgnlIxrSttsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
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 = "14.스마트교차로-0.공통-1.신호제어기-상태")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/scrs/tb_sc_sgnl_ixr_stts")
public class TbScSgnlIxrSttsController {

    private final TbScSgnlIxrSttsService service;

    @ApiOperation(value = "신호 교차로 상태 전체조회(TB_SC_SGNL_IXR_STTS)", response = TbScSgnlIxrSttsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbScSgnlIxrSttsDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "신호 교차로 상태 전체조회(TB_SC_SGNL_IXR_STTS)", response = TbScSgnlIxrSttsDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScSgnlIxrSttsDto> findAllList() {
        return this.service.findAllList();
    }

    @ApiOperation(value = "신호 교차로 상태 개별조회(TB_SC_SGNL_IXR_STTS)", response = TbScSgnlIxrSttsDto.class)
    @GetMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
    public TbScSgnlIxrSttsDto findById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr) {
        return this.service.findById(sgnlIxrNmbr);
    }

}
