
--- src/main/java/com/takensoft/cms/accesCtrl/service/Impl/AccesCtrlServiceImpl.java
+++ src/main/java/com/takensoft/cms/accesCtrl/service/Impl/AccesCtrlServiceImpl.java
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 |
import org.springframework.cache.annotation.Cacheable; |
17 | 17 |
import org.springframework.dao.DataAccessException; |
18 | 18 |
import org.springframework.stereotype.Service; |
19 |
+import org.springframework.transaction.annotation.Transactional; |
|
19 | 20 |
|
20 | 21 |
import java.util.HashMap; |
21 | 22 |
import java.util.List; |
--- src/main/java/com/takensoft/cms/bbs/service/Impl/BbsCnServiceImpl.java
+++ src/main/java/com/takensoft/cms/bbs/service/Impl/BbsCnServiceImpl.java
... | ... | @@ -6,7 +6,6 @@ |
6 | 6 |
import com.takensoft.cms.bbs.service.BbsCnService; |
7 | 7 |
import com.takensoft.cms.bbs.vo.BbsCnVO; |
8 | 8 |
import com.takensoft.cms.bbs.vo.BbsMngVO; |
9 |
-import com.takensoft.cms.bbs.vo.WordMngVO; |
|
10 | 9 |
import com.takensoft.common.Pagination; |
11 | 10 |
import com.takensoft.common.exception.*; |
12 | 11 |
import com.takensoft.common.file.dao.FileDAO; |
... | ... | @@ -23,11 +22,8 @@ |
23 | 22 |
import org.springframework.transaction.annotation.Transactional; |
24 | 23 |
import org.springframework.web.multipart.MultipartFile; |
25 | 24 |
|
26 |
-import java.io.IOException; |
|
27 | 25 |
import java.net.URI; |
28 | 26 |
import java.net.URISyntaxException; |
29 |
-import java.nio.file.Path; |
|
30 |
-import java.nio.file.Paths; |
|
31 | 27 |
import java.util.HashMap; |
32 | 28 |
import java.util.List; |
33 | 29 |
import java.util.Map; |
... | ... | @@ -117,8 +113,8 @@ |
117 | 113 |
* |
118 | 114 |
* 게시판 내용 등록 |
119 | 115 |
*/ |
120 |
- @Transactional(rollbackFor = Exception.class) |
|
121 | 116 |
@Override |
117 |
+ @Transactional(rollbackFor = Exception.class) |
|
122 | 118 |
public HashMap<String, Object> saveBbsCn(BbsCnVO bbsCn, List<MultipartFile> multipartFileList, List<MultipartFile> multipartImgList) { |
123 | 119 |
try { |
124 | 120 |
HashMap<String, Object> result = new HashMap<>(); |
... | ... | @@ -196,8 +192,6 @@ |
196 | 192 |
result.put("result", saveBbsCnResult); |
197 | 193 |
|
198 | 194 |
return result; |
199 |
- } catch (CustomNotFoundException | CustomFileUploadFailException | CustomInsertFailException | IllegalArgumentException le) { |
|
200 |
- throw le; |
|
201 | 195 |
} catch (DataAccessException dae) { |
202 | 196 |
throw dae; |
203 | 197 |
} catch (Exception e) { |
... | ... | @@ -339,8 +333,8 @@ |
339 | 333 |
* |
340 | 334 |
* 게시판 내용 수정 |
341 | 335 |
*/ |
342 |
- @Transactional(rollbackFor = Exception.class) |
|
343 | 336 |
@Override |
337 |
+ @Transactional(rollbackFor = Exception.class) |
|
344 | 338 |
public HashMap<String, Object> updateBbsCn(HashMap<String, Object> params, List<HashMap<String, Object>> deleteFileList, List<MultipartFile> multipartFileList, List<HashMap<String, Object>> deleteImgFileList, List<MultipartFile> multipartImgList) { |
345 | 339 |
try { |
346 | 340 |
HashMap<String, Object> result = new HashMap<>(); |
... | ... | @@ -424,10 +418,7 @@ |
424 | 418 |
|
425 | 419 |
result.put("result", intResult); |
426 | 420 |
return result; |
427 |
- } catch (CustomNotFoundException | CustomFileUploadFailException | CustomInsertFailException | CustomUpdateFailException | IllegalArgumentException |
|
428 |
- | CustomDeleteFailException le) { |
|
429 |
- throw le; |
|
430 |
- } catch (DataAccessException dae) { |
|
421 |
+ } catch (DataAccessException dae) { |
|
431 | 422 |
throw dae; |
432 | 423 |
} catch (Exception e) { |
433 | 424 |
throw e; |
... | ... | @@ -760,6 +751,4 @@ |
760 | 751 |
throw e; |
761 | 752 |
} |
762 | 753 |
} |
763 |
- |
|
764 |
- |
|
765 | 754 |
}(파일 끝에 줄바꿈 문자 없음) |
--- src/main/java/com/takensoft/cms/bbs/service/Impl/BbsMngServiceImpl.java
+++ src/main/java/com/takensoft/cms/bbs/service/Impl/BbsMngServiceImpl.java
... | ... | @@ -7,10 +7,8 @@ |
7 | 7 |
import com.takensoft.cms.bbs.vo.BbsMngVO; |
8 | 8 |
import com.takensoft.cms.bbs.vo.BbsRouterVO; |
9 | 9 |
import com.takensoft.cms.bbs.vo.BbsTypeMngVO; |
10 |
-import com.takensoft.cms.codeManage.service.CodeManageService; |
|
11 | 10 |
import com.takensoft.cms.menu.service.MenuService; |
12 | 11 |
import com.takensoft.cms.menu.vo.MenuVO; |
13 |
-import com.takensoft.common.HierachyVO; |
|
14 | 12 |
import com.takensoft.common.Pagination; |
15 | 13 |
import com.takensoft.common.exception.*; |
16 | 14 |
import com.takensoft.common.idgen.service.IdgenService; |
... | ... | @@ -143,8 +141,6 @@ |
143 | 141 |
result.put("bbsMngId", bbsMngId); |
144 | 142 |
result.put("result", insertResult); |
145 | 143 |
return result; |
146 |
- } catch (CustomInsertFailException | NullPointerException le) { |
|
147 |
- throw le; |
|
148 | 144 |
} catch (DataAccessException dae) { |
149 | 145 |
throw dae; |
150 | 146 |
} catch (Exception e) { |
... | ... | @@ -270,6 +266,7 @@ |
270 | 266 |
* 게시판 관리 수정 |
271 | 267 |
*/ |
272 | 268 |
@Override |
269 |
+ @Transactional(rollbackFor = Exception.class) |
|
273 | 270 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
274 | 271 |
public int updateBbsMng(BbsMngVO bbsMngVO) { |
275 | 272 |
try { |
... | ... | @@ -330,8 +327,6 @@ |
330 | 327 |
} |
331 | 328 |
|
332 | 329 |
return result; |
333 |
- } catch (CustomUpdateFailException | CustomDeleteFailException | CustomInsertFailException le) { |
|
334 |
- throw le; |
|
335 | 330 |
} catch (DataAccessException dae) { |
336 | 331 |
throw dae; |
337 | 332 |
} catch (Exception e) { |
... | ... | @@ -349,8 +344,8 @@ |
349 | 344 |
* |
350 | 345 |
* 게시판 관리 삭제 |
351 | 346 |
*/ |
352 |
- @Transactional(rollbackFor = Exception.class) |
|
353 | 347 |
@Override |
348 |
+ @Transactional(rollbackFor = Exception.class) |
|
354 | 349 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
355 | 350 |
public int deleteBbsMng(BbsMngVO bbsMngVO) { |
356 | 351 |
try { |
... | ... | @@ -380,8 +375,6 @@ |
380 | 375 |
} |
381 | 376 |
|
382 | 377 |
return result; |
383 |
- } catch (CustomDeleteFailException cdfe) { |
|
384 |
- throw cdfe; |
|
385 | 378 |
} catch (DataAccessException dae) { |
386 | 379 |
throw dae; |
387 | 380 |
} catch (Exception e) { |
... | ... | @@ -514,8 +507,6 @@ |
514 | 507 |
} |
515 | 508 |
|
516 | 509 |
return result; |
517 |
- } catch (CustomInsertFailException cife) { |
|
518 |
- throw cife; |
|
519 | 510 |
} catch (DataAccessException dae) { |
520 | 511 |
throw dae; |
521 | 512 |
} catch (Exception e) { |
--- src/main/java/com/takensoft/cms/bbs/service/Impl/BbsTypeMngServiceImpl.java
+++ src/main/java/com/takensoft/cms/bbs/service/Impl/BbsTypeMngServiceImpl.java
... | ... | @@ -3,9 +3,7 @@ |
3 | 3 |
import com.takensoft.cms.bbs.dao.BbsTypeMngDAO; |
4 | 4 |
import com.takensoft.cms.bbs.service.BbsTypeMngService; |
5 | 5 |
import com.takensoft.cms.bbs.vo.BbsTypeMngVO; |
6 |
-import com.takensoft.common.exception.CustomDataDuplicationException; |
|
7 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
8 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
6 |
+import com.takensoft.common.exception.*; |
|
9 | 7 |
import com.takensoft.common.idgen.service.IdgenService; |
10 | 8 |
import com.takensoft.common.util.JWTUtil; |
11 | 9 |
import lombok.RequiredArgsConstructor; |
--- src/main/java/com/takensoft/cms/bbs/service/Impl/CmntServiceImpl.java
+++ src/main/java/com/takensoft/cms/bbs/service/Impl/CmntServiceImpl.java
... | ... | @@ -154,7 +154,6 @@ |
154 | 154 |
* 게시판 댓글 수정 |
155 | 155 |
*/ |
156 | 156 |
@Override |
157 |
- @Transactional(rollbackFor = Exception.class) |
|
158 | 157 |
public HashMap<String, Object> updateCmnt(CmntVO cmntVO) { |
159 | 158 |
try { |
160 | 159 |
HashMap<String, Object> result = new HashMap<>(); |
... | ... | @@ -200,7 +199,6 @@ |
200 | 199 |
* 게시판 댓글 삭제 |
201 | 200 |
*/ |
202 | 201 |
@Override |
203 |
- @Transactional(rollbackFor = Exception.class) |
|
204 | 202 |
public int deleteCmnt(CmntVO cmntVO) { |
205 | 203 |
try { |
206 | 204 |
// 등록된 토큰에서 사용자 정보 조회 |
--- src/main/java/com/takensoft/cms/bbs/service/Impl/WordMngServiceImpl.java
+++ src/main/java/com/takensoft/cms/bbs/service/Impl/WordMngServiceImpl.java
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
11 | 11 |
import org.springframework.dao.DataAccessException; |
12 | 12 |
import org.springframework.stereotype.Service; |
13 |
+import org.springframework.transaction.annotation.Transactional; |
|
13 | 14 |
|
14 | 15 |
import java.util.HashMap; |
15 | 16 |
import java.util.List; |
... | ... | @@ -45,6 +46,7 @@ |
45 | 46 |
* 금지어 등록 |
46 | 47 |
*/ |
47 | 48 |
@Override |
49 |
+ @Transactional(rollbackFor = Exception.class) |
|
48 | 50 |
public int saveWords(HashMap<String, Object> wordList) { |
49 | 51 |
try { |
50 | 52 |
// 등록된 토큰에서 사용자 정보 조회 |
... | ... | @@ -116,6 +118,7 @@ |
116 | 118 |
* 금지어 삭제 |
117 | 119 |
*/ |
118 | 120 |
@Override |
121 |
+ @Transactional(rollbackFor = Exception.class) |
|
119 | 122 |
public int deleteWords(HashMap<String, Object> params) { |
120 | 123 |
try { |
121 | 124 |
List<Integer> wordsArr = (List<Integer>) params.get("wordsArr"); |
--- src/main/java/com/takensoft/cms/cntxtPth/service/Impl/CntxtPthServiceImpl.java
+++ src/main/java/com/takensoft/cms/cntxtPth/service/Impl/CntxtPthServiceImpl.java
... | ... | @@ -3,8 +3,7 @@ |
3 | 3 |
import com.takensoft.cms.cntxtPth.dao.CntxtPthDAO; |
4 | 4 |
import com.takensoft.cms.cntxtPth.service.CntxtPthService; |
5 | 5 |
import com.takensoft.cms.cntxtPth.vo.CntxtPthVO; |
6 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
7 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
6 |
+import com.takensoft.common.exception.*; |
|
8 | 7 |
import com.takensoft.common.idgen.service.IdgenService; |
9 | 8 |
import com.takensoft.common.util.JWTUtil; |
10 | 9 |
import lombok.RequiredArgsConstructor; |
... | ... | @@ -14,10 +13,6 @@ |
14 | 13 |
import org.springframework.dao.DataAccessException; |
15 | 14 |
import org.springframework.stereotype.Service; |
16 | 15 |
import org.springframework.transaction.annotation.Transactional; |
17 |
- |
|
18 |
-import java.util.HashMap; |
|
19 |
-import java.util.List; |
|
20 |
-import java.util.Map; |
|
21 | 16 |
|
22 | 17 |
/** |
23 | 18 |
* @author 하석형 |
... | ... | @@ -74,8 +69,8 @@ |
74 | 69 |
* 컨텍스트 패스 등록 |
75 | 70 |
*/ |
76 | 71 |
@Override |
77 |
- @CacheEvict(value = "cntxtPthInfo", allEntries = true) |
|
78 | 72 |
@Transactional(rollbackFor = Exception.class) |
73 |
+ @CacheEvict(value = "cntxtPthInfo", allEntries = true) |
|
79 | 74 |
public int cntxtPthSave(CntxtPthVO cntxtPthVO) { |
80 | 75 |
try { |
81 | 76 |
// 등록된 토큰에서 사용자 정보 조회 |
--- src/main/java/com/takensoft/cms/codeManage/service/Impl/CodeManageServiceImpl.java
+++ src/main/java/com/takensoft/cms/codeManage/service/Impl/CodeManageServiceImpl.java
... | ... | @@ -3,9 +3,7 @@ |
3 | 3 |
import com.takensoft.cms.codeManage.dao.CodeManageDAO; |
4 | 4 |
import com.takensoft.cms.codeManage.service.CodeManageService; |
5 | 5 |
import com.takensoft.cms.codeManage.vo.CodeManageVO; |
6 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
7 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
8 |
-import com.takensoft.common.exception.CustomUpdateFailException; |
|
6 |
+import com.takensoft.common.exception.*; |
|
9 | 7 |
import com.takensoft.common.util.JWTUtil; |
10 | 8 |
import com.takensoft.common.HierachyVO; |
11 | 9 |
import lombok.RequiredArgsConstructor; |
... | ... | @@ -50,8 +48,8 @@ |
50 | 48 |
/** |
51 | 49 |
* @param codeManageVO - 공통코드 정보 |
52 | 50 |
* @return boolean - 중복 여부 |
51 |
+ * @throws CustomCodeDuplicationException - 코드 중복 예외 발생 시 |
|
53 | 52 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
54 |
- * @throws NullPointerException - Null 값이 발생할 경우 |
|
55 | 53 |
* @throws Exception - 그 외 예외 발생 시 |
56 | 54 |
* |
57 | 55 |
* 코드 중복 검사 |
... | ... | @@ -59,7 +57,11 @@ |
59 | 57 |
@Override |
60 | 58 |
public boolean findByCheckCd(CodeManageVO codeManageVO) { |
61 | 59 |
try { |
62 |
- return codeManageDAO.findByCheckCd(codeManageVO); |
|
60 |
+ boolean result = codeManageDAO.findByCheckCd(codeManageVO); |
|
61 |
+ if (result) { |
|
62 |
+ throw new CustomCodeDuplicationException("이미 존재하는 코드입니다."); |
|
63 |
+ } |
|
64 |
+ return result; |
|
63 | 65 |
} catch (DataAccessException dae) { |
64 | 66 |
throw dae; |
65 | 67 |
} catch (Exception e) { |
... | ... | @@ -71,7 +73,7 @@ |
71 | 73 |
* @param codeManageVO - 공통코드 정보 |
72 | 74 |
* @return int - 등록 결과 |
73 | 75 |
* @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
74 |
- * @throws CustomInsertFailException - 등록 실패 시 |
|
76 |
+ * @throws CustomInsertFailException - 공통 코드 등록 실패 예외 발생 시 |
|
75 | 77 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
76 | 78 |
* @throws NullPointerException - Null 값이 발생할 경우 |
77 | 79 |
* @throws Exception - 그 외 예외 발생 시 |
... | ... | @@ -103,7 +105,7 @@ |
103 | 105 |
// 코드 등록 결과 |
104 | 106 |
int result = codeManageDAO.save(codeManageVO); |
105 | 107 |
if(result == 0) { |
106 |
- throw new CustomInsertFailException("공통 코드 등록 실패"); |
|
108 |
+ throw new CustomInsertFailException("공통 코드 등록에 실패했습니다."); |
|
107 | 109 |
} |
108 | 110 |
return result; |
109 | 111 |
} catch (DataAccessException dae) { |
... | ... | @@ -119,7 +121,7 @@ |
119 | 121 |
* @param codeManageVO - 공통코드 정보 |
120 | 122 |
* @return int - 등록 결과 |
121 | 123 |
* @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
122 |
- * @throws CustomUpdateFailException - 수정 실패 시 |
|
124 |
+ * @throws CustomUpdateFailException - 공통 코드 수정 실패 예외 발생 시 |
|
123 | 125 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
124 | 126 |
* @throws NullPointerException - Null 값이 발생할 경우 |
125 | 127 |
* @throws Exception - 그 외 예외 발생 시 |
... | ... | @@ -139,7 +141,7 @@ |
139 | 141 |
// 코드 수정 |
140 | 142 |
int result = codeManageDAO.update(codeManageVO); |
141 | 143 |
if(result == 0) { |
142 |
- throw new CustomUpdateFailException("공통 코드 수정 실패"); |
|
144 |
+ throw new CustomUpdateFailException("공통 코드 수정에 실패했습니다."); |
|
143 | 145 |
} |
144 | 146 |
// 해당 코드가 변경됨에 따라 하위 코드의 상위 코드값 변경 (cd의 수정은 불가능 하므로 하위코드의 상위cd값 변경 로직 삭제) |
145 | 147 |
// int updateChild = codeManageDAO.updateUpCd(codeManageVO); |
... | ... | @@ -279,6 +281,7 @@ |
279 | 281 |
/** |
280 | 282 |
* @param cd - 공통코드 명 |
281 | 283 |
* @return int - 삭제 결과 |
284 |
+ * @throws CustomDeleteFailException - 공통 코드 삭제 실패 예외 발생 시 |
|
282 | 285 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
283 | 286 |
* @throws Exception - 그 외 예외 발생 시 |
284 | 287 |
* |
... | ... | @@ -288,7 +291,11 @@ |
288 | 291 |
@Transactional(rollbackFor = Exception.class) |
289 | 292 |
public int cdDelete(String cd) { |
290 | 293 |
try { |
291 |
- return codeManageDAO.deleteCd(cd); |
|
294 |
+ int result = codeManageDAO.deleteCd(cd); |
|
295 |
+ if(result == 0) { |
|
296 |
+ throw new CustomDeleteFailException("공통 코드 삭제에 실패했습니다."); |
|
297 |
+ } |
|
298 |
+ return result; |
|
292 | 299 |
} catch (DataAccessException dae) { |
293 | 300 |
throw dae; |
294 | 301 |
} catch (Exception e) { |
... | ... | @@ -322,6 +329,7 @@ |
322 | 329 |
throw e; |
323 | 330 |
} |
324 | 331 |
} |
332 |
+ |
|
325 | 333 |
/** |
326 | 334 |
* @param id - 상위 코드 |
327 | 335 |
* @return List<HierachyVO> - 하위 코드 목록 |
... | ... | @@ -348,14 +356,14 @@ |
348 | 356 |
/************************************** Hierachy 전용 **************************************/ |
349 | 357 |
|
350 | 358 |
/** |
351 |
- * @param deptList - 부서 코드 목록 |
|
352 |
- * @return int - 부서 코드 수정 결과 |
|
359 |
+ * @param deptList - 공통 코드 목록 |
|
360 |
+ * @return int - 공통 코드 수정 결과 |
|
353 | 361 |
* @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
354 |
- * @throws CustomUpdateFailException - 수정 실패 시 |
|
362 |
+ * @throws CustomUpdateFailException - 공통 코드 수정 실패 예외 발생 시 |
|
355 | 363 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
356 | 364 |
* @throws Exception - 그 외 예외 발생 시 |
357 | 365 |
* |
358 |
- * 부서 코드 수정 (hierachyVO 사용) |
|
366 |
+ * 공통 코드 수정 (hierachyVO 사용) |
|
359 | 367 |
*/ |
360 | 368 |
@Override |
361 | 369 |
@Transactional(rollbackFor = Exception.class) |
... | ... | @@ -380,17 +388,13 @@ |
380 | 388 |
|
381 | 389 |
int upCode = codeManageDAO.codeUpdateByHierachy(vo); |
382 | 390 |
if(upCode == 0) { |
383 |
- throw new CustomUpdateFailException("부서 코드 수정 실패"); |
|
391 |
+ throw new CustomUpdateFailException("공통 코드 수정에 실패했습니다."); |
|
384 | 392 |
} |
385 | 393 |
result += upCode; |
386 | 394 |
|
387 | 395 |
// 하위 노드 수정 |
388 | 396 |
if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
389 |
- |
|
390 | 397 |
int childResult = updateChildNode(hierachyVO.getChildList(), vo); |
391 |
- if(childResult == 0) { |
|
392 |
- throw new CustomUpdateFailException("부서 코드 수정 실패"); |
|
393 |
- } |
|
394 | 398 |
} |
395 | 399 |
sn++; |
396 | 400 |
} |
... | ... | @@ -399,16 +403,17 @@ |
399 | 403 |
} |
400 | 404 |
|
401 | 405 |
/** |
402 |
- * @param childList - 부서 코드 목록 |
|
406 |
+ * @param childList - 공통 코드 목록 |
|
403 | 407 |
* @param upCodeManageVO - 상위 코드 정보 |
404 |
- * @return int - 부서 코드 수정 결과 |
|
405 |
- * @throws CustomUpdateFailException - 수정 실패 시 |
|
408 |
+ * @return int - 공통 코드 수정 결과 |
|
409 |
+ * @throws CustomUpdateFailException - 공통 코드 수정 실패 예외 발생 시 |
|
406 | 410 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
407 | 411 |
* @throws Exception - 그 외 예외 발생 시 |
408 | 412 |
* |
409 | 413 |
* 하위 코드 수정 |
410 | 414 |
*/ |
411 | 415 |
@Override |
416 |
+ @Transactional(rollbackFor = Exception.class) |
|
412 | 417 |
public int updateChildNode(List<HierachyVO> childList, CodeManageVO upCodeManageVO){ |
413 | 418 |
try { |
414 | 419 |
int result = 0; |
... | ... | @@ -424,7 +429,11 @@ |
424 | 429 |
vo.setCdGrd(grd); |
425 | 430 |
vo.setCdSn(sn); |
426 | 431 |
vo.setMdfr(mdfr); |
427 |
- result += codeManageDAO.codeUpdateByHierachy(vo); |
|
432 |
+ int childCode = codeManageDAO.codeUpdateByHierachy(vo); |
|
433 |
+ if(childCode == 0) { |
|
434 |
+ throw new CustomUpdateFailException("하위 공통 코드 수정에 실패했습니다."); |
|
435 |
+ } |
|
436 |
+ result += childCode; |
|
428 | 437 |
|
429 | 438 |
// 하위 노드 수정 |
430 | 439 |
if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
--- src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
+++ src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
... | ... | @@ -10,9 +10,7 @@ |
10 | 10 |
import com.takensoft.cms.menu.vo.MenuAuthorVO; |
11 | 11 |
import com.takensoft.cms.menu.vo.MenuVO; |
12 | 12 |
import com.takensoft.common.Pagination; |
13 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
14 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
15 |
-import com.takensoft.common.exception.CustomUpdateFailException; |
|
13 |
+import com.takensoft.common.exception.*; |
|
16 | 14 |
import com.takensoft.common.idgen.service.IdgenService; |
17 | 15 |
import com.takensoft.common.util.JWTUtil; |
18 | 16 |
import lombok.RequiredArgsConstructor; |
... | ... | @@ -108,8 +106,6 @@ |
108 | 106 |
result.put("contsId", contsId); |
109 | 107 |
result.put("result", insertResult); |
110 | 108 |
return result; |
111 |
- } catch (CustomInsertFailException cife) { |
|
112 |
- throw cife; |
|
113 | 109 |
} catch (DataAccessException dae) { |
114 | 110 |
throw dae; |
115 | 111 |
} catch (NullPointerException npe) { |
... | ... | @@ -130,8 +126,8 @@ |
130 | 126 |
* 콘텐츠 유형 수정 |
131 | 127 |
*/ |
132 | 128 |
@Override |
129 |
+ @Transactional(rollbackFor = Exception.class) |
|
133 | 130 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
134 |
- @Transactional |
|
135 | 131 |
public int contsUpdate(ContsTypeVO contsTypeVO){ |
136 | 132 |
try { |
137 | 133 |
// 콘텐츠 유형 수정 결과 |
... | ... | @@ -293,66 +289,50 @@ |
293 | 289 |
/** |
294 | 290 |
* @param routes - 라우터 정보 목록 |
295 | 291 |
* @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 조회 결과값 |
296 |
- * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
297 |
- * @throws Exception - 그 외 예외 발생 시 |
|
298 | 292 |
* |
299 | 293 |
* 라우터의 특정경로로 그룹화하여 각 그룹 내에서 권한을 공유 |
300 | 294 |
*/ |
301 | 295 |
private List<ContsAuthrtVO> groupAndShareAuth(List<ContsAuthrtVO> routes) { |
302 |
- try { |
|
303 |
- // 경로의 특정 기준점으로 라우터를 그룹화 |
|
304 |
- Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream() |
|
305 |
- .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출 |
|
296 |
+ // 경로의 특정 기준점으로 라우터를 그룹화 |
|
297 |
+ Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream() |
|
298 |
+ .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출 |
|
306 | 299 |
|
307 |
- /* key */ |
|
300 |
+ /* key */ |
|
308 | 301 |
// Iterator<String> keys = groupedRoutes.keySet().iterator(); |
309 | 302 |
// while(keys.hasNext()) { |
310 | 303 |
// String key = keys.next(); |
311 | 304 |
// System.out.println("key : " + key); |
312 | 305 |
// } |
313 |
- /* key */ |
|
306 |
+ /* key */ |
|
314 | 307 |
|
315 |
- // 그룹화된 각 경로에 대해 권한 정보 공유 |
|
316 |
- groupedRoutes.forEach((basePath, routeGroup) -> { |
|
317 |
- List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회 |
|
318 |
- // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정 |
|
319 |
- routeGroup.forEach(route -> { |
|
320 |
- if (route.getAuthrtList().isEmpty()) { |
|
321 |
- route.setAuthrtList(sharedAuth); |
|
322 |
- } |
|
323 |
- }); |
|
308 |
+ // 그룹화된 각 경로에 대해 권한 정보 공유 |
|
309 |
+ groupedRoutes.forEach((basePath, routeGroup) -> { |
|
310 |
+ List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회 |
|
311 |
+ // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정 |
|
312 |
+ routeGroup.forEach(route -> { |
|
313 |
+ if (route.getAuthrtList().isEmpty()) { |
|
314 |
+ route.setAuthrtList(sharedAuth); |
|
315 |
+ } |
|
324 | 316 |
}); |
325 |
- // 각 그룹의 라우터들을 리스트로 반환 |
|
326 |
- return groupedRoutes.values().stream() |
|
327 |
- .flatMap(List::stream) |
|
328 |
- .collect(Collectors.toList()); |
|
329 |
- } catch (DataAccessException dae) { |
|
330 |
- throw dae; |
|
331 |
- } catch (Exception e) { |
|
332 |
- throw e; |
|
333 |
- } |
|
317 |
+ }); |
|
318 |
+ // 각 그룹의 라우터들을 리스트로 반환 |
|
319 |
+ return groupedRoutes.values().stream() |
|
320 |
+ .flatMap(List::stream) |
|
321 |
+ .collect(Collectors.toList()); |
|
334 | 322 |
} |
335 | 323 |
|
336 | 324 |
/** |
337 | 325 |
* @param routeGroup - 콘텐츠 유형과 권한 정보 목록 |
338 | 326 |
* @return List<MenuAuthorVO> - 권한 정보가 있는 첫 번째 라우터의 권한 정보 목록 |
339 |
- * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
340 |
- * @throws Exception - 그 외 예외 발생 시 |
|
341 | 327 |
* |
342 | 328 |
* 그룹 내에서 가장 완전한 권한 정보를 가진 라우터를 찾아 해당 권한 리스트 반환 |
343 | 329 |
*/ |
344 | 330 |
private List<MenuAuthorVO> findMostComprehensiveAuth(List<ContsAuthrtVO> routeGroup) { |
345 | 331 |
// 권한정보가 있는 첫 번째 라우터를 찾아 권한 정보 반환 |
346 |
- try { |
|
347 |
- return routeGroup.stream() |
|
348 |
- .filter(route -> !route.getAuthrtList().isEmpty()) |
|
349 |
- .findFirst() |
|
350 |
- .map(ContsAuthrtVO::getAuthrtList) |
|
351 |
- .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환 |
|
352 |
- } catch (DataAccessException dae) { |
|
353 |
- throw dae; |
|
354 |
- } catch (Exception e) { |
|
355 |
- throw e; |
|
356 |
- } |
|
332 |
+ return routeGroup.stream() |
|
333 |
+ .filter(route -> !route.getAuthrtList().isEmpty()) |
|
334 |
+ .findFirst() |
|
335 |
+ .map(ContsAuthrtVO::getAuthrtList) |
|
336 |
+ .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환 |
|
357 | 337 |
} |
358 | 338 |
} |
--- src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
+++ src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
... | ... | @@ -88,7 +88,7 @@ |
88 | 88 |
|
89 | 89 |
insertResult = deptDAO.save(deptVO); |
90 | 90 |
if(insertResult == 0) { |
91 |
- throw new CustomInsertFailException("부서 등록 실패"); |
|
91 |
+ throw new CustomInsertFailException("부서 등록에 실패했습니다."); |
|
92 | 92 |
} |
93 | 93 |
// 부서 권한 등록 |
94 | 94 |
if (deptVO.getAuthrtList().size() > 0) { |
... | ... | @@ -97,7 +97,7 @@ |
97 | 97 |
vo.setRgtr(writer); |
98 | 98 |
int insertDeptAuth = deptDAO.authrtSave(vo); // 부서 권한 등록 결과 |
99 | 99 |
if(insertDeptAuth == 0) { |
100 |
- throw new CustomInsertFailException("부서 권한 등록 실패"); |
|
100 |
+ throw new CustomInsertFailException("부서 권한 등록에 실패했습니다."); |
|
101 | 101 |
} |
102 | 102 |
} |
103 | 103 |
} |
... | ... | @@ -140,7 +140,7 @@ |
140 | 140 |
|
141 | 141 |
result = deptDAO.deptMbrSave(deptMbrVO); // 부서 사용자 등록 |
142 | 142 |
if(result == 0) { |
143 |
- throw new CustomInsertFailException("부서 사용자 등록 실패"); |
|
143 |
+ throw new CustomInsertFailException("부서 사용자 등록에 실패했습니다."); |
|
144 | 144 |
} |
145 | 145 |
return result; |
146 | 146 |
} catch(DataAccessException dae) { |
... | ... | @@ -264,12 +264,12 @@ |
264 | 264 |
|
265 | 265 |
result = deptDAO.update(deptVO); // 부서정보 수정 |
266 | 266 |
if (result == 0) { |
267 |
- throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
267 |
+ throw new CustomUpdateFailException("부서 정보 수정에 실패했습니다."); |
|
268 | 268 |
} |
269 | 269 |
// 부서 권한 삭제 결과 |
270 | 270 |
int deleteDeptAuth = deptDAO.deleteAuth(deptVO.getDeptId()); // 부서 권한 삭제 |
271 | 271 |
if (deleteDeptAuth == 0) { |
272 |
- throw new CustomUpdateFailException("부서 권한 삭제 실패"); |
|
272 |
+ throw new CustomUpdateFailException("부서 권한 삭제에 실패했습니다."); |
|
273 | 273 |
} |
274 | 274 |
// 부서 권한 등록 |
275 | 275 |
if (deptVO.getAuthrtList().size() > 0) { |
... | ... | @@ -278,7 +278,7 @@ |
278 | 278 |
vo.setRgtr(writer); |
279 | 279 |
int insertDeptAuth = deptDAO.authrtSave(vo); // 부서 권한 등록 결과 |
280 | 280 |
if (insertDeptAuth == 0) { |
281 |
- throw new CustomInsertFailException("부서 권한 등록 실패"); |
|
281 |
+ throw new CustomInsertFailException("부서 권한 등록에 실패했습니다."); |
|
282 | 282 |
} |
283 | 283 |
} |
284 | 284 |
} |
... | ... | @@ -317,7 +317,7 @@ |
317 | 317 |
int deleteDeptAuth = 0; // 부서 사용자 삭제 결과 |
318 | 318 |
deleteDeptAuth = deptDAO.deleteDeptInDeptMbr(deptVO.getDeptId()); |
319 | 319 |
if (deleteDeptAuth == 0) { |
320 |
- throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
320 |
+ throw new CustomDeleteFailException("부서 사용자 삭제에 실패했습니다."); |
|
321 | 321 |
} |
322 | 322 |
} |
323 | 323 |
return delResult; |
... | ... | @@ -350,7 +350,7 @@ |
350 | 350 |
if (deptDAO.findByDeptMber(param).size() > 0) { |
351 | 351 |
int delMbrResult = deptDAO.deleteDeptMbr(param); // 부서 사용자 삭제 |
352 | 352 |
if (delMbrResult == 0) { |
353 |
- throw new CustomDeleteFailException("부서 사용자 삭제 실패"); |
|
353 |
+ throw new CustomDeleteFailException("부서 사용자 삭제에 실패했습니다."); |
|
354 | 354 |
} |
355 | 355 |
result += delMbrResult; |
356 | 356 |
} |
... | ... | @@ -440,7 +440,7 @@ |
440 | 440 |
vo.setMdfr(writer); |
441 | 441 |
int updateResult = deptDAO.deptUpdateByHierachy(vo); |
442 | 442 |
if (updateResult == 0) { |
443 |
- throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
443 |
+ throw new CustomUpdateFailException("부서 정보 수정에 실패했습니다."); |
|
444 | 444 |
} |
445 | 445 |
result += updateResult; |
446 | 446 |
|
... | ... | @@ -452,8 +452,6 @@ |
452 | 452 |
} |
453 | 453 |
} |
454 | 454 |
return result; |
455 |
- } catch(CustomUpdateFailException cufe) { |
|
456 |
- throw cufe; |
|
457 | 455 |
} catch(DataAccessException dae) { |
458 | 456 |
throw dae; |
459 | 457 |
} catch (NullPointerException ne) { |
... | ... | @@ -474,6 +472,7 @@ |
474 | 472 |
* 하위 부서 수정 |
475 | 473 |
*/ |
476 | 474 |
@Override |
475 |
+ @Transactional(rollbackFor = Exception.class) |
|
477 | 476 |
public int updateChildNode(List<HierachyVO> childList, DeptVO upDeptVO) { |
478 | 477 |
try { |
479 | 478 |
int result = 0; // 부서 정보 수정 결과 |
... | ... | @@ -491,7 +490,7 @@ |
491 | 490 |
vo.setMdfr(mdfr); |
492 | 491 |
int updateResult = deptDAO.deptUpdateByHierachy(vo); |
493 | 492 |
if (updateResult == 0) { |
494 |
- throw new CustomUpdateFailException("부서 정보 수정 실패"); |
|
493 |
+ throw new CustomUpdateFailException("부서 정보 수정에 실패했습니다."); |
|
495 | 494 |
} |
496 | 495 |
result += updateResult; |
497 | 496 |
|
... | ... | @@ -503,8 +502,6 @@ |
503 | 502 |
sn++; |
504 | 503 |
} |
505 | 504 |
return result; |
506 |
- } catch(CustomUpdateFailException cufe) { |
|
507 |
- throw cufe; |
|
508 | 505 |
} catch(DataAccessException dae) { |
509 | 506 |
throw dae; |
510 | 507 |
} catch (NullPointerException ne) { |
--- src/main/java/com/takensoft/cms/mber/dto/PasswordDTO.java
+++ src/main/java/com/takensoft/cms/mber/dto/PasswordDTO.java
... | ... | @@ -26,4 +26,5 @@ |
26 | 26 |
private String pswd; // 비밀번호[현재 비밀번호] |
27 | 27 |
@NotBlank(message = "변경할 비밀번호는 필수 입력 값입니다.") |
28 | 28 |
private String newPswd; // 비밀번호[변경될 비밀번호] |
29 |
+ private String mdfr; // 수정자 |
|
29 | 30 |
} |
--- src/main/java/com/takensoft/cms/mber/service/Impl/AdmMbrServiceImpl.java
+++ src/main/java/com/takensoft/cms/mber/service/Impl/AdmMbrServiceImpl.java
... | ... | @@ -11,7 +11,7 @@ |
11 | 11 |
import com.takensoft.cms.mber.vo.MberAuthorVO; |
12 | 12 |
import com.takensoft.cms.mber.vo.MberVO; |
13 | 13 |
import com.takensoft.common.Pagination; |
14 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
14 |
+import com.takensoft.common.exception.*; |
|
15 | 15 |
import com.takensoft.common.idgen.service.IdgenService; |
16 | 16 |
import com.takensoft.common.util.HttpRequestUtil; |
17 | 17 |
import com.takensoft.common.util.JWTUtil; |
... | ... | @@ -133,6 +133,9 @@ |
133 | 133 |
* @param admMbrDTO -회원정보 |
134 | 134 |
* @return int - 회원정보 수정 결과 |
135 | 135 |
* @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
136 |
+ * @throws CustomUpdateFailException - 회원정보 수정 예외 발생 시 |
|
137 |
+ * @throws CustomDeleteFailException - 회원 권한 삭제 예외 발생 시 |
|
138 |
+ * @throws CustomInsertFailException - 회원 권한 등록 예외 발생 시 |
|
136 | 139 |
* @throws DataAccessException - db 관련 예외 발생 시 |
137 | 140 |
* @throws Exception - 그 외 예외 발생 시 |
138 | 141 |
* |
... | ... | @@ -168,15 +171,24 @@ |
168 | 171 |
|
169 | 172 |
// 회원정보 수정 |
170 | 173 |
int result = admMbrDAO.updateMbr(admMbrDTO); |
174 |
+ if(result == 0) { |
|
175 |
+ throw new CustomUpdateFailException("회원정보 수정에 실패했습니다."); |
|
176 |
+ } |
|
171 | 177 |
|
172 | 178 |
// 권한 수정 |
173 | 179 |
result += admMbrDAO.deleteAuthorListByMbrId(admMbrDTO.getMbrId()); // 회원 권한 전체 삭제 |
180 |
+ if(result == 0) { |
|
181 |
+ throw new CustomDeleteFailException("회원 권한 삭제에 실패했습니다."); |
|
182 |
+ } |
|
174 | 183 |
if (admMbrDTO.getUseYn().equals("Y")) { // 수정일 경우 회원 권한 재 등록 |
175 | 184 |
if(admMbrDTO.getAuthorList() != null && admMbrDTO.getAuthorList().size() > 0) { |
176 | 185 |
for(MberAuthorVO mberAuthorVO : admMbrDTO.getAuthorList()) { |
177 | 186 |
mberAuthorVO.setMbrId(admMbrDTO.getMbrId()); |
178 | 187 |
mberAuthorVO.setRgtr(writer); |
179 | 188 |
result += admMbrDAO.insertAuthor(mberAuthorVO); |
189 |
+ if(result == 0) { |
|
190 |
+ throw new CustomInsertFailException("회원 권한 등록에 실패했습니다."); |
|
191 |
+ } |
|
180 | 192 |
} |
181 | 193 |
} |
182 | 194 |
} else { // 회원 탈퇴일 경우 관련 정보 삭제 |
... | ... | @@ -195,71 +207,78 @@ |
195 | 207 |
} |
196 | 208 |
} |
197 | 209 |
|
198 |
- /** |
|
199 |
- * @param req - HTTP 요청 객체 |
|
200 |
- * @param joinDTO -회원정보 |
|
201 |
- * @return HashMap<String, Object> - 회원정보 등록 결과 |
|
202 |
- * - mbrId : 회원 아이디 |
|
203 |
- * - insertResult : 회원등록정보 결과 |
|
204 |
- * @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
|
205 |
- * @throws DataAccessException - db 관련 예외 발생 시 |
|
206 |
- * @throws Exception - 그 외 예외 발생 시 |
|
207 |
- * |
|
208 |
- * 회원정보 등록 |
|
209 |
- */ |
|
210 |
- @Override |
|
211 |
- @Transactional(rollbackFor = Exception.class) |
|
212 |
- public HashMap<String, Object> mbrInsert(HttpServletRequest req, JoinDTO joinDTO){ |
|
213 |
- try { |
|
214 |
- // 회원 아이디 생성 |
|
215 |
- String mbrId = mberIdgn.getNextStringId(); |
|
216 |
- joinDTO.setMbrId(mbrId); |
|
210 |
+ /** |
|
211 |
+ * @param req - HTTP 요청 객체 |
|
212 |
+ * @param joinDTO -회원정보 |
|
213 |
+ * @return HashMap<String, Object> - 회원정보 등록 결과 |
|
214 |
+ * - mbrId : 회원 아이디 |
|
215 |
+ * - insertResult : 회원등록정보 결과 |
|
216 |
+ * @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
|
217 |
+ * @throws CustomInsertFailException - 등록 실패 예외 발생 시 |
|
218 |
+ * @throws DataAccessException - db 관련 예외 발생 시 |
|
219 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
220 |
+ * |
|
221 |
+ * 회원정보 등록 |
|
222 |
+ */ |
|
223 |
+ @Override |
|
224 |
+ @Transactional(rollbackFor = Exception.class) |
|
225 |
+ public HashMap<String, Object> mbrInsert(HttpServletRequest req, JoinDTO joinDTO){ |
|
226 |
+ try { |
|
227 |
+ // 회원 아이디 생성 |
|
228 |
+ String mbrId = mberIdgn.getNextStringId(); |
|
229 |
+ joinDTO.setMbrId(mbrId); |
|
217 | 230 |
|
218 |
- // 비밀번호 암호화 |
|
219 |
- joinDTO.setPswd(bCryptPasswordEncoder.encode(joinDTO.getPswd())); |
|
231 |
+ // 비밀번호 암호화 |
|
232 |
+ joinDTO.setPswd(bCryptPasswordEncoder.encode(joinDTO.getPswd())); |
|
220 | 233 |
|
221 |
- // 연락처 암호화 |
|
222 |
- if(joinDTO.getMblTelno() != null && !joinDTO.getMblTelno().equals("")) { |
|
223 |
- joinDTO.setMblTelno(Secret.encrypt(joinDTO.getMblTelno())); |
|
224 |
- } |
|
225 |
- if(joinDTO.getTelno() != null && !joinDTO.getTelno().equals("")) { |
|
226 |
- joinDTO.setTelno(Secret.encrypt(joinDTO.getTelno())); |
|
227 |
- } |
|
234 |
+ // 연락처 암호화 |
|
235 |
+ if(joinDTO.getMblTelno() != null && !joinDTO.getMblTelno().equals("")) { |
|
236 |
+ joinDTO.setMblTelno(Secret.encrypt(joinDTO.getMblTelno())); |
|
237 |
+ } |
|
238 |
+ if(joinDTO.getTelno() != null && !joinDTO.getTelno().equals("")) { |
|
239 |
+ joinDTO.setTelno(Secret.encrypt(joinDTO.getTelno())); |
|
240 |
+ } |
|
228 | 241 |
|
229 |
- // 아이피 등록 |
|
230 |
- String ip = httpRequestUtil.getIp(req); |
|
231 |
- joinDTO.setFrstRegIp(ip); |
|
242 |
+ // 아이피 등록 |
|
243 |
+ String ip = httpRequestUtil.getIp(req); |
|
244 |
+ joinDTO.setFrstRegIp(ip); |
|
232 | 245 |
|
233 |
- // 등록된 토큰에서 사용자 정보 조회 |
|
234 |
- String writer = jwtUtil.getWriter(); |
|
235 |
- if (writer == null || writer.isEmpty()) { |
|
236 |
- throw new CustomNotFoundException("사용자 정보 조회에 실패했습니다."); |
|
237 |
- } |
|
238 |
- // 작성자 등록 |
|
239 |
- joinDTO.setRgtr(writer); |
|
246 |
+ // 등록된 토큰에서 사용자 정보 조회 |
|
247 |
+ String writer = jwtUtil.getWriter(); |
|
248 |
+ if (writer == null || writer.isEmpty()) { |
|
249 |
+ throw new CustomNotFoundException("사용자 정보 조회에 실패했습니다."); |
|
250 |
+ } |
|
251 |
+ // 작성자 등록 |
|
252 |
+ joinDTO.setRgtr(writer); |
|
240 | 253 |
|
241 |
- // 회원정보 등록 |
|
242 |
- int insertResult = admMbrDAO.mbrInsert(joinDTO); |
|
254 |
+ // 회원정보 등록 |
|
255 |
+ int insertResult = admMbrDAO.mbrInsert(joinDTO); |
|
256 |
+ if(insertResult == 0) { |
|
257 |
+ throw new CustomInsertFailException("회원정보 등록에 실패했습니다."); |
|
258 |
+ } |
|
243 | 259 |
|
244 |
- // 권한 등록 |
|
245 |
- if(joinDTO.getAuthorList().size() > 0) { |
|
246 |
- for(MberAuthorVO mberAuthorVO : joinDTO.getAuthorList()) { |
|
247 |
- mberAuthorVO.setMbrId(joinDTO.getMbrId()); |
|
248 |
- mberAuthorVO.setRgtr(writer); |
|
249 |
- insertResult += admMbrDAO.insertAuthor(mberAuthorVO); |
|
260 |
+ // 권한 등록 |
|
261 |
+ if(joinDTO.getAuthorList().size() > 0) { |
|
262 |
+ for(MberAuthorVO mberAuthorVO : joinDTO.getAuthorList()) { |
|
263 |
+ mberAuthorVO.setMbrId(joinDTO.getMbrId()); |
|
264 |
+ mberAuthorVO.setRgtr(writer); |
|
265 |
+ insertResult += admMbrDAO.insertAuthor(mberAuthorVO); |
|
266 |
+ if(insertResult == 0) { |
|
267 |
+ throw new CustomInsertFailException("회원 권한 등록에 실패했습니다."); |
|
250 | 268 |
} |
251 | 269 |
} |
252 |
- |
|
253 |
- HashMap<String, Object> result = new HashMap<>(); |
|
254 |
- result.put("mbrId", mbrId); |
|
255 |
- result.put("insertResult", insertResult); |
|
256 |
- return result; |
|
257 |
- } catch (DataAccessException dae) { |
|
258 |
- throw dae; |
|
259 |
- } catch (Exception e) { |
|
260 |
- throw e; |
|
261 | 270 |
} |
271 |
+ |
|
272 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
273 |
+ result.put("mbrId", mbrId); |
|
274 |
+ result.put("insertResult", insertResult); |
|
275 |
+ return result; |
|
276 |
+ } catch (DataAccessException dae) { |
|
277 |
+ throw dae; |
|
278 |
+ } catch (Exception e) { |
|
279 |
+ throw e; |
|
262 | 280 |
} |
281 |
+ } |
|
263 | 282 |
|
264 | 283 |
/** |
265 | 284 |
* @param mbrVO -회원정보 |
... | ... | @@ -296,6 +315,7 @@ |
296 | 315 |
passwordDTO.setMbrId(mbrId); |
297 | 316 |
passwordDTO.setPswd(admMbrDTO.getPswd()); |
298 | 317 |
passwordDTO.setNewPswd(resetPswd); |
318 |
+ passwordDTO.setMdfr("SYSTEM"); // 비로그인 수정이기 때문에 시스템 변경 |
|
299 | 319 |
|
300 | 320 |
// 비밀번호 변경 |
301 | 321 |
int result = mbrService.updatePassword(passwordDTO); |
--- src/main/java/com/takensoft/cms/mber/service/Impl/LgnHstryServiceImpl.java
+++ src/main/java/com/takensoft/cms/mber/service/Impl/LgnHstryServiceImpl.java
... | ... | @@ -6,13 +6,10 @@ |
6 | 6 |
import com.takensoft.cms.mber.dao.LgnHstryDAO; |
7 | 7 |
import com.takensoft.cms.mber.service.LgnHstryService; |
8 | 8 |
import com.takensoft.cms.mber.vo.LgnHstryVO; |
9 |
-import com.takensoft.cms.popup.vo.PopupVO; |
|
10 | 9 |
import com.takensoft.common.Pagination; |
11 |
-import com.takensoft.common.util.JWTUtil; |
|
10 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
12 | 11 |
import lombok.RequiredArgsConstructor; |
13 | 12 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
14 |
-import org.slf4j.Logger; |
|
15 |
-import org.slf4j.LoggerFactory; |
|
16 | 13 |
import org.springframework.dao.DataAccessException; |
17 | 14 |
import org.springframework.stereotype.Service; |
18 | 15 |
|
... | ... | @@ -39,6 +36,7 @@ |
39 | 36 |
/** |
40 | 37 |
* @param lgnHstryVO - 로그인 이력 정보 |
41 | 38 |
* @return int - 로그인 이력 결과 |
39 |
+ * @throws CustomInsertFailException - 로그인 이력 등록 실패 예외 발생 시 |
|
42 | 40 |
* @throws DataAccessException - db 관련 예외 발생 시 |
43 | 41 |
* @throws Exception - 그 외 예외 발생 시 |
44 | 42 |
* |
... | ... | @@ -47,9 +45,12 @@ |
47 | 45 |
@Override |
48 | 46 |
public int LgnHstrySave(LgnHstryVO lgnHstryVO){ |
49 | 47 |
try { |
50 |
- int result = lgnHstryDAO.save(lgnHstryVO); |
|
48 |
+ int result = lgnHstryDAO.save(lgnHstryVO); |
|
49 |
+ if (result == 0) { |
|
50 |
+ throw new CustomInsertFailException("로그인 이력 등록에 실패했습니다."); |
|
51 |
+ } |
|
51 | 52 |
|
52 |
- return result; |
|
53 |
+ return result; |
|
53 | 54 |
} catch (DataAccessException dae) { |
54 | 55 |
throw dae; |
55 | 56 |
} catch (Exception e) { |
--- src/main/java/com/takensoft/cms/mber/service/Impl/MberServiceImpl.java
+++ src/main/java/com/takensoft/cms/mber/service/Impl/MberServiceImpl.java
... | ... | @@ -69,7 +69,7 @@ |
69 | 69 |
/** |
70 | 70 |
* @param lgnId - 로그인 아이디 |
71 | 71 |
* @return boolean - 아이디 아이디 중복 여부 |
72 |
- * @throws CustomIdTakenException |
|
72 |
+ * @throws CustomIdTakenException - 아이디 중복 예외 발생 시 |
|
73 | 73 |
* @throws DataAccessException - db 관련 예외 발생 시 |
74 | 74 |
* @throws Exception - 그 외 예외 발생 시 |
75 | 75 |
* |
... | ... | @@ -97,6 +97,7 @@ |
97 | 97 |
* - mbrId : 회원 아이디 |
98 | 98 |
* - result : 회원등록정보 결과 |
99 | 99 |
* @throws CustomNotFoundException - 사용자 정보 조회 예외 발생 시 |
100 |
+ * @throws CustomInsertFailException - 회원가입, 회원권한 등록 실패 예외 발생 시 |
|
100 | 101 |
* @throws DataAccessException - db 관련 예외 발생 시 |
101 | 102 |
* @throws Exception - 그 외 예외 발생 시 |
102 | 103 |
* |
... | ... | @@ -138,6 +139,10 @@ |
138 | 139 |
// 회원정보 등록 |
139 | 140 |
HashMap<String, Object> result = new HashMap<>(); |
140 | 141 |
int saveResult = mberDAO.save(joinDTO); |
142 |
+ if(saveResult == 0) { |
|
143 |
+ throw new CustomInsertFailException("회원 정보 등록에 실패했습니다."); |
|
144 |
+ } |
|
145 |
+ |
|
141 | 146 |
result.put("mbrId", mbrId); |
142 | 147 |
|
143 | 148 |
// 권한 등록 |
... | ... | @@ -149,6 +154,9 @@ |
149 | 154 |
vo.setRgtr(writer); |
150 | 155 |
|
151 | 156 |
authorResult += mberDAO.authorSave(vo); |
157 |
+ if(authorResult == 0) { |
|
158 |
+ throw new CustomInsertFailException("회원 권한 등록에 실패했습니다."); |
|
159 |
+ } |
|
152 | 160 |
} |
153 | 161 |
} |
154 | 162 |
result.put("result", saveResult + authorResult); |
... | ... | @@ -171,7 +179,7 @@ |
171 | 179 |
* 비밀번호 비교 |
172 | 180 |
*/ |
173 | 181 |
@Override |
174 |
- public boolean passwordCheck(PasswordDTO passwordDTO){ |
|
182 |
+ public boolean passwordCheck(PasswordDTO passwordDTO) { |
|
175 | 183 |
try { |
176 | 184 |
// 등록된 토큰에서 사용자 정보 조회 |
177 | 185 |
String writer = jwtUtil.getWriter(); |
... | ... | @@ -183,10 +191,12 @@ |
183 | 191 |
MberVO mbr = mberDAO.findByMber(writer); |
184 | 192 |
|
185 | 193 |
// 비밀번호 비교 후 성공 시 비밀번호 수정 후 true 반환 |
186 |
- if(bCryptPasswordEncoder.matches(passwordDTO.getPswd(), mbr.getPassword())) { |
|
187 |
- passwordDTO.setNewPswd(bCryptPasswordEncoder.encode(passwordDTO.getNewPswd())); |
|
194 |
+ if (bCryptPasswordEncoder.matches(passwordDTO.getPswd(), mbr.getPassword())) { |
|
195 |
+// passwordDTO.setNewPswd(bCryptPasswordEncoder.encode(passwordDTO.getNewPswd())); |
|
188 | 196 |
passwordDTO.setMbrId(mbr.getMbrId()); |
189 |
- mberDAO.updatePassword(passwordDTO); |
|
197 |
+ passwordDTO.setMdfr(writer); |
|
198 |
+// mberDAO.updatePassword(passwordDTO); |
|
199 |
+ int result = updatePassword(passwordDTO); |
|
190 | 200 |
return true; |
191 | 201 |
// 기존 비밀번호와 입력한 비밀번호가 서로 다를 경우 false 반환 |
192 | 202 |
} else { |
... | ... | @@ -210,17 +220,17 @@ |
210 | 220 |
@Override |
211 | 221 |
public MberVO findByMbr(HashMap<String, Object> params){ |
212 | 222 |
try { |
213 |
- String mbrId = params.get("mbrId").toString(); |
|
214 |
- MberVO mberVO = mberDAO.findByMber(mbrId); |
|
215 |
- // 휴대폰번호 복호화 |
|
216 |
- if (mberVO.getMblTelno() != null && !mberVO.getMblTelno().equals("")) { |
|
217 |
- mberVO.setMblTelno(Secret.decrypt(mberVO.getMblTelno().toString())); |
|
218 |
- } |
|
219 |
- // 전화번호 복호화 |
|
220 |
- if (mberVO.getTelno() != null && !mberVO.getTelno().equals("")) { |
|
221 |
- mberVO.setTelno(Secret.decrypt(mberVO.getTelno().toString())); |
|
222 |
- } |
|
223 |
- return mberVO; |
|
223 |
+ String mbrId = params.get("mbrId").toString(); |
|
224 |
+ MberVO mberVO = mberDAO.findByMber(mbrId); |
|
225 |
+ // 휴대폰번호 복호화 |
|
226 |
+ if (mberVO.getMblTelno() != null && !mberVO.getMblTelno().equals("")) { |
|
227 |
+ mberVO.setMblTelno(Secret.decrypt(mberVO.getMblTelno().toString())); |
|
228 |
+ } |
|
229 |
+ // 전화번호 복호화 |
|
230 |
+ if (mberVO.getTelno() != null && !mberVO.getTelno().equals("")) { |
|
231 |
+ mberVO.setTelno(Secret.decrypt(mberVO.getTelno().toString())); |
|
232 |
+ } |
|
233 |
+ return mberVO; |
|
224 | 234 |
} catch (DataAccessException dae) { |
225 | 235 |
throw dae; |
226 | 236 |
} catch (Exception e) { |
... | ... | @@ -241,7 +251,8 @@ |
241 | 251 |
public int updatePassword(PasswordDTO passwordDTO) { |
242 | 252 |
try { |
243 | 253 |
int result = 0; |
244 |
- passwordDTO.setNewPswd(bCryptPasswordEncoder.encode(passwordDTO.getNewPswd())); |
|
254 |
+ |
|
255 |
+ passwordDTO.setNewPswd(bCryptPasswordEncoder.encode(passwordDTO.getNewPswd())); // 비밀번호 암호화 |
|
245 | 256 |
|
246 | 257 |
result = mberDAO.updatePassword(passwordDTO); |
247 | 258 |
if (result == 0) { |
--- src/main/java/com/takensoft/cms/mber/web/AdmMbrController.java
+++ src/main/java/com/takensoft/cms/mber/web/AdmMbrController.java
... | ... | @@ -146,9 +146,6 @@ |
146 | 146 |
|
147 | 147 |
// 아이디 중복 검사 |
148 | 148 |
boolean isExistence = mbrService.findByCheckLoginId(joinDTO.getLgnId()); |
149 |
- if(isExistence) { |
|
150 |
- return resUtil.errorRes(MessageCode.SIGNUP_ID_TAKEN); |
|
151 |
- } |
|
152 | 149 |
|
153 | 150 |
// 회원 가입 진행 |
154 | 151 |
HashMap<String, Object> result = admMbrService.mbrInsert(req, joinDTO); |
--- src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
+++ src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
... | ... | @@ -6,10 +6,7 @@ |
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 |
+import com.takensoft.common.exception.*; |
|
13 | 10 |
import com.takensoft.common.file.service.FileMngService; |
14 | 11 |
import com.takensoft.common.file.vo.FileMngVO; |
15 | 12 |
import com.takensoft.common.idgen.service.IdgenService; |
--- src/main/java/com/takensoft/cms/prvcInqHstry/service/Impl/PrvcInqHstryServiceImpl.java
+++ src/main/java/com/takensoft/cms/prvcInqHstry/service/Impl/PrvcInqHstryServiceImpl.java
... | ... | @@ -6,8 +6,7 @@ |
6 | 6 |
import com.takensoft.cms.prvcInqHstry.service.PrvcInqHstryService; |
7 | 7 |
import com.takensoft.cms.prvcInqHstry.vo.PrvcInqHstryVO; |
8 | 8 |
import com.takensoft.common.Pagination; |
9 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
10 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
9 |
+import com.takensoft.common.exception.*; |
|
11 | 10 |
import com.takensoft.common.util.HttpRequestUtil; |
12 | 11 |
import com.takensoft.common.util.JWTUtil; |
13 | 12 |
import lombok.RequiredArgsConstructor; |
... | ... | @@ -55,6 +54,7 @@ |
55 | 54 |
* |
56 | 55 |
* 개인정보 조회 이력 등록 |
57 | 56 |
*/ |
57 |
+ @Override |
|
58 | 58 |
public int prvcInqHstryInsert(HttpServletRequest request, PrvcInqHstryVO prvcInqHstryVO) { |
59 | 59 |
try { |
60 | 60 |
// 조회 아이피 삽입 |
--- src/main/java/com/takensoft/cms/token/service/impl/RefreshTokenServiceImpl.java
+++ src/main/java/com/takensoft/cms/token/service/impl/RefreshTokenServiceImpl.java
... | ... | @@ -164,9 +164,10 @@ |
164 | 164 |
@Override |
165 | 165 |
@Transactional(rollbackFor = Exception.class) |
166 | 166 |
public int tokenReissueProc(HttpServletRequest req, HttpServletResponse res){ |
167 |
+ try { |
|
167 | 168 |
// refresh token 검증 |
168 | 169 |
int result = (int) refreshTokenCheck(req).get("result"); |
169 |
- if(result == 0) return result; |
|
170 |
+ if (result == 0) return result; |
|
170 | 171 |
|
171 | 172 |
String refreshToken = refreshTokenCheck(req).get("refreshToken").toString(); |
172 | 173 |
|
... | ... | @@ -197,7 +198,7 @@ |
197 | 198 |
String newAccessToken = jwtUtil.createJwt("Authorization", mber.getMbrId(), mber.getLgnId(), mber.getMbrNm(), (List) mber.getAuthorities(), JWT_ACCESSTIME); |
198 | 199 |
|
199 | 200 |
// 남은 시간이 3시간 미만으로 남았을 경우 RefreshToken 재발급 |
200 |
- if(timeDffrnc < 3) { |
|
201 |
+ if (timeDffrnc < 3) { |
|
201 | 202 |
RefreshTknVO refresh = new RefreshTknVO(); |
202 | 203 |
refresh.setMbrId(mber.getMbrId()); |
203 | 204 |
|
... | ... | @@ -207,17 +208,22 @@ |
207 | 208 |
// 신규 RefreshToken 발행 |
208 | 209 |
String newRefreshToken = jwtUtil.createJwt("refresh", mber.getMbrId(), mber.getLgnId(), mber.getMbrNm(), (List) mber.getAuthorities(), JWT_REFRESHTIME); |
209 | 210 |
refresh.setToken(newRefreshToken); |
210 |
- result += saveRefreshToken(req, res,refresh, JWT_REFRESHTIME); |
|
211 |
+ result += saveRefreshToken(req, res, refresh, JWT_REFRESHTIME); |
|
211 | 212 |
|
212 | 213 |
// 응답설정 RefreshToken |
213 |
- // res.setHeader("refresh", newRefreshToken); |
|
214 |
+ // res.setHeader("refresh", newRefreshToken); |
|
214 | 215 |
// 쿠키 방식 |
215 |
- res.addCookie(jwtUtil.createCookie("refresh",newRefreshToken, COOKIE_TIME)); |
|
216 |
+ res.addCookie(jwtUtil.createCookie("refresh", newRefreshToken, COOKIE_TIME)); |
|
216 | 217 |
} |
217 | 218 |
// 응답설정 AccessToken |
218 | 219 |
res.setHeader("Authorization", newAccessToken); |
219 | 220 |
|
220 | 221 |
return result; |
222 |
+ } catch (DataAccessException dae) { |
|
223 |
+ throw dae; |
|
224 |
+ } catch (Exception e) { |
|
225 |
+ throw e; |
|
226 |
+ } |
|
221 | 227 |
} |
222 | 228 |
/** |
223 | 229 |
* @param req - HTTP 요청 객체 |
... | ... | @@ -230,12 +236,18 @@ |
230 | 236 |
*/ |
231 | 237 |
@Override |
232 | 238 |
public int delete(HttpServletRequest req, RefreshTknVO refreshTknVO) { |
239 |
+ try { |
|
233 | 240 |
refreshTknVO.setUseIp(httpRequestUtil.getIp(req)); |
234 | 241 |
//중복로그인 비허용시 삭제 |
235 | 242 |
if (!loginPolicyService.getPolicy()) { |
236 | 243 |
redisTemplate.delete("jwt:" + refreshTknVO.getMbrId()); // 기존 JWT 삭제 |
237 | 244 |
} |
238 | 245 |
return refreshTokenDAO.deleteByRefresh(refreshTknVO); |
246 |
+ } catch (DataAccessException dae) { |
|
247 |
+ throw dae; |
|
248 |
+ } catch (Exception e) { |
|
249 |
+ throw e; |
|
250 |
+ } |
|
239 | 251 |
} |
240 | 252 |
/** |
241 | 253 |
* @param req - HTTP 요청 객체 |
--- src/main/java/com/takensoft/common/file/service/Impl/FileMngServiceImpl.java
+++ src/main/java/com/takensoft/common/file/service/Impl/FileMngServiceImpl.java
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
13 | 13 |
import org.springframework.dao.DataAccessException; |
14 | 14 |
import org.springframework.stereotype.Service; |
15 |
+import org.springframework.transaction.annotation.Transactional; |
|
15 | 16 |
import org.springframework.web.multipart.MultipartFile; |
16 | 17 |
|
17 | 18 |
import java.io.IOException; |
... | ... | @@ -53,6 +54,7 @@ |
53 | 54 |
* 파일매니저 등록 |
54 | 55 |
*/ |
55 | 56 |
@Override |
57 |
+ @Transactional(rollbackFor = Exception.class) |
|
56 | 58 |
public HashMap<String, Object> fileMngInsert(FileMngVO fileMngVO, List<MultipartFile> multipartFileList) { |
57 | 59 |
try { |
58 | 60 |
HashMap<String, Object> result = new HashMap<>(); |
... | ... | @@ -83,9 +85,7 @@ |
83 | 85 |
result.put("fileMngResult", fileMngResult); |
84 | 86 |
|
85 | 87 |
return result; |
86 |
- } catch (CustomNotFoundException | CustomFileUploadFailException | CustomInsertFailException | IllegalArgumentException le) { |
|
87 |
- throw le; |
|
88 |
- } catch (DataAccessException dae) { |
|
88 |
+ } catch (DataAccessException dae) { |
|
89 | 89 |
throw dae; |
90 | 90 |
} catch (Exception e) { |
91 | 91 |
throw e; |
... | ... | @@ -105,6 +105,7 @@ |
105 | 105 |
* 파일매니저 수정 |
106 | 106 |
*/ |
107 | 107 |
@Override |
108 |
+ @Transactional(rollbackFor = Exception.class) |
|
108 | 109 |
public int fileMngUpadate(FileMngVO fileMngVO, List<HashMap<String, Object>> deleteFileList, List<MultipartFile> multipartFileList) { |
109 | 110 |
try { |
110 | 111 |
int insertResult = 0; |
... | ... | @@ -137,9 +138,6 @@ |
137 | 138 |
} |
138 | 139 |
|
139 | 140 |
return result; |
140 |
- } catch (CustomNotFoundException | CustomFileUploadFailException | CustomInsertFailException | IllegalArgumentException |
|
141 |
- | CustomDeleteFailException le) { |
|
142 |
- throw le; |
|
143 | 141 |
} catch (DataAccessException dae) { |
144 | 142 |
throw dae; |
145 | 143 |
} catch (Exception e) { |
... | ... | @@ -157,6 +155,7 @@ |
157 | 155 |
* 파일매니저 삭제 |
158 | 156 |
*/ |
159 | 157 |
@Override |
158 |
+ @Transactional(rollbackFor = Exception.class) |
|
160 | 159 |
public int fileMngDelete(HashMap<String, Object> params) { |
161 | 160 |
try { |
162 | 161 |
int deleteResult = 0; |
... | ... | @@ -173,8 +172,6 @@ |
173 | 172 |
} |
174 | 173 |
|
175 | 174 |
return result; |
176 |
- } catch (CustomDeleteFailException le) { |
|
177 |
- throw le; |
|
178 | 175 |
} catch (DataAccessException dae) { |
179 | 176 |
throw dae; |
180 | 177 |
} catch (Exception e) { |
--- src/main/java/com/takensoft/common/file/service/Impl/FileServiceImpl.java
+++ src/main/java/com/takensoft/common/file/service/Impl/FileServiceImpl.java
... | ... | @@ -1,16 +1,12 @@ |
1 | 1 |
package com.takensoft.common.file.service.Impl; |
2 | 2 |
|
3 |
-import com.takensoft.common.exception.CustomDeleteFailException; |
|
4 |
-import com.takensoft.common.exception.CustomFileUploadFailException; |
|
5 |
-import com.takensoft.common.exception.CustomInsertFailException; |
|
6 |
-import com.takensoft.common.exception.CustomNotFoundException; |
|
3 |
+import com.takensoft.common.exception.*; |
|
7 | 4 |
import com.takensoft.common.file.dao.FileDAO; |
8 | 5 |
import com.takensoft.common.file.service.FileService; |
9 | 6 |
import com.takensoft.common.file.vo.FileVO; |
10 | 7 |
import com.takensoft.common.util.FileUtil; |
11 | 8 |
import com.takensoft.common.util.JWTUtil; |
12 | 9 |
import lombok.RequiredArgsConstructor; |
13 |
-import org.apache.tomcat.util.http.fileupload.impl.FileSizeLimitExceededException; |
|
14 | 10 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
15 | 11 |
import org.springframework.beans.factory.annotation.Value; |
16 | 12 |
import org.springframework.dao.DataAccessException; |
... | ... | @@ -202,6 +198,8 @@ |
202 | 198 |
* |
203 | 199 |
* 파일 삭제 |
204 | 200 |
*/ |
201 |
+ @Override |
|
202 |
+ @Transactional(rollbackFor = Exception.class) |
|
205 | 203 |
public int fileDelete(List<HashMap<String, Object>> fileList) { |
206 | 204 |
try { |
207 | 205 |
int result = 0; |
... | ... | @@ -308,7 +306,7 @@ |
308 | 306 |
} |
309 | 307 |
uploadFile.transferTo(saveFile); |
310 | 308 |
} catch (IOException ioe) { |
311 |
- throw new CustomFileUploadFailException("파일 업로드에 실패했습니다.", ioe); |
|
309 |
+ throw new CustomFileUploadFailException("에디터 이미지 파일 업로드에 실패했습니다.", ioe); |
|
312 | 310 |
} |
313 | 311 |
String imgPath = editPath + maskNm; // 윈도우 상대 경로 경로 |
314 | 312 |
// String imgPath = frontUrl + "/uploadFiles" + editPath + maskNm; // 리눅스 경로 |
--- src/main/resources/mybatis/mapper/mber/mber-SQL.xml
+++ src/main/resources/mybatis/mapper/mber/mber-SQL.xml
... | ... | @@ -185,6 +185,8 @@ |
185 | 185 |
<update id="updatePassword" parameterType="PasswordDTO"> |
186 | 186 |
UPDATE mbr_info |
187 | 187 |
SET pswd = #{newPswd} |
188 |
+ , mdfr = #{mdfr} |
|
189 |
+ , mdfcn_dt = NOW() |
|
188 | 190 |
WHERE mbr_id = #{mbrId} |
189 | 191 |
</update> |
190 | 192 |
|
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?