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

import com.its.op.dto.its.scrs.TbScPstnIxrMngmDto;
import com.its.op.entity.its.scrs.TbScPstnIxrMngmKey;
import com.its.op.service.its.scrs.TbScPstnIxrMngmService;
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.관리-4.신호교차로 그룹-1.그룹소속교차료")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/scrs/tb_sc_pstn_ixr_mngm")
public class TbScPstnIxrMngmController {

    private final TbScPstnIxrMngmService service;

    @ApiOperation(value = "소속 교차로 관리 전체조회(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbScPstnIxrMngmDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "소속 교차로 관리 전체조회(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScPstnIxrMngmDto> findAllList() {
        return this.service.findAllList();
    }

    @ApiOperation(value = "소속 교차로 관리 개별조회(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
    @GetMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
    public TbScPstnIxrMngmDto findById(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop) {
        return this.service.findById(ixrGrop);
    }
//
//    @ApiOperation(value = "소속 교차로 관리 정보변경(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
//    @PutMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
//    public TbScPstnIxrMngmDto updateById(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop, @RequestBody @Valid final TbScPstnIxrMngmDto.TbScPstnIxrMngmUpdReq req) {
//        return this.service.updateById(ixrGrop, req);
//    }
//
//    @ApiOperation(value = "소속 교차로 관리 정보변경/생성-목록(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class, responseContainer = "ArrayList")
//    @PostMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScPstnIxrMngmDto> mergeInfoList(@RequestBody @Valid final List<TbScPstnIxrMngmDto.TbScPstnIxrMngmUpdReq> listReq) {
//        return this.service.mergeInfoList(listReq);
//    }
//
//    @ApiOperation(value = "소속 교차로 관리 정보변경/생성-개별(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
//    @PostMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
//    public TbScPstnIxrMngmDto mergeInfo(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop, @RequestBody @Valid final TbScPstnIxrMngmDto.TbScPstnIxrMngmUpdReq req) {
//        return this.service.mergeInfo(req);
//    }
//
//    @ApiOperation(value = "소속 교차로 관리 정보삭제-개별(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class)
//    @DeleteMapping(value = "/{ixrGrop}", produces = {"application/json; charset=utf8"})
//    public TbScPstnIxrMngmDto deleteDataById(@PathVariable("ixrGrop") final TbScPstnIxrMngmKey ixrGrop) {
//        return this.service.deleteById(ixrGrop);
//    }
//
//    @ApiOperation(value = "소속 교차로 관리 정보삭제-목록(TB_SC_PSTN_IXR_MNGM)", response = TbScPstnIxrMngmDto.class, responseContainer = "ArrayList")
//    @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScPstnIxrMngmDto> deleteDataByIds(@RequestBody @Valid final List<TbScPstnIxrMngmKey> ids) {
//        return this.service.deleteByIds(ids);
//    }

}
