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

import com.its.op.dto.its.scrs.TbScSgnlCtlrDto;
import com.its.op.dto.its.scrs.TbScSgnlCtlrPhaseDto;
import com.its.op.service.its.scrs.TbScSgnlCtlrService;
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_ctlr")
public class TbScSgnlCtlrController {

    private final TbScSgnlCtlrService service;

    @ApiOperation(value = "신호 제어기 전체조회(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbScSgnlCtlrDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "신호 제어기 전체조회(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScSgnlCtlrDto> findAllList() {
        return this.service.findAllList();
    }

    @ApiOperation(value = "신호 제어기 개별조회(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class)
    @GetMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
    public TbScSgnlCtlrDto findById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr) {
        return this.service.findById(sgnlIxrNmbr);
    }

    @ApiOperation(value = "신호 제어기 전체조회(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrPhaseDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScSgnlCtlrPhaseDto> findAllPhaseList() {
        return this.service.findAllPhaseList();
    }

//    @ApiOperation(value = "신호 제어기 정보변경(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class)
//    @PutMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScSgnlCtlrDto updateById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr, @RequestBody @Valid final TbScSgnlCtlrDto.TbScSgnlCtlrUpdReq req) {
//        return this.service.updateById(sgnlIxrNmbr, req);
//    }
//
//    @ApiOperation(value = "신호 제어기 정보변경/생성-목록(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class, responseContainer = "ArrayList")
//    @PostMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScSgnlCtlrDto> mergeInfoList(@RequestBody @Valid final List<TbScSgnlCtlrDto.TbScSgnlCtlrUpdReq> listReq) {
//        return this.service.mergeInfoList(listReq);
//    }
//
//    @ApiOperation(value = "신호 제어기 정보변경/생성-개별(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class)
//    @PostMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScSgnlCtlrDto mergeInfo(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr, @RequestBody @Valid final TbScSgnlCtlrDto.TbScSgnlCtlrUpdReq req) {
//        return this.service.mergeInfo(req);
//    }
//
//    @ApiOperation(value = "신호 제어기 정보삭제-개별(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class)
//    @DeleteMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScSgnlCtlrDto deleteDataById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr) {
//        return this.service.deleteById(sgnlIxrNmbr);
//    }
//
//    @ApiOperation(value = "신호 제어기 정보삭제-목록(TB_SC_SGNL_CTLR)", response = TbScSgnlCtlrDto.class, responseContainer = "ArrayList")
//    @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScSgnlCtlrDto> deleteDataByIds(@RequestBody @Valid final List<Integer> ids) {
//        return this.service.deleteByIds(ids);
//    }

}
