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

import com.its.op.dto.its.scrs.TbScTodCnfgDto;
import com.its.op.entity.its.scrs.TbScTodCnfgKey;
import com.its.op.service.its.scrs.TbScTodCnfgService;
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.신호교차로-2.일일 시각 제어")
@Validated
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/scrs/tb_sc_tod_cnfg")
public class TbScTodCnfgController {

    private final TbScTodCnfgService service;

    @ApiOperation(value = "TOD 구성 전체조회(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "", produces = {"application/json; charset=utf8"})
    public List<TbScTodCnfgDto> findAll() {
        return this.service.findAll();
    }

    @ApiOperation(value = "TOD 구성 전체조회(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/list", produces = {"application/json; charset=utf8"})
    public List<TbScTodCnfgDto> findAllList() {
        return this.service.findAllList();
    }

    @ApiOperation(value = "TOD 구성 개별조회(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
    @GetMapping(value = "/{sgnlIxrNmbr}/{ixrOperMode}", produces = {"application/json; charset=utf8"})
    public List<TbScTodCnfgDto> findById(@PathVariable("sgnlIxrNmbr") final Integer sgnlIxrNmbr,
                                   @PathVariable("ixrOperMode") final Integer ixrOperMode) {
        return this.service.findListById(sgnlIxrNmbr, ixrOperMode);
    }
//
//    @ApiOperation(value = "TOD 구성 정보변경(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class)
//    @PutMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScTodCnfgDto updateById(@PathVariable("sgnlIxrNmbr") final TbScTodCnfgKey sgnlIxrNmbr, @RequestBody @Valid final TbScTodCnfgDto.TbScTodCnfgUpdReq req) {
//        return this.service.updateById(sgnlIxrNmbr, req);
//    }
//
//    @ApiOperation(value = "TOD 구성 정보변경/생성-목록(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
//    @PostMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScTodCnfgDto> mergeInfoList(@RequestBody @Valid final List<TbScTodCnfgDto.TbScTodCnfgUpdReq> listReq) {
//        return this.service.mergeInfoList(listReq);
//    }
//
//    @ApiOperation(value = "TOD 구성 정보변경/생성-개별(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class)
//    @PostMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScTodCnfgDto mergeInfo(@PathVariable("sgnlIxrNmbr") final TbScTodCnfgKey sgnlIxrNmbr, @RequestBody @Valid final TbScTodCnfgDto.TbScTodCnfgUpdReq req) {
//        return this.service.mergeInfo(req);
//    }
//
//    @ApiOperation(value = "TOD 구성 정보삭제-개별(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class)
//    @DeleteMapping(value = "/{sgnlIxrNmbr}", produces = {"application/json; charset=utf8"})
//    public TbScTodCnfgDto deleteDataById(@PathVariable("sgnlIxrNmbr") final TbScTodCnfgKey sgnlIxrNmbr) {
//        return this.service.deleteById(sgnlIxrNmbr);
//    }
//
//    @ApiOperation(value = "TOD 구성 정보삭제-목록(TB_SC_TOD_CNFG)", response = TbScTodCnfgDto.class, responseContainer = "ArrayList")
//    @DeleteMapping(value = "", produces = {"application/json; charset=utf8"})
//    public List<TbScTodCnfgDto> deleteDataByIds(@RequestBody @Valid final List<TbScTodCnfgKey> ids) {
//        return this.service.deleteByIds(ids);
//    }

}
