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

import com.its.op.dto.its.scrs.TbScIxrPhasDto;
import com.its.op.service.its.scrs.TbScIxrPhasService;
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.스마트교차로-1.관리-3.신호교차로-1.현시구성정보")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/scrs/tb_sc_ixr_phas")
public class TbScIxrPhasController {

    private final TbScIxrPhasService service;

    @ApiOperation(value = "교차로 현시 전체조회(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbScIxrPhasDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "교차로 현시 전체조회(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScIxrPhasDto> findAllList() {
        return this.service.findAllList();
    }

    @ApiOperation(value = "교차로 현시 개별조회(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
    public List<TbScIxrPhasDto> findListById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr) {
        return this.service.findListById(sgnlIxrNmbr);
    }
//
//    @ApiOperation(value = "교차로 현시 정보변경(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class)
//    @PutMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScIxrPhasDto updateById(@PathVariable("sgnlIxrNmbr") final TbScIxrPhasKey sgnlIxrNmbr, @RequestBody @Valid final TbScIxrPhasDto.TbScIxrPhasUpdReq req) {
//        return this.service.updateById(sgnlIxrNmbr, req);
//    }
//
//    @ApiOperation(value = "교차로 현시 정보변경/생성-목록(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
//    @PostMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScIxrPhasDto> mergeInfoList(@RequestBody @Valid final List<TbScIxrPhasDto.TbScIxrPhasUpdReq> listReq) {
//        return this.service.mergeInfoList(listReq);
//    }
//
//    @ApiOperation(value = "교차로 현시 정보변경/생성-개별(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class)
//    @PostMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScIxrPhasDto mergeInfo(@PathVariable("sgnlIxrNmbr") final TbScIxrPhasKey sgnlIxrNmbr, @RequestBody @Valid final TbScIxrPhasDto.TbScIxrPhasUpdReq req) {
//        return this.service.mergeInfo(req);
//    }
//
//    @ApiOperation(value = "교차로 현시 정보삭제-개별(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class)
//    @DeleteMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScIxrPhasDto deleteDataById(@PathVariable("sgnlIxrNmbr") final TbScIxrPhasKey sgnlIxrNmbr) {
//        return this.service.deleteById(sgnlIxrNmbr);
//    }
//
//    @ApiOperation(value = "교차로 현시 정보삭제-목록(TB_SC_IXR_PHAS)", response = TbScIxrPhasDto.class, responseContainer = "ArrayList")
//    @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScIxrPhasDto> deleteDataByIds(@RequestBody @Valid final List<TbScIxrPhasKey> ids) {
//        return this.service.deleteByIds(ids);
//    }

}
