diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java index fc43ef9..c57d79b 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/committee/schedules/controller/SchedulesApiController.java @@ -151,13 +151,13 @@ public class SchedulesApiController { ( @AuthenticationPrincipal LoginVO user, HttpServletRequest request, - @PathVariable("scheduleId") String schdulId + @PathVariable("scheduleId") String strSchdulId ) throws Exception { ResultVO resultVO = new ResultVO(); - Long test = Long.valueOf(schdulId); + Long schdulId = Long.valueOf(strSchdulId); try { - resultVO = egovIndvdlSchdulManageService.deleteSchedule(resultVO, request, test); + resultVO = egovIndvdlSchdulManageService.deleteSchedule(resultVO, request, schdulId); } catch (Exception e) { resultVO.setResultCode(ResponseCode.FAILED.getCode()); resultVO.setResultMessage(e.getMessage()); diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/controller/PopUpApiController.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/controller/PopUpApiController.java index 87e9847..4f48dff 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/controller/PopUpApiController.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/controller/PopUpApiController.java @@ -129,7 +129,6 @@ public class PopUpApiController { @ApiResponses(value = { @ApiResponse(responseCode = "200", description = "등록 성공"), @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"), - @ApiResponse(responseCode = "900", description = "입력값 무결성 오류") }) @PutMapping(value = "/contents/api/popup-manage/{popupId}") public ResultVO contentsApiPopUpManageUpdate( @@ -162,6 +161,44 @@ public class PopUpApiController { } + @Operation( + summary = "팝업 비활성화 API", + description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 팝업을 비활성화 API. 삭제가 아닌 비활성화 임. 삭제는 없음.", + tags = {"PopUpApiController"} + ) + @ApiResponses(value = { + @ApiResponse(responseCode = "200", description = "등록 성공"), + @ApiResponse(responseCode = "403", description = "인가된 사용자가 아님"), + }) + @DeleteMapping(value = "/contents/api/popup-manage/{popupId}") + public ResultVO contentsApiPopUpManageDelete + ( + @AuthenticationPrincipal LoginVO user, + HttpServletRequest request, + @PathVariable("popupId") String strPopupId + ) throws Exception { + + ResultVO resultVO = new ResultVO(); + Long popupId = Long.valueOf(strPopupId); + try { + resultVO = popUpApiService.contentsApiPopUpManageDelete(resultVO, request, user, popupId); + } catch (Exception e) { + resultVO.setResultCode(ResponseCode.FAILED.getCode()); + resultVO.setResultMessage(e.getMessage()); + } + + System.out.println( + "\n--------------------------------------------------------------\n" + + request.getRequestURI() + " OUT:" + + "\n--------------------------------------------------------------\n" + + "resultVO.toString():" + "\n" + + resultVO.toString() + "\n" + + "\n--------------------------------------------------------------\n" + ); + + return resultVO; + } + @Operation( summary = "팝업 내용 불러오기 API", description = "관리자 단에서 '컨텐츠 관리' > '팝업 관리' 페이지에서 저장된 팝업을 불러오는 API", diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/service/impl/PopUpApiServiceImpl.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/service/impl/PopUpApiServiceImpl.java index 844dfd4..c9261a3 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/service/impl/PopUpApiServiceImpl.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/admin/contents/popUp/service/impl/PopUpApiServiceImpl.java @@ -226,7 +226,33 @@ public class PopUpApiServiceImpl extends EgovAbstractServiceImpl implements PopU @Override public ResultVO contentsApiPopUpManageDelete(ResultVO resultVO, HttpServletRequest request, LoginVO user, Long popupId) throws Exception { - return null; + System.out.println( + "\n--------------------------------------------------------------\n" + + request.getRequestURI() + " IN:" + + "\n--------------------------------------------------------------\n" + + "popupId:" + "\n" + + popupId + "\n" + + "\n--------------------------------------------------------------\n" + ); + + + Map response = tnPopupMngRepository.spDeleteTnPopupMng( + popupId.intValue(), + "admin", + null, + null, + null + ); + + Map dto = new HashMap(); + dto.put("errorMessage", response.get("_error_message") ); + dto.put("popupId", popupId ); + + resultVO.setResult(dto); + resultVO.setResultCode(ResponseCode.SUCCESS.getCode()); + resultVO.setResultMessage(ResponseCode.SUCCESS.getMessage()); + + return resultVO; } diff --git a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnPopupMngRepository.java b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnPopupMngRepository.java index 710c85f..b0403f2 100644 --- a/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnPopupMngRepository.java +++ b/kcsc-back-end/src/main/java/com/dbnt/kcscbackend/commonCode/repository/TnPopupMngRepository.java @@ -76,6 +76,23 @@ public interface TnPopupMngRepository extends JpaRepository spDeleteTnPopupMng( + @Param("_popup_seq") Integer popupSeq, + @Param("_modi_id") String modiId, + @Param("_result_count") Integer resultCount, + @Param("_result_code") String resultCode, + @Param("_error_message") String errorMessage + ); + + @Procedure("sp_is_valid_tn_popup_mng_id") int spIsValidTnPopupMngId( Integer popupSeq );