80 lines
3.2 KiB
Java
80 lines
3.2 KiB
Java
package com.interplug.qcast.biz.canvaspopupstatus;
|
|
|
|
import com.interplug.qcast.biz.canvaspopupstatus.dto.CanvasPopupStatus;
|
|
import com.interplug.qcast.config.Exception.ErrorCode;
|
|
import com.interplug.qcast.config.Exception.QcastException;
|
|
import io.swagger.v3.oas.annotations.Operation;
|
|
import io.swagger.v3.oas.annotations.media.Schema;
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
import lombok.RequiredArgsConstructor;
|
|
import org.springframework.http.HttpStatus;
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
@RestController
|
|
@RequestMapping("/api/v1/canvas-popup-status")
|
|
@RequiredArgsConstructor
|
|
@Tag(name = "CanvasPopupStatusController", description = "Canvas Popup Status 관련 API")
|
|
public class CanvasPopupStatusController {
|
|
|
|
private final CanvasPopupStatusService canvasPopupStatusService;
|
|
|
|
/**
|
|
* 캔버스 팝업 상태를 조회한다.
|
|
*
|
|
* @param objectNo 물건정보 번호
|
|
* @param planNo plan 번호
|
|
* @param popupType 캔버스 팝업 단계
|
|
* @return 조회된 CanvasPopupStatus 객체, 조회된 데이터가 없을 경우 빈 객체 반환
|
|
*/
|
|
@Operation(description = "캔버스 팝업 상태를 조회한다.")
|
|
@GetMapping
|
|
public CanvasPopupStatus getCanvasPopupStatus(
|
|
@RequestParam @Schema(description = "물건정보 번호") String objectNo,
|
|
@RequestParam @Schema(description = "plan 번호") Integer planNo,
|
|
@RequestParam @Schema(description = "캔버스 팝업 단계") String popupType)
|
|
throws QcastException {
|
|
if (objectNo == null
|
|
|| objectNo.trim().isEmpty()
|
|
|| planNo == null
|
|
|| popupType == null
|
|
|| popupType.trim().isEmpty()) {
|
|
throw new QcastException(ErrorCode.INVALID_INPUT_VALUE);
|
|
}
|
|
return canvasPopupStatusService.selectCanvasPopupStatus(objectNo, planNo, popupType);
|
|
}
|
|
|
|
/**
|
|
* 캔버스 팝업 상태를 저장 또는 수정한다.
|
|
*
|
|
* @param canvasPopupStatus 저장 또는 수정할 CanvasPopupStatus 객체
|
|
* @throws QcastException 저장 또는 수정 중 예외 발생 시
|
|
*/
|
|
@Operation(description = "캔버스 팝업 상태를 저장 또는 수정한다.")
|
|
@PostMapping
|
|
public void saveCanvasPopupStatus(@RequestBody CanvasPopupStatus canvasPopupStatus)
|
|
throws QcastException {
|
|
canvasPopupStatusService.saveCanvasPopupStatus(canvasPopupStatus);
|
|
}
|
|
|
|
/**
|
|
* 캔버스 팝업 상태를 삭제한다. (미사용)
|
|
*
|
|
* @param canvasPopupStatus 삭제할 CanvasPopupStatus 객체
|
|
* @throws QcastException 삭제 중 예외 발생 시
|
|
*/
|
|
@Operation(description = "캔버스 팝업 상태를 삭제한다. (미사용)")
|
|
@DeleteMapping
|
|
@ResponseStatus(HttpStatus.NO_CONTENT)
|
|
public void deleteCanvasPopupStatus(@RequestBody CanvasPopupStatus canvasPopupStatus)
|
|
throws QcastException {
|
|
canvasPopupStatusService.deleteCanvasPopupStatus(canvasPopupStatus);
|
|
}
|
|
}
|