package com.interplug.qcast.biz.commCode; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.web.bind.annotation.RestController; import com.interplug.qcast.biz.commCode.dto.CodeReq; import com.interplug.qcast.biz.commCode.dto.CommCodeApiResponse; import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; @Slf4j @RestController @RequestMapping("/api/commcode") @RequiredArgsConstructor @Tag(name = "CommCodeController", description = "공통코드 관련 API") public class CommCodeController { private final CommCodeService commCodeService; @Operation(description = "공통코드 정보를 등록/수정 한다.(동기화)") @PutMapping("/qc-comm-update") @ResponseStatus(HttpStatus.OK) public CommCodeApiResponse setQcCommCdYn(@RequestBody CodeReq codeReq) { CommCodeApiResponse codeResponse = new CommCodeApiResponse(); int resultCnt = commCodeService.setCommHUpdate(codeReq); if (resultCnt > 0) codeResponse.setCode("200"); else codeResponse.setCode("500"); return codeResponse; } }