
250312 방선주 popup 폴더 throw 제거 및 주석 적용 / 일부 file throw 제거 적용
@612b8343ef1ac3148ab85ea939583aa28dbb23be
--- src/main/java/com/takensoft/cms/popup/Schedule/PopupScheduler.java
+++ src/main/java/com/takensoft/cms/popup/Schedule/PopupScheduler.java
... | ... | @@ -6,8 +6,11 @@ |
6 | 6 |
import org.springframework.transaction.annotation.Transactional; |
7 | 7 |
|
8 | 8 |
/** |
9 |
- * @author : 박정하 |
|
10 |
- * @since : 2024.05.23 |
|
9 |
+ * @author 박정하 |
|
10 |
+ * @since 2024.05.23 |
|
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.05.23 | 박정하 | 최초 등록 |
|
11 | 14 |
* |
12 | 15 |
* 팝업 종료일이 된 팝업 제거를 위한 스케쥴러 |
13 | 16 |
*/ |
... | ... | @@ -20,14 +23,14 @@ |
20 | 23 |
} |
21 | 24 |
|
22 | 25 |
/** |
23 |
- * @author : 박정하 |
|
24 |
- * @since : 2024.05.23 |
|
26 |
+ * @param |
|
27 |
+ * @return |
|
25 | 28 |
* |
26 |
- * 매일 자정에 종료일이 지난 팝업 삭제 |
|
29 |
+ * 리프레시 토큰 검증 |
|
27 | 30 |
*/ |
28 | 31 |
@Scheduled(cron = "0 0 0 * * *") |
29 | 32 |
@Transactional(rollbackFor = Exception.class) |
30 |
- public void cleanExpiredPopups() throws Exception { |
|
33 |
+ public void cleanExpiredPopups(){ |
|
31 | 34 |
popupDAO.cleanExpiredPopups(); |
32 | 35 |
} |
33 | 36 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/popup/dao/PopupDAO.java
+++ src/main/java/com/takensoft/cms/popup/dao/PopupDAO.java
... | ... | @@ -7,74 +7,77 @@ |
7 | 7 |
import java.util.*; |
8 | 8 |
|
9 | 9 |
/** |
10 |
- * @author : 박정하 |
|
11 |
- * @since : 2024.05.13 |
|
10 |
+ * @author 박정하 |
|
11 |
+ * @since 2024.05.13 |
|
12 |
+ * @modification |
|
13 |
+ * since | author | description |
|
14 |
+ * 2024.05.13 | 박정하 | 최초 등록 |
|
12 | 15 |
* |
13 |
- * 팝업 관련 Mapper |
|
16 |
+ * 팝업 관련 DAO |
|
14 | 17 |
*/ |
15 | 18 |
@Mapper("popupDAO") |
16 | 19 |
public interface PopupDAO { |
17 | 20 |
/** |
18 |
- * @author : 박정하 |
|
19 |
- * @since : 2024.05.13 |
|
21 |
+ * @param popupVO - 팝업 등록 정보 |
|
22 |
+ * @return int - 팝업 등록 여부 (1: 성공, 0: 실패) |
|
20 | 23 |
* |
21 | 24 |
* 팝업 등록 |
22 | 25 |
*/ |
23 |
- public int insertPopup(PopupVO popupVO) throws Exception; |
|
26 |
+ int insertPopup(PopupVO popupVO); |
|
24 | 27 |
|
25 | 28 |
/** |
26 |
- * @author : 박정하 |
|
27 |
- * @since : 2024.05.13 |
|
29 |
+ * @param pagination - 페이지네이션 정보 |
|
30 |
+ * @return int - 팝업 목록 개수 |
|
28 | 31 |
* |
29 |
- * 팝업 목록 갯수 |
|
32 |
+ * 팝업 목록 개수 |
|
30 | 33 |
*/ |
31 |
- public int selectPopupListCnt(Pagination pagination) throws Exception; |
|
34 |
+ int selectPopupListCnt(Pagination pagination); |
|
32 | 35 |
|
33 | 36 |
/** |
34 |
- * @author : 박정하 |
|
35 |
- * @since : 2024.05.13 |
|
37 |
+ * @param pagination - 페이지네이션 정보 |
|
38 |
+ * @return List<PopupVO> - 검색된 팝업 목록 |
|
36 | 39 |
* |
37 | 40 |
* 팝업 목록 조회 |
38 | 41 |
*/ |
39 |
- public List<PopupVO> selectPopupList(Pagination pagination) throws Exception; |
|
42 |
+ List<PopupVO> selectPopupList(Pagination pagination); |
|
40 | 43 |
|
41 | 44 |
/** |
42 |
- * @author : 박정하 |
|
43 |
- * @since : 2024.05.13 |
|
45 |
+ * @param popupVO - 팝업 정보 |
|
46 |
+ * @return PopupVO - 팝업 상세 정보 |
|
44 | 47 |
* |
45 | 48 |
* 팝업 목록 상세 |
46 | 49 |
*/ |
47 |
- public PopupVO selectPopupDetail(PopupVO popupVO) throws Exception; |
|
50 |
+ PopupVO selectPopupDetail(PopupVO popupVO); |
|
48 | 51 |
|
49 | 52 |
/** |
50 |
- * @author : 박정하 |
|
51 |
- * @since : 2024.05.13 |
|
53 |
+ * @param popupVO - 팝업 정보 |
|
54 |
+ * @return int - 팝업 수정 여부 (1: 성공, 0: 실패) |
|
52 | 55 |
* |
53 | 56 |
* 팝업 수정 |
54 | 57 |
*/ |
55 |
- public int updatePopup(PopupVO popupVO) throws Exception; |
|
58 |
+ int updatePopup(PopupVO popupVO); |
|
56 | 59 |
|
57 | 60 |
/** |
58 |
- * @author : 박정하 |
|
59 |
- * @since : 2024.05.22 |
|
61 |
+ * @param pageType - 팝업 페이지 타입 |
|
62 |
+ * @return List<PopupVO> - 검색된 팝업 목록 |
|
60 | 63 |
* |
61 | 64 |
* 팝업 목록 조회 (팝업창 띄우는 용도) |
62 | 65 |
*/ |
63 |
- public List<PopupVO> selectPopupListByPage(String pageType) throws Exception; |
|
66 |
+ List<PopupVO> selectPopupListByPage(String pageType); |
|
64 | 67 |
|
65 | 68 |
/** |
66 |
- * @author : 박정하 |
|
67 |
- * @since : 2024.05.23 |
|
69 |
+ * @param |
|
70 |
+ * @return int - 팝업 삭제 여부 (1: 성공, 0: 실패) |
|
68 | 71 |
* |
69 | 72 |
* 매일 자정에 종료일이 지난 팝업 삭제 |
70 | 73 |
*/ |
71 |
- public int cleanExpiredPopups() throws Exception; |
|
74 |
+ int cleanExpiredPopups(); |
|
72 | 75 |
|
73 | 76 |
/** |
74 |
- * @author : 박정하 |
|
75 |
- * @since : 2024.05.28 |
|
77 |
+ * @param |
|
78 |
+ * @return List<PopupVO> - 팝업 최신 목록 |
|
76 | 79 |
* |
77 | 80 |
* 팝업 최신 목록 조회 (최신글 5건 출력) |
78 | 81 |
*/ |
79 |
- public List<PopupVO> selectPopupListByNew() throws Exception; |
|
82 |
+ List<PopupVO> selectPopupListByNew() throws Exception; |
|
80 | 83 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
+++ src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
... | ... | @@ -6,30 +6,41 @@ |
6 | 6 |
import com.takensoft.cms.popup.service.PopupService; |
7 | 7 |
import com.takensoft.cms.popup.vo.PopupVO; |
8 | 8 |
import com.takensoft.common.Pagination; |
9 |
+import com.takensoft.common.exception.CustomDeleteFailException; |
|
10 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
11 |
+import com.takensoft.common.exception.CustomNotFoundException; |
|
12 |
+import com.takensoft.common.exception.CustomUpdateFailException; |
|
9 | 13 |
import com.takensoft.common.file.service.FileMngService; |
10 | 14 |
import com.takensoft.common.file.vo.FileMngVO; |
11 | 15 |
import com.takensoft.common.idgen.service.IdgenService; |
12 | 16 |
import com.takensoft.common.util.JWTUtil; |
13 | 17 |
import lombok.RequiredArgsConstructor; |
14 | 18 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
19 |
+import org.springframework.dao.DataAccessException; |
|
15 | 20 |
import org.springframework.stereotype.Service; |
16 | 21 |
import org.springframework.transaction.annotation.Transactional; |
17 | 22 |
import org.springframework.web.multipart.MultipartFile; |
18 | 23 |
|
19 | 24 |
import java.io.IOException; |
25 |
+import java.net.UnknownHostException; |
|
20 | 26 |
import java.util.*; |
21 | 27 |
|
22 | 28 |
/** |
23 |
- * @author : 박정하 |
|
24 |
- * @since : 2024.05.13 |
|
29 |
+ * @author 박정하 |
|
30 |
+ * @since 2024.05.13 |
|
31 |
+ * @modification |
|
32 |
+ * since | author | description |
|
33 |
+ * 2024.05.13 | 박정하 | 최초 등록 |
|
25 | 34 |
* |
26 |
- * 팝업 관련 구현체 |
|
27 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
28 |
- * PopupService : 팝업 관련 인터페이스 상속 |
|
35 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
36 |
+ * PopupService - 팝업 관련 서비스 인터페이스 |
|
37 |
+ * |
|
38 |
+ * 팝업 관련 서비스 구현체 |
|
29 | 39 |
*/ |
30 | 40 |
@Service("popupService") |
31 | 41 |
@RequiredArgsConstructor |
32 | 42 |
public class PopupServiceImpl extends EgovAbstractServiceImpl implements PopupService { |
43 |
+ |
|
33 | 44 |
private final JWTUtil jwtUtil; |
34 | 45 |
private final PopupDAO popupDAO; |
35 | 46 |
private final IdgenService popupIdgn; |
... | ... | @@ -42,162 +53,214 @@ |
42 | 53 |
* |
43 | 54 |
* 팝업 등록 |
44 | 55 |
*/ |
56 |
+ /** |
|
57 |
+ * @param popupVO - 팝업 등록 정보를 포함하는 객체 |
|
58 |
+ * @param multipartFileList - 첨부파일 리스트 |
|
59 |
+ * @return HashMap<String, Object> - 등록 결과 및 팝업 ID |
|
60 |
+ * @throws CustomInsertFailException - 등록 실패 예외 발생 시 |
|
61 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
62 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
63 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
64 |
+ |
|
65 |
+ * 팝업 등록 |
|
66 |
+ */ |
|
45 | 67 |
@Override |
46 | 68 |
@Transactional(rollbackFor = Exception.class) |
47 |
- public HashMap<String, Object> popupInsert(PopupVO popupVO, List<MultipartFile> multipartFileList) throws Exception { |
|
48 |
- // 투자상담 아이디 생성 |
|
49 |
- String popupId = popupIdgn.getNextStringId(); |
|
50 |
- popupVO.setPopupId(popupId); |
|
69 |
+ public HashMap<String, Object> popupInsert(PopupVO popupVO, List<MultipartFile> multipartFileList){ |
|
70 |
+ try { |
|
71 |
+ // 투자상담 아이디 생성 |
|
72 |
+ String popupId = popupIdgn.getNextStringId(); |
|
73 |
+ popupVO.setPopupId(popupId); |
|
51 | 74 |
|
52 |
- // 등록자 삽입 |
|
53 |
- String writer = jwtUtil.getWriter(); |
|
54 |
- popupVO.setRgtr(writer); |
|
75 |
+ // 등록자 삽입 |
|
76 |
+ String writer = jwtUtil.getWriter(); |
|
77 |
+ popupVO.setRgtr(writer); |
|
55 | 78 |
|
56 |
- HashMap<String, Object> result = new HashMap<>(); |
|
79 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
57 | 80 |
|
58 |
- // 첨부파일 유무 |
|
59 |
- if (multipartFileList != null && !multipartFileList.isEmpty()) { |
|
60 |
- FileMngVO fileMngVO = new FileMngVO(); |
|
81 |
+ // 첨부파일 유무 |
|
82 |
+ if (multipartFileList != null && !multipartFileList.isEmpty()) { |
|
83 |
+ FileMngVO fileMngVO = new FileMngVO(); |
|
61 | 84 |
|
62 |
- // 파일매니저 등록 |
|
63 |
- HashMap<String, Object> fileMng = fileMngService.fileMngInsert(fileMngVO, multipartFileList); |
|
64 |
- result.put("multipartFileMngResult", fileMng); |
|
85 |
+ // 파일매니저 등록 |
|
86 |
+ HashMap<String, Object> fileMng = fileMngService.fileMngInsert(fileMngVO, multipartFileList); |
|
87 |
+ result.put("multipartFileMngResult", fileMng); |
|
65 | 88 |
|
66 |
- // 파일매니저 아이디 삽입 |
|
67 |
- popupVO.setFileMngId(fileMng.get("fileMngId").toString()); |
|
89 |
+ // 파일매니저 아이디 삽입 |
|
90 |
+ popupVO.setFileMngId(fileMng.get("fileMngId").toString()); |
|
91 |
+ } |
|
92 |
+ |
|
93 |
+ // 팝업 등록 |
|
94 |
+ int insertResult = popupDAO.insertPopup(popupVO); |
|
95 |
+ |
|
96 |
+ result.put("insertResult", insertResult); |
|
97 |
+ result.put("popupId", popupVO.getPopupId()); |
|
98 |
+ |
|
99 |
+ return result; |
|
100 |
+ } catch (CustomInsertFailException cife){ |
|
101 |
+ throw cife; |
|
102 |
+ } catch (DataAccessException dae) { |
|
103 |
+ throw dae; |
|
104 |
+ } catch (NullPointerException ne) { |
|
105 |
+ throw ne; |
|
106 |
+ } catch (Exception e) { |
|
107 |
+ throw new RuntimeException(e); |
|
68 | 108 |
} |
69 |
- |
|
70 |
- // 팝업 등록 |
|
71 |
- int insertResult = popupDAO.insertPopup(popupVO); |
|
72 |
- |
|
73 |
- result.put("insertResult", insertResult); |
|
74 |
- result.put("popupId", popupVO.getPopupId()); |
|
75 |
- |
|
76 |
- return result; |
|
77 | 109 |
} |
78 | 110 |
|
79 | 111 |
/** |
80 |
- * @author : 박정하 |
|
81 |
- * @since : 2024.05.13 |
|
112 |
+ * @param params - pagination HashMap |
|
113 |
+ * @return HashMap<String, Object> - 팝업 목록 |
|
114 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
115 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
82 | 116 |
* |
83 | 117 |
* 팝업 목록 조회 |
84 | 118 |
*/ |
85 | 119 |
@Override |
86 |
- public HashMap<String, Object> popupList(HashMap<String, String> params) throws Exception { |
|
87 |
- Pagination search = new Pagination(0, params); |
|
88 |
- int cnt = popupDAO.selectPopupListCnt(search); |
|
120 |
+ public HashMap<String, Object> popupList(HashMap<String, String> params){ |
|
121 |
+ try { |
|
122 |
+ Pagination search = new Pagination(0, params); |
|
123 |
+ int cnt = popupDAO.selectPopupListCnt(search); |
|
89 | 124 |
|
90 |
- Pagination pagination = new Pagination(cnt, params); |
|
91 |
- List<PopupVO> list = popupDAO.selectPopupList(pagination); |
|
125 |
+ Pagination pagination = new Pagination(cnt, params); |
|
126 |
+ List<PopupVO> list = popupDAO.selectPopupList(pagination); |
|
92 | 127 |
|
93 |
- HashMap<String, Object> result = new HashMap<>(); |
|
94 |
- result.put("list", list); |
|
95 |
- result.put("pagination", pagination); |
|
96 |
- return result; |
|
128 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
129 |
+ result.put("list", list); |
|
130 |
+ result.put("pagination", pagination); |
|
131 |
+ return result; |
|
132 |
+ } catch (DataAccessException dae) { |
|
133 |
+ throw dae; |
|
134 |
+ } catch (Exception e) { |
|
135 |
+ throw e; |
|
136 |
+ } |
|
97 | 137 |
} |
98 | 138 |
|
99 | 139 |
/** |
100 |
- * @author : 박정하 |
|
101 |
- * @since : 2024.05.13 |
|
140 |
+ * @param popupVO - 팝업 정보 |
|
141 |
+ * @return HashMap<String, Object> - 팝업 상세 조회 정보 |
|
142 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
143 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
102 | 144 |
* |
103 | 145 |
* 팝업 상세 조회 |
104 | 146 |
*/ |
105 | 147 |
@Override |
106 |
- public HashMap<String, Object> popupDetail(PopupVO popupVO) throws Exception { |
|
107 |
- PopupVO newPopupVO = new PopupVO(); |
|
108 |
- if (popupVO.getPopupId() != null) { |
|
109 |
- newPopupVO = popupDAO.selectPopupDetail(popupVO); |
|
110 |
- } |
|
148 |
+ public HashMap<String, Object> popupDetail(PopupVO popupVO){ |
|
149 |
+ try { |
|
150 |
+ PopupVO newPopupVO = new PopupVO(); |
|
151 |
+ if (popupVO.getPopupId() != null) { |
|
152 |
+ newPopupVO = popupDAO.selectPopupDetail(popupVO); |
|
153 |
+ } |
|
111 | 154 |
|
112 |
- // 팝업크기 설정 |
|
113 |
- if (newPopupVO.getWdthLen() != 0 && newPopupVO.getVrtcLen() != 0) { |
|
114 |
- if (newPopupVO.getWdthLen() == 300 && newPopupVO.getVrtcLen() == 300) { |
|
155 |
+ // 팝업크기 설정 |
|
156 |
+ if (newPopupVO.getWdthLen() != 0 && newPopupVO.getVrtcLen() != 0) { |
|
157 |
+ if (newPopupVO.getWdthLen() == 300 && newPopupVO.getVrtcLen() == 300) { |
|
158 |
+ newPopupVO.setPopupSizeType("fixed"); |
|
159 |
+ newPopupVO.setPopupSize("PS1"); |
|
160 |
+ } else if (newPopupVO.getWdthLen() == 500 && newPopupVO.getVrtcLen() == 700) { |
|
161 |
+ newPopupVO.setPopupSizeType("fixed"); |
|
162 |
+ newPopupVO.setPopupSize("PS2"); |
|
163 |
+ } else if (newPopupVO.getWdthLen() == 700 && newPopupVO.getVrtcLen() == 1000) { |
|
164 |
+ newPopupVO.setPopupSizeType("fixed"); |
|
165 |
+ newPopupVO.setPopupSize("PS3"); |
|
166 |
+ } else if (newPopupVO.getWdthLen() == 1200 && newPopupVO.getVrtcLen() == 850) { |
|
167 |
+ newPopupVO.setPopupSizeType("fixed"); |
|
168 |
+ newPopupVO.setPopupSize("PS4"); |
|
169 |
+ } else { |
|
170 |
+ newPopupVO.setPopupSizeType("custom"); |
|
171 |
+ } |
|
172 |
+ } else { |
|
115 | 173 |
newPopupVO.setPopupSizeType("fixed"); |
116 | 174 |
newPopupVO.setPopupSize("PS1"); |
117 |
- } else if (newPopupVO.getWdthLen() == 500 && newPopupVO.getVrtcLen() == 700) { |
|
118 |
- newPopupVO.setPopupSizeType("fixed"); |
|
119 |
- newPopupVO.setPopupSize("PS2"); |
|
120 |
- } else if (newPopupVO.getWdthLen() == 700 && newPopupVO.getVrtcLen() == 1000) { |
|
121 |
- newPopupVO.setPopupSizeType("fixed"); |
|
122 |
- newPopupVO.setPopupSize("PS3"); |
|
123 |
- } else if (newPopupVO.getWdthLen() == 1200 && newPopupVO.getVrtcLen() == 850) { |
|
124 |
- newPopupVO.setPopupSizeType("fixed"); |
|
125 |
- newPopupVO.setPopupSize("PS4"); |
|
126 |
- } else { |
|
127 |
- newPopupVO.setPopupSizeType("custom"); |
|
128 | 175 |
} |
129 |
- } else { |
|
130 |
- newPopupVO.setPopupSizeType("fixed"); |
|
131 |
- newPopupVO.setPopupSize("PS1"); |
|
176 |
+ |
|
177 |
+ // 업로드 형식 설정 |
|
178 |
+ if (newPopupVO.getPopupType() == null) { |
|
179 |
+ newPopupVO.setPopupType("image"); |
|
180 |
+ } |
|
181 |
+ |
|
182 |
+ // 팝업 노출 페이지 |
|
183 |
+ if (newPopupVO.getPageType() == null) { |
|
184 |
+ newPopupVO.setPageType(""); |
|
185 |
+ } |
|
186 |
+ |
|
187 |
+ // 팝업 사용 유무 |
|
188 |
+ if (newPopupVO.getPopupUseYn() == null) { |
|
189 |
+ newPopupVO.setPopupUseYn("Y"); |
|
190 |
+ } |
|
191 |
+ |
|
192 |
+ // 사용 유무 |
|
193 |
+ if (newPopupVO.getUseYn() == null) { |
|
194 |
+ newPopupVO.setUseYn("Y"); |
|
195 |
+ } |
|
196 |
+ |
|
197 |
+ List<CodeManageVO> codeList = codeManageService.findByChildCdCache("pageType"); // 검색 조건 |
|
198 |
+ |
|
199 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
200 |
+ result.put("popupVO", newPopupVO); |
|
201 |
+ result.put("codeList", codeList); |
|
202 |
+ |
|
203 |
+ return result; |
|
204 |
+ } catch (DataAccessException dae) { |
|
205 |
+ throw dae; |
|
206 |
+ } catch (Exception e) { |
|
207 |
+ throw e; |
|
132 | 208 |
} |
133 |
- |
|
134 |
- // 업로드 형식 설정 |
|
135 |
- if (newPopupVO.getPopupType() == null) { |
|
136 |
- newPopupVO.setPopupType("image"); |
|
137 |
- } |
|
138 |
- |
|
139 |
- // 팝업 노출 페이지 |
|
140 |
- if (newPopupVO.getPageType() == null) { |
|
141 |
- newPopupVO.setPageType(""); |
|
142 |
- } |
|
143 |
- |
|
144 |
- // 팝업 사용 유무 |
|
145 |
- if (newPopupVO.getPopupUseYn() == null) { |
|
146 |
- newPopupVO.setPopupUseYn("Y"); |
|
147 |
- } |
|
148 |
- |
|
149 |
- // 사용 유무 |
|
150 |
- if (newPopupVO.getUseYn() == null) { |
|
151 |
- newPopupVO.setUseYn("Y"); |
|
152 |
- } |
|
153 |
- |
|
154 |
- List<CodeManageVO> codeList = codeManageService.findByChildCdCache("pageType"); // 검색 조건 |
|
155 |
- |
|
156 |
- HashMap<String, Object> result = new HashMap<>(); |
|
157 |
- result.put("popupVO", newPopupVO); |
|
158 |
- result.put("codeList", codeList); |
|
159 |
- |
|
160 |
- return result; |
|
161 | 209 |
} |
162 | 210 |
|
163 | 211 |
/** |
164 |
- * @author : 박정하 |
|
165 |
- * @since : 2024.05.14 |
|
212 |
+ * @param popupVO - 팝업 정보 |
|
213 |
+ * @param multipartFileList - 첨부파일 리스트 |
|
214 |
+ * @return int - 수정 결과(0: 실패, 1: 성공) |
|
215 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
216 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
217 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
218 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
166 | 219 |
* |
167 | 220 |
* 팝업 수정 |
168 | 221 |
*/ |
169 | 222 |
@Override |
170 | 223 |
@Transactional(rollbackFor = Exception.class) |
171 |
- public int popupUpdate(PopupVO popupVO, List<MultipartFile> multipartFileList) throws Exception { |
|
172 |
- // 수정자 삽입 |
|
173 |
- String writer = jwtUtil.getWriter(); |
|
174 |
- popupVO.setMdfr(writer); |
|
224 |
+ public int popupUpdate(PopupVO popupVO, List<MultipartFile> multipartFileList){ |
|
225 |
+ try { |
|
226 |
+ // 수정자 삽입 |
|
227 |
+ String writer = jwtUtil.getWriter(); |
|
228 |
+ popupVO.setMdfr(writer); |
|
175 | 229 |
|
176 |
- // 파일 수정 |
|
177 |
- int fileUpdateResult = 0; |
|
178 |
- FileMngVO fileMngVO = new FileMngVO(); |
|
179 |
- if (popupVO.getFileMngId() != null) { |
|
180 |
- List<HashMap<String, Object>> deleteFileList = new ArrayList<>(); |
|
181 |
- if (popupVO.getDeleteFileList() != null && popupVO.getDeleteFileList().size() > 0) { |
|
182 |
- deleteFileList = popupVO.getDeleteFileList(); |
|
230 |
+ // 파일 수정 |
|
231 |
+ int fileUpdateResult = 0; |
|
232 |
+ FileMngVO fileMngVO = new FileMngVO(); |
|
233 |
+ if (popupVO.getFileMngId() != null) { |
|
234 |
+ List<HashMap<String, Object>> deleteFileList = new ArrayList<>(); |
|
235 |
+ if (popupVO.getDeleteFileList() != null && popupVO.getDeleteFileList().size() > 0) { |
|
236 |
+ deleteFileList = popupVO.getDeleteFileList(); |
|
237 |
+ } |
|
238 |
+ |
|
239 |
+ // 파일매니저 수정 |
|
240 |
+ fileMngVO.setFileMngId(popupVO.getFileMngId()); |
|
241 |
+ fileUpdateResult += fileMngService.fileMngUpadate(fileMngVO, deleteFileList, multipartFileList); |
|
242 |
+ } else { |
|
243 |
+ // 파일매니저 등록 |
|
244 |
+ if (multipartFileList != null && multipartFileList.size() > 0) { |
|
245 |
+ HashMap<String, Object> fileMng = fileMngService.fileMngInsert(fileMngVO, multipartFileList); |
|
246 |
+ fileUpdateResult += (int) fileMng.get("fileMngResult"); |
|
247 |
+ popupVO.setFileMngId(fileMng.get("fileMngId").toString()); |
|
248 |
+ } |
|
183 | 249 |
} |
184 | 250 |
|
185 |
- // 파일매니저 수정 |
|
186 |
- fileMngVO.setFileMngId(popupVO.getFileMngId()); |
|
187 |
- fileUpdateResult += fileMngService.fileMngUpadate(fileMngVO, deleteFileList, multipartFileList); |
|
188 |
- } else { |
|
189 |
- // 파일매니저 등록 |
|
190 |
- if(multipartFileList != null && multipartFileList.size() > 0) { |
|
191 |
- HashMap<String, Object> fileMng = fileMngService.fileMngInsert(fileMngVO, multipartFileList); |
|
192 |
- fileUpdateResult += (int) fileMng.get("fileMngResult"); |
|
193 |
- popupVO.setFileMngId(fileMng.get("fileMngId").toString()); |
|
194 |
- } |
|
251 |
+ // 팝업 수정 |
|
252 |
+ int updateResult = popupDAO.updatePopup(popupVO); |
|
253 |
+ |
|
254 |
+ return updateResult + fileUpdateResult; |
|
255 |
+ } catch (CustomUpdateFailException cufe){ |
|
256 |
+ throw cufe; |
|
257 |
+ } catch (DataAccessException dae) { |
|
258 |
+ throw dae; |
|
259 |
+ } catch (NullPointerException ne) { |
|
260 |
+ throw ne; |
|
261 |
+ } catch (Exception e) { |
|
262 |
+ throw new RuntimeException(e); |
|
195 | 263 |
} |
196 |
- |
|
197 |
- // 팝업 수정 |
|
198 |
- int updateResult = popupDAO.updatePopup(popupVO); |
|
199 |
- |
|
200 |
- return updateResult + fileUpdateResult; |
|
201 | 264 |
} |
202 | 265 |
|
203 | 266 |
/** |
... | ... | @@ -206,37 +269,62 @@ |
206 | 269 |
* |
207 | 270 |
* 팝업 삭제 |
208 | 271 |
*/ |
272 |
+ /** |
|
273 |
+ * @param popupVO - 팝업 정보 |
|
274 |
+ * @return int - 삭제 결과(0: 실패, 1: 성공) |
|
275 |
+ * @throws CustomDeleteFailException - 삭제 실패 예외 발생 시 |
|
276 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
277 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
278 |
+ * |
|
279 |
+ * 팝업 삭제 |
|
280 |
+ */ |
|
209 | 281 |
@Override |
210 | 282 |
@Transactional(rollbackFor = Exception.class) |
211 |
- public int popupDelete(PopupVO popupVO) throws Exception { |
|
212 |
- // 수정자 삽입 |
|
213 |
- String writer = jwtUtil.getWriter(); |
|
214 |
- popupVO.setMdfr(writer); |
|
283 |
+ public int popupDelete(PopupVO popupVO){ |
|
284 |
+ try { |
|
285 |
+ // 수정자 삽입 |
|
286 |
+ String writer = jwtUtil.getWriter(); |
|
287 |
+ popupVO.setMdfr(writer); |
|
215 | 288 |
|
216 |
- // 파일매니저 삭제 |
|
217 |
- int fileDeleteResult = 0; |
|
218 |
- if (popupVO.getFileMngId() != null && popupVO.getFileMngId().equals("")) { |
|
219 |
- HashMap<String, Object> hashMap = new HashMap<>(); |
|
220 |
- hashMap.put("fileMngId", popupVO.getFileMngId()); |
|
221 |
- fileDeleteResult = fileMngService.fileMngDelete(hashMap); |
|
289 |
+ // 파일매니저 삭제 |
|
290 |
+ int fileDeleteResult = 0; |
|
291 |
+ if (popupVO.getFileMngId() != null && popupVO.getFileMngId().equals("")) { |
|
292 |
+ HashMap<String, Object> hashMap = new HashMap<>(); |
|
293 |
+ hashMap.put("fileMngId", popupVO.getFileMngId()); |
|
294 |
+ fileDeleteResult = fileMngService.fileMngDelete(hashMap); |
|
295 |
+ } |
|
296 |
+ |
|
297 |
+ // 팝업 삭제 |
|
298 |
+ popupVO.setUseYn("N"); |
|
299 |
+ popupVO.setFileMngId(null); |
|
300 |
+ int deleteResult = popupDAO.updatePopup(popupVO); |
|
301 |
+ |
|
302 |
+ return deleteResult + fileDeleteResult; |
|
303 |
+ } catch (CustomDeleteFailException cdfe){ |
|
304 |
+ throw cdfe; |
|
305 |
+ } catch (DataAccessException dae) { |
|
306 |
+ throw dae; |
|
307 |
+ } catch (Exception e) { |
|
308 |
+ throw new RuntimeException(e); |
|
222 | 309 |
} |
223 |
- |
|
224 |
- // 팝업 삭제 |
|
225 |
- popupVO.setUseYn("N"); |
|
226 |
- popupVO.setFileMngId(null); |
|
227 |
- int deleteResult = popupDAO.updatePopup(popupVO); |
|
228 |
- |
|
229 |
- return deleteResult + fileDeleteResult; |
|
230 | 310 |
} |
231 | 311 |
|
232 | 312 |
/** |
233 |
- * @author : 박정하 |
|
234 |
- * @since : 2024.05.22 |
|
313 |
+ * @param pageType - 페이지 타입 |
|
314 |
+ * @return List<PopupVO> - 팝업 목록 |
|
315 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
316 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
235 | 317 |
* |
236 | 318 |
* 팝업 목록 조회 (팝업창 띄우는 용도) |
237 | 319 |
*/ |
238 | 320 |
@Override |
239 |
- public List<PopupVO> popupListByPage(String pageType) throws Exception { |
|
240 |
- return popupDAO.selectPopupListByPage(pageType); |
|
321 |
+ public List<PopupVO> popupListByPage(String pageType){ |
|
322 |
+ try { |
|
323 |
+ return popupDAO.selectPopupListByPage(pageType); |
|
324 |
+ } catch (DataAccessException dae) { |
|
325 |
+ throw dae; |
|
326 |
+ } catch (Exception e) { |
|
327 |
+ throw e; |
|
328 |
+ } |
|
241 | 329 |
} |
242 | 330 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/popup/service/PopupService.java
+++ src/main/java/com/takensoft/cms/popup/service/PopupService.java
... | ... | @@ -6,57 +6,62 @@ |
6 | 6 |
import java.util.*; |
7 | 7 |
|
8 | 8 |
/** |
9 |
- * @author : 박정하 |
|
10 |
- * @since : 2024.05.13 |
|
9 |
+ * @author 박정하 |
|
10 |
+ * @since 2024.05.13 |
|
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.05.13 | 박정하 | 최초 등록 |
|
11 | 14 |
* |
12 | 15 |
* 팝업 관련 인터페이스 |
13 | 16 |
*/ |
14 | 17 |
public interface PopupService { |
15 | 18 |
/** |
16 |
- * @author : 박정하 |
|
17 |
- * @since : 2024.05.13 |
|
19 |
+ * @param popupVO - 팝업 정보 |
|
20 |
+ * @param multipartFileList - 첨부파일 리스트 |
|
21 |
+ * @return HashMap<String, Object> - 등록 결과 및 팝업ID |
|
18 | 22 |
* |
19 | 23 |
* 팝업 등록 |
20 | 24 |
*/ |
21 |
- public HashMap<String, Object> popupInsert(PopupVO popupVO, List<MultipartFile> multipartFileList) throws Exception; |
|
25 |
+ HashMap<String, Object> popupInsert(PopupVO popupVO, List<MultipartFile> multipartFileList); |
|
22 | 26 |
|
23 | 27 |
/** |
24 |
- * @author : 박정하 |
|
25 |
- * @since : 2024.05.13 |
|
28 |
+ * @param params - 페이지네이션 HashMap |
|
29 |
+ * @return HashMap<String, Object> - 검색된 팝업 목록 |
|
26 | 30 |
* |
27 | 31 |
* 팝업 목록 조회 |
28 | 32 |
*/ |
29 |
- public HashMap<String, Object> popupList(HashMap<String, String> params) throws Exception; |
|
33 |
+ HashMap<String, Object> popupList(HashMap<String, String> params); |
|
30 | 34 |
|
31 | 35 |
/** |
32 |
- * @author : 박정하 |
|
33 |
- * @since : 2024.05.13 |
|
36 |
+ * @param popupVO - 팝업 정보 |
|
37 |
+ * @return HashMap<String, Object> - 팝업 상세 조회 결과 |
|
34 | 38 |
* |
35 | 39 |
* 팝업 상세 조회 |
36 | 40 |
*/ |
37 |
- public HashMap<String, Object> popupDetail(PopupVO popupVO) throws Exception; |
|
41 |
+ HashMap<String, Object> popupDetail(PopupVO popupVO); |
|
38 | 42 |
|
39 | 43 |
/** |
40 |
- * @author : 박정하 |
|
41 |
- * @since : 2024.05.14 |
|
44 |
+ * @param popupVO - 팝업 정보 |
|
45 |
+ * @param multipartFileList - 첨부파일 리스트 |
|
46 |
+ * @return int - 수정 여부 (성공: 1, 실패: 0) |
|
42 | 47 |
* |
43 | 48 |
* 팝업 수정 |
44 | 49 |
*/ |
45 |
- public int popupUpdate(PopupVO popupVO, List<MultipartFile> multipartFileList) throws Exception; |
|
50 |
+ int popupUpdate(PopupVO popupVO, List<MultipartFile> multipartFileList); |
|
46 | 51 |
|
47 | 52 |
/** |
48 |
- * @author : 박정하 |
|
49 |
- * @since : 2024.05.14 |
|
53 |
+ * @param popupVO - 팝업 정보 |
|
54 |
+ * @return int - 삭제 여부 (성공: 1, 실패: 0) |
|
50 | 55 |
* |
51 | 56 |
* 팝업 삭제 |
52 | 57 |
*/ |
53 |
- public int popupDelete(PopupVO popupVO) throws Exception; |
|
58 |
+ int popupDelete(PopupVO popupVO); |
|
54 | 59 |
|
55 | 60 |
/** |
56 |
- * @author : 박정하 |
|
57 |
- * @since : 2024.05.13 |
|
61 |
+ * @param pageType - 페이지 타입 |
|
62 |
+ * @return List<PopupVO> - 조회된 팝업 목록 |
|
58 | 63 |
* |
59 | 64 |
* 팝업 목록 조회 (팝업창 띄우는 용도) |
60 | 65 |
*/ |
61 |
- public List<PopupVO> popupListByPage(String pageType) throws Exception; |
|
66 |
+ List<PopupVO> popupListByPage(String pageType); |
|
62 | 67 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/popup/vo/PopupVO.java
+++ src/main/java/com/takensoft/cms/popup/vo/PopupVO.java
... | ... | @@ -1,6 +1,6 @@ |
1 | 1 |
package com.takensoft.cms.popup.vo; |
2 | 2 |
|
3 |
-import lombok.Data; |
|
3 |
+import lombok.*; |
|
4 | 4 |
|
5 | 5 |
import java.util.HashMap; |
6 | 6 |
import java.util.List; |
... | ... | @@ -8,54 +8,38 @@ |
8 | 8 |
/** |
9 | 9 |
* @author : 박정하 |
10 | 10 |
* @since : 2024.05.13 |
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.05.13 | 박정하 | 최초 등록 |
|
11 | 14 |
* |
12 | 15 |
* 팝업 관련 VO |
13 | 16 |
*/ |
14 |
-@Data |
|
17 |
+@Getter |
|
18 |
+@Setter |
|
19 |
+@NoArgsConstructor |
|
20 |
+@AllArgsConstructor |
|
15 | 21 |
public class PopupVO { |
16 |
- // 팝업아이디 |
|
17 |
- private String popupId; |
|
18 |
- // 팝업제목 |
|
19 |
- private String popupTtl; |
|
20 |
- // 시작일 |
|
21 |
- private String bgngDt; |
|
22 |
- // 종료일 |
|
23 |
- private String endDt; |
|
24 |
- // 가로길이 |
|
25 |
- private int wdthLen; |
|
26 |
- // 세로길이 |
|
27 |
- private int vrtcLen; |
|
28 |
- // 팝업유형 |
|
29 |
- private String popupType; |
|
30 |
- // 팝업사용여부 |
|
31 |
- private String popupUseYn; |
|
32 |
- // 동영상URL |
|
33 |
- private String vdoUrl; |
|
34 |
- // 링크 URL |
|
35 |
- private String linkUrl; |
|
36 |
- // 파일 관리 아이디 |
|
37 |
- private String fileMngId; |
|
38 |
- // 순서 |
|
39 |
- private int sn; |
|
40 |
- // 페이지 타입(팝업노출페이지) |
|
41 |
- private String pageType; |
|
42 |
- // 사용여부 |
|
43 |
- private String useYn; |
|
44 |
- // 등록자 |
|
45 |
- private String rgtr; |
|
46 |
- // 등록일 |
|
47 |
- private String regDt; |
|
48 |
- // 수정자 |
|
49 |
- private String mdfr; |
|
50 |
- // 수정일 |
|
51 |
- private String mdfcnDt; |
|
22 |
+ private String popupId; // 팝업아이디 |
|
23 |
+ private String popupTtl; // 팝업제목 |
|
24 |
+ private String bgngDt; // 시작일 |
|
25 |
+ private String endDt; // 종료일 |
|
26 |
+ private int wdthLen; // 가로길이 |
|
27 |
+ private int vrtcLen; // 세로길이 |
|
28 |
+ private String popupType; // 팝업유형 |
|
29 |
+ private String popupUseYn; // 팝업사용여부 |
|
30 |
+ private String vdoUrl; // 동영상URL |
|
31 |
+ private String linkUrl; // 링크 URL |
|
32 |
+ private String fileMngId; // 파일 관리 아이디 |
|
33 |
+ private int sn; // 순서 |
|
34 |
+ private String pageType; // 페이지 타입(팝업노출페이지) |
|
35 |
+ private String useYn; // 사용여부 |
|
36 |
+ private String rgtr; // 등록자 |
|
37 |
+ private String regDt; // 등록일 |
|
38 |
+ private String mdfr; // 수정자 |
|
39 |
+ private String mdfcnDt; // 수정일 |
|
52 | 40 |
|
53 |
- // 팝업사이즈타입 |
|
54 |
- private String popupSizeType; |
|
55 |
- // 팝업사이즈 |
|
56 |
- private String popupSize; |
|
57 |
- // 등록자명 |
|
58 |
- private String mbrNm; |
|
59 |
- // 삭제 파일 목록 |
|
60 |
- private List<HashMap<String, Object>> deleteFileList; |
|
41 |
+ private String popupSizeType; // 팝업사이즈타입 |
|
42 |
+ private String popupSize; // 팝업사이즈 |
|
43 |
+ private String mbrNm; // 등록자명 |
|
44 |
+ private List<HashMap<String, Object>> deleteFileList; // 삭제 파일 목록 |
|
61 | 45 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/popup/web/PopupController.java
+++ src/main/java/com/takensoft/cms/popup/web/PopupController.java
... | ... | @@ -2,11 +2,13 @@ |
2 | 2 |
|
3 | 3 |
import com.takensoft.cms.popup.service.PopupService; |
4 | 4 |
import com.takensoft.cms.popup.vo.PopupVO; |
5 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
5 | 6 |
import com.takensoft.common.file.service.FileService; |
6 | 7 |
import com.takensoft.common.message.MessageCode; |
7 | 8 |
import com.takensoft.common.util.ResponseData; |
8 | 9 |
import com.takensoft.common.util.ResponseUtil; |
9 | 10 |
import lombok.RequiredArgsConstructor; |
11 |
+import org.springframework.dao.DataAccessException; |
|
10 | 12 |
import org.springframework.http.HttpHeaders; |
11 | 13 |
import org.springframework.http.HttpStatus; |
12 | 14 |
import org.springframework.http.MediaType; |
... | ... | @@ -14,8 +16,10 @@ |
14 | 16 |
import org.springframework.web.bind.annotation.*; |
15 | 17 |
import org.springframework.web.multipart.MultipartFile; |
16 | 18 |
|
19 |
+import java.net.UnknownHostException; |
|
17 | 20 |
import java.nio.charset.Charset; |
18 | 21 |
import java.util.*; |
22 |
+ |
|
19 | 23 |
/** |
20 | 24 |
* @author 박정하 |
21 | 25 |
* @since 2024.05.13 |
... | ... | @@ -34,16 +38,14 @@ |
34 | 38 |
private final ResponseUtil resUtil; |
35 | 39 |
|
36 | 40 |
/** |
37 |
- * @author 박정하 |
|
38 |
- * @since 2024.05.13 |
|
39 |
- * @param popupVO |
|
40 |
- * @return |
|
41 |
- * @throws Exception |
|
41 |
+ * @param popupVO - 팝업 정보 |
|
42 |
+ * @param multipartFileList - 업로드할 파일 목록 |
|
43 |
+ * @return ResponseEntity - 팝업 등록 결과를 포함하는 응답 |
|
42 | 44 |
* |
43 | 45 |
* 팝업 등록 |
44 | 46 |
*/ |
45 | 47 |
@PostMapping("/insertProc.file") |
46 |
- public ResponseEntity<?> insertProc(@RequestPart PopupVO popupVO, List<MultipartFile> multipartFileList) throws Exception { |
|
48 |
+ public ResponseEntity<?> insertProc(@RequestPart PopupVO popupVO, List<MultipartFile> multipartFileList){ |
|
47 | 49 |
HashMap<String, Object> result = popupService.popupInsert(popupVO, multipartFileList); |
48 | 50 |
int insertResult = (int) result.get("insertResult"); |
49 | 51 |
|
... | ... | @@ -56,16 +58,13 @@ |
56 | 58 |
} |
57 | 59 |
|
58 | 60 |
/** |
59 |
- * @author 박정하 |
|
60 |
- * @since 2024.05.13 |
|
61 |
- * @param params |
|
62 |
- * @return |
|
63 |
- * @throws Exception |
|
61 |
+ * @param params - pagination HashMap |
|
62 |
+ * @return ResponseEntity - 팝업 목록을 포함하는 응답 |
|
64 | 63 |
* |
65 | 64 |
* 팝업 목록 조회 |
66 | 65 |
*/ |
67 | 66 |
@PostMapping("/listProc.json") |
68 |
- public ResponseEntity<?> listProc(@RequestBody HashMap<String, String> params) throws Exception { |
|
67 |
+ public ResponseEntity<?> listProc(@RequestBody HashMap<String, String> params){ |
|
69 | 68 |
HashMap<String, Object> result = popupService.popupList(params); |
70 | 69 |
|
71 | 70 |
// 응답 처리 |
... | ... | @@ -73,22 +72,25 @@ |
73 | 72 |
} |
74 | 73 |
|
75 | 74 |
/** |
76 |
- * @author 박정하 |
|
77 |
- * @since 2024.05.13 |
|
78 |
- * @param popupVO |
|
79 |
- * @return |
|
80 |
- * @throws Exception |
|
75 |
+ * @param popupVO - 팝업 정보 |
|
76 |
+ * @return ResponseEntity - 팝업 상세 정보를 포함하는 응답 |
|
81 | 77 |
* |
82 | 78 |
* 팝업 상세 조회 |
83 | 79 |
*/ |
84 | 80 |
@PostMapping("/detailProc.json") |
85 |
- public ResponseEntity<?> detailProc(@RequestBody PopupVO popupVO) throws Exception { |
|
81 |
+ public ResponseEntity<?> detailProc(@RequestBody PopupVO popupVO) { |
|
86 | 82 |
HashMap<String, Object> result = popupService.popupDetail(popupVO); |
87 | 83 |
PopupVO popup = (PopupVO) result.get("popupVO"); |
88 | 84 |
|
89 | 85 |
List<HashMap<String, Object>> fileList = new ArrayList<>(); |
90 | 86 |
if (popup.getFileMngId() != null) { |
91 |
- fileList = fileService.fileSelectList(popup.getFileMngId()); |
|
87 |
+ try { |
|
88 |
+ fileList = fileService.fileSelectList(popup.getFileMngId()); |
|
89 |
+ } catch (DataAccessException dae) { |
|
90 |
+ throw dae; |
|
91 |
+ } catch (Exception e) { |
|
92 |
+ throw e; |
|
93 |
+ } |
|
92 | 94 |
} |
93 | 95 |
result.put("fileList", fileList); |
94 | 96 |
|
... | ... | @@ -97,16 +99,14 @@ |
97 | 99 |
} |
98 | 100 |
|
99 | 101 |
/** |
100 |
- * @author 박정하 |
|
101 |
- * @since 2024.05.14 |
|
102 |
- * @param popupVO |
|
103 |
- * @return |
|
104 |
- * @throws Exception |
|
102 |
+ * @param popupVO - 팝업 정보 |
|
103 |
+ * @param multipartFileList - 업로드할 파일 목록 |
|
104 |
+ * @return ResponseEntity - 팝업 수정 결과를 포함하는 응답 |
|
105 | 105 |
* |
106 | 106 |
* 팝업 수정 |
107 | 107 |
*/ |
108 | 108 |
@PostMapping("/updateProc.file") |
109 |
- public ResponseEntity<?> updateProc(@RequestPart PopupVO popupVO, @RequestParam(required = false) List<MultipartFile> multipartFileList) throws Exception { |
|
109 |
+ public ResponseEntity<?> updateProc(@RequestPart PopupVO popupVO, @RequestParam(required = false) List<MultipartFile> multipartFileList) { |
|
110 | 110 |
int result = popupService.popupUpdate(popupVO, multipartFileList); |
111 | 111 |
|
112 | 112 |
// 응답 처리 |
... | ... | @@ -118,16 +118,13 @@ |
118 | 118 |
} |
119 | 119 |
|
120 | 120 |
/** |
121 |
- * @author 박정하 |
|
122 |
- * @since 2024.05.14 |
|
123 |
- * @param popupVO |
|
124 |
- * @return |
|
125 |
- * @throws Exception |
|
121 |
+ * @param popupVO - 팝업 정보 |
|
122 |
+ * @return ResponseEntity - 팝업 삭제 결과를 포함하는 응답 |
|
126 | 123 |
* |
127 |
- * 팝업 삭제 |
|
124 |
+ * 팝업 수정 |
|
128 | 125 |
*/ |
129 | 126 |
@PostMapping("/deleteProc.json") |
130 |
- public ResponseEntity<?> deleteProc(@RequestBody PopupVO popupVO) throws Exception { |
|
127 |
+ public ResponseEntity<?> deleteProc(@RequestBody PopupVO popupVO) { |
|
131 | 128 |
int result = popupService.popupDelete(popupVO); |
132 | 129 |
|
133 | 130 |
// 응답 처리 |
... | ... | @@ -139,16 +136,13 @@ |
139 | 136 |
} |
140 | 137 |
|
141 | 138 |
/** |
142 |
- * @author 박정하 |
|
143 |
- * @since 2024.05.22 |
|
144 |
- * @param popupVO |
|
145 |
- * @return |
|
146 |
- * @throws Exception |
|
139 |
+ * @param popupVO - 팝업 정보 |
|
140 |
+ * @return ResponseEntity - 팝업창 띄울 정보를 포함하는 응답 |
|
147 | 141 |
* |
148 | 142 |
* 팝업 목록 조회 (팝업창 띄우는 용도) |
149 | 143 |
*/ |
150 | 144 |
@PostMapping("/listByPageProc.json") |
151 |
- public ResponseEntity<?> listByPageProc(@RequestBody PopupVO popupVO) throws Exception { |
|
145 |
+ public ResponseEntity<?> listByPageProc(@RequestBody PopupVO popupVO) { |
|
152 | 146 |
List<PopupVO> result = popupService.popupListByPage(popupVO.getPageType()); |
153 | 147 |
|
154 | 148 |
// 응답 처리 |
--- src/main/java/com/takensoft/cms/popup/web/SysPopupController.java
+++ src/main/java/com/takensoft/cms/popup/web/SysPopupController.java
... | ... | @@ -20,9 +20,10 @@ |
20 | 20 |
import java.util.ArrayList; |
21 | 21 |
import java.util.HashMap; |
22 | 22 |
import java.util.List; |
23 |
+ |
|
23 | 24 |
/** |
24 |
- * @author 박정하 |
|
25 |
- * @since 2024.05.27 |
|
25 |
+ * @author : 박정하 |
|
26 |
+ * @since : 2024.05.27 |
|
26 | 27 |
* @modification |
27 | 28 |
* since | author | description |
28 | 29 |
* 2024.05.27 | 박정하 | 최초 등록 |
... | ... | @@ -38,16 +39,13 @@ |
38 | 39 |
private final ResponseUtil resUtil; |
39 | 40 |
|
40 | 41 |
/** |
41 |
- * @author 박정하 |
|
42 |
- * @since 2024.05.22 |
|
43 |
- * @param popupVO |
|
44 |
- * @return |
|
45 |
- * @throws Exception |
|
42 |
+ * @param popupVO - 팝업 정보 |
|
43 |
+ * @return ResponseEntity - 팝업 목록 조회 응답 결과 |
|
46 | 44 |
* |
47 | 45 |
* 팝업 목록 조회 (팝업창 띄우는 용도) |
48 | 46 |
*/ |
49 | 47 |
@PostMapping("/listByPageProc.json") |
50 |
- public ResponseEntity<?> listByPageProc(@RequestBody PopupVO popupVO) throws Exception { |
|
48 |
+ public ResponseEntity<?> listByPageProc(@RequestBody PopupVO popupVO){ |
|
51 | 49 |
List<PopupVO> result = popupService.popupListByPage(popupVO.getPageType()); |
52 | 50 |
|
53 | 51 |
// 응답 처리 |
... | ... | @@ -55,16 +53,13 @@ |
55 | 53 |
} |
56 | 54 |
|
57 | 55 |
/** |
58 |
- * @author 박정하 |
|
59 |
- * @since 2024.05.13 |
|
60 |
- * @param popupVO |
|
61 |
- * @return |
|
62 |
- * @throws Exception |
|
56 |
+ * @param popupVO - 팝업 정보 |
|
57 |
+ * @return ResponseEntity - 팝업 상세 조회 응답 결과 |
|
63 | 58 |
* |
64 | 59 |
* 팝업 상세 조회 |
65 | 60 |
*/ |
66 | 61 |
@PostMapping("/detailProc.json") |
67 |
- public ResponseEntity<?> detailProc(@RequestBody PopupVO popupVO) throws Exception { |
|
62 |
+ public ResponseEntity<?> detailProc(@RequestBody PopupVO popupVO){ |
|
68 | 63 |
HashMap<String, Object> result = popupService.popupDetail(popupVO); |
69 | 64 |
PopupVO popup = (PopupVO) result.get("popupVO"); |
70 | 65 |
|
--- src/main/java/com/takensoft/cms/prvcInqHstry/service/Impl/PrvcInqHstryServiceImpl.java
+++ src/main/java/com/takensoft/cms/prvcInqHstry/service/Impl/PrvcInqHstryServiceImpl.java
... | ... | @@ -50,6 +50,7 @@ |
50 | 50 |
* @throws CustomInsertFailException - 등록 실패 예외 발생 시 |
51 | 51 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
52 | 52 |
* @throws NullPointerException - Null 값이 발생할 경우 |
53 |
+ * @throws UnknownHostException - 호스트의 IP정보를 알 수 없는 경우 |
|
53 | 54 |
* @throws Exception - 그 외 예외 발생 시 |
54 | 55 |
* |
55 | 56 |
* 개인정보 조회 이력 등록 |
... | ... | @@ -69,6 +70,8 @@ |
69 | 70 |
throw cife; |
70 | 71 |
} catch (DataAccessException dae) { |
71 | 72 |
throw dae; |
73 |
+ } catch (NullPointerException ne) { |
|
74 |
+ throw ne; |
|
72 | 75 |
} catch (UnknownHostException ukhe) { |
73 | 76 |
throw new RuntimeException("호스트의 IP정보를 알 수가 없습니다.", ukhe); |
74 | 77 |
} catch (Exception e) { |
--- src/main/java/com/takensoft/cms/search/service/Impl/SearchServiceImpl.java
+++ src/main/java/com/takensoft/cms/search/service/Impl/SearchServiceImpl.java
... | ... | @@ -41,9 +41,7 @@ |
41 | 41 |
/** |
42 | 42 |
* @param searchVO - 검색 조건을 포함하는 객체 |
43 | 43 |
* @return SearchResultVO - 검색 결과를 포함하는 객체 |
44 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
45 | 44 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
46 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
47 | 45 |
* @throws Exception - 그 외 예외 발생 시 |
48 | 46 |
* |
49 | 47 |
* 통합 검색 |
... | ... | @@ -75,9 +73,7 @@ |
75 | 73 |
* @param sysMenu - 메뉴 정보 |
76 | 74 |
* @param searchVO - 검색 정보 |
77 | 75 |
* @param searchResultVO - 통합 검색 결과 정보 |
78 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
79 | 76 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
80 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
81 | 77 |
* @throws Exception - 그 외 예외 발생 시 |
82 | 78 |
* |
83 | 79 |
* 통합 검색 |
... | ... | @@ -202,9 +198,7 @@ |
202 | 198 |
* @param contentList - 검색 결과를 포함하는 객체 |
203 | 199 |
* @param searchMenu - 검색 메뉴 정보를 포함하는 객체 |
204 | 200 |
* @param searchResultVO - 검색 결과 정보를 포함하는 객체 |
205 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
206 | 201 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
207 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
208 | 202 |
* @throws Exception - 그 외 예외 발생 시 |
209 | 203 |
* |
210 | 204 |
* 기업 정보 검색 |
... | ... | @@ -251,9 +245,7 @@ |
251 | 245 |
* @param contentList - 검색 결과를 포함하는 객체 |
252 | 246 |
* @param searchMenu - 검색 메뉴 정보를 포함하는 객체 |
253 | 247 |
* @param searchResultVO - 검색 결과 정보를 포함하는 객체 |
254 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
255 | 248 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
256 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
257 | 249 |
* @throws Exception - 그 외 예외 발생 시 |
258 | 250 |
* |
259 | 251 |
* 기업 상담 신청 검색 |
... | ... | @@ -291,9 +283,7 @@ |
291 | 283 |
* @param contentList - 검색 결과를 포함하는 객체 |
292 | 284 |
* @param searchMenu - 검색 메뉴 정보를 포함하는 객체 |
293 | 285 |
* @param searchResultVO - 검색 결과 정보를 포함하는 객체 |
294 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
295 | 286 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
296 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
297 | 287 |
* @throws Exception - 그 외 예외 발생 시 |
298 | 288 |
* |
299 | 289 |
* 투자 상담 검색 |
... | ... | @@ -331,9 +321,7 @@ |
331 | 321 |
* @param contentList - 검색 결과를 포함하는 객체 |
332 | 322 |
* @param searchMenu - 검색 메뉴 정보를 포함하는 객체 |
333 | 323 |
* @param searchResultVO - 검색 결과 정보를 포함하는 객체 |
334 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
335 | 324 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
336 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
337 | 325 |
* @throws Exception - 그 외 예외 발생 시 |
338 | 326 |
* |
339 | 327 |
* 검토 사항 검색 |
... | ... | @@ -371,9 +359,7 @@ |
371 | 359 |
* @param totalListCount - 전체 검색 목록 개수 |
372 | 360 |
* @param searchMenu - 검색 메뉴 정보를 포함하는 객체 |
373 | 361 |
* @param searchResultVO - 검색 결과 정보를 포함하는 객체 |
374 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
375 | 362 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
376 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
377 | 363 |
* @throws Exception - 그 외 예외 발생 시 |
378 | 364 |
* |
379 | 365 |
* 전체 검색 목록 조회 개수 |
... | ... | @@ -396,9 +382,7 @@ |
396 | 382 |
* @param content - 내용 |
397 | 383 |
* @param regDt - 등록일 |
398 | 384 |
* @param pageId - 페이지 ID |
399 |
- * @throws CustomNotFoundException - 검색 결과가 없을 경우 |
|
400 | 385 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
401 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
402 | 386 |
* @throws Exception - 그 외 예외 발생 시 |
403 | 387 |
* |
404 | 388 |
* 전체 검색 목록 조회 개수 |
--- src/main/java/com/takensoft/common/file/dao/FileDAO.java
+++ src/main/java/com/takensoft/common/file/dao/FileDAO.java
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
* |
28 | 28 |
* 파일 목록 조회 |
29 | 29 |
*/ |
30 |
- public List<HashMap<String, Object>> fileSelectList(String fileMngId) throws Exception; |
|
30 |
+ List<HashMap<String, Object>> fileSelectList(String fileMngId); |
|
31 | 31 |
|
32 | 32 |
/** |
33 | 33 |
* @author 박정하 |
--- src/main/java/com/takensoft/common/file/service/FileService.java
+++ src/main/java/com/takensoft/common/file/service/FileService.java
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
* |
28 | 28 |
* 파일 목록 조회 |
29 | 29 |
*/ |
30 |
- public List<HashMap<String, Object>> fileSelectList(String fileMngId) throws Exception; |
|
30 |
+ List<HashMap<String, Object>> fileSelectList(String fileMngId); |
|
31 | 31 |
|
32 | 32 |
/** |
33 | 33 |
* @author 박정하 |
--- src/main/java/com/takensoft/common/file/service/Impl/FileServiceImpl.java
+++ src/main/java/com/takensoft/common/file/service/Impl/FileServiceImpl.java
... | ... | @@ -7,6 +7,7 @@ |
7 | 7 |
import lombok.RequiredArgsConstructor; |
8 | 8 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
9 | 9 |
import org.springframework.beans.factory.annotation.Value; |
10 |
+import org.springframework.dao.DataAccessException; |
|
10 | 11 |
import org.springframework.stereotype.Service; |
11 | 12 |
import org.springframework.transaction.annotation.Transactional; |
12 | 13 |
import org.springframework.util.StringUtils; |
... | ... | @@ -132,8 +133,14 @@ |
132 | 133 |
* 파일 목록 조회 |
133 | 134 |
*/ |
134 | 135 |
@Override |
135 |
- public List<HashMap<String, Object>> fileSelectList(String fileMngId) throws Exception { |
|
136 |
- return fileDAO.fileSelectList(fileMngId); |
|
136 |
+ public List<HashMap<String, Object>> fileSelectList(String fileMngId){ |
|
137 |
+ try { |
|
138 |
+ return fileDAO.fileSelectList(fileMngId); |
|
139 |
+ } catch (DataAccessException dae) { |
|
140 |
+ throw dae; |
|
141 |
+ } catch (Exception e) { |
|
142 |
+ throw e; |
|
143 |
+ } |
|
137 | 144 |
} |
138 | 145 |
|
139 | 146 |
/** |
Add a comment
Delete comment
Once you delete this comment, you won't be able to recover it. Are you sure you want to delete this comment?