
--- src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
+++ src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
... | ... | @@ -26,20 +26,20 @@ |
26 | 26 |
public interface ContsTypeDAO { |
27 | 27 |
|
28 | 28 |
/** |
29 |
- * @param contsEngNm - 콘텐츠 영문명 |
|
29 |
+ * @param contsTypeVO - 콘텐츠 영문명 |
|
30 | 30 |
* @return boolean - 콘텐츠 영문명 중복 검사 결과 |
31 | 31 |
* |
32 | 32 |
* 콘텐츠 영문명 중복 확인 |
33 | 33 |
*/ |
34 |
- boolean findByCheckContsEngNm(String contsEngNm); |
|
34 |
+ boolean findByCheckContsEngNm(ContsTypeVO contsTypeVO); |
|
35 | 35 |
|
36 | 36 |
/** |
37 |
- * @param compnPath - 컴포넌트 URL |
|
37 |
+ * @param contsTypeVO - 컴포넌트 URL |
|
38 | 38 |
* @return boolean - 컴포넌트 URL 중복 검사 결과 |
39 | 39 |
* |
40 | 40 |
* 컴포넌트 URL 중복 확인 |
41 | 41 |
*/ |
42 |
- boolean findByCheckCompnCrs(String compnPath); |
|
42 |
+ boolean findByCheckCompnCrs(ContsTypeVO contsTypeVO); |
|
43 | 43 |
|
44 | 44 |
/** |
45 | 45 |
* @param contsTypeVO - 컨텐츠 유형 관리 객체 |
--- src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
+++ src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 |
* |
28 | 28 |
* 콘텐츠 영문명 중복 검사 |
29 | 29 |
*/ |
30 |
- boolean findByCheckContsEngNm(String contsEngNm); |
|
30 |
+ boolean findByCheckContsEngNm(ContsTypeVO contsTypeVO); |
|
31 | 31 |
|
32 | 32 |
/** |
33 | 33 |
* @param compnPath - 컴포넌트 URL |
... | ... | @@ -35,7 +35,7 @@ |
35 | 35 |
* |
36 | 36 |
* 컴포넌트 URL 중복 검사 |
37 | 37 |
*/ |
38 |
- boolean findByCheckCompnCrs(String compnPath); |
|
38 |
+ boolean findByCheckCompnCrs(ContsTypeVO contsTypeVO); |
|
39 | 39 |
|
40 | 40 |
/** |
41 | 41 |
* @param contsTypeVO - 콘텐츠 유형 VO |
--- src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
+++ src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
... | ... | @@ -54,7 +54,7 @@ |
54 | 54 |
private final VerificationService verificationService; |
55 | 55 |
|
56 | 56 |
/** |
57 |
- * @param contsEngNm - 콘텐츠 영문명 |
|
57 |
+ * @param contsTypeVO - 콘텐츠 영문명 |
|
58 | 58 |
* @return boolean - 콘텐츠 영문명 중복 여부 |
59 | 59 |
* @throws CustomDataDuplicationException - 데이터 중복 예외 발생 시 |
60 | 60 |
* @throws DataAccessException - db 관련 예외 발생 시 |
... | ... | @@ -63,9 +63,9 @@ |
63 | 63 |
* 콘텐츠 영문명 중복 검사 |
64 | 64 |
*/ |
65 | 65 |
@Override |
66 |
- public boolean findByCheckContsEngNm(String contsEngNm) { |
|
66 |
+ public boolean findByCheckContsEngNm(ContsTypeVO contsTypeVO) { |
|
67 | 67 |
try { |
68 |
- boolean result = contsTypeDAO.findByCheckContsEngNm(contsEngNm); |
|
68 |
+ boolean result = contsTypeDAO.findByCheckContsEngNm(contsTypeVO); |
|
69 | 69 |
if (result) { |
70 | 70 |
throw new CustomDataDuplicationException("이미 사용 중인 콘텐츠 영문명입니다.", "Y"); |
71 | 71 |
} |
... | ... | @@ -78,7 +78,7 @@ |
78 | 78 |
} |
79 | 79 |
|
80 | 80 |
/** |
81 |
- * @param compnPath - 컴포넌트 URL |
|
81 |
+ * @param contsTypeVO - 컴포넌트 URL |
|
82 | 82 |
* @return boolean - 컴포넌트 URL 중복 여부 |
83 | 83 |
* @throws CustomDataDuplicationException - 데이터 중복 예외 발생 시 |
84 | 84 |
* @throws DataAccessException - db 관련 예외 발생 시 |
... | ... | @@ -87,9 +87,9 @@ |
87 | 87 |
* 컴포넌트 URL 중복 검사 |
88 | 88 |
*/ |
89 | 89 |
@Override |
90 |
- public boolean findByCheckCompnCrs(String compnPath) { |
|
90 |
+ public boolean findByCheckCompnCrs(ContsTypeVO contsTypeVO) { |
|
91 | 91 |
try { |
92 |
- boolean result = contsTypeDAO.findByCheckCompnCrs(compnPath); |
|
92 |
+ boolean result = contsTypeDAO.findByCheckCompnCrs(contsTypeVO); |
|
93 | 93 |
if (result) { |
94 | 94 |
throw new CustomDataDuplicationException("이미 사용 중인 컴포넌트 URL입니다.", "Y"); |
95 | 95 |
} |
--- src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
+++ src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
... | ... | @@ -45,9 +45,9 @@ |
45 | 45 |
@PostMapping("/saveProc.json") |
46 | 46 |
public ResponseEntity<?> savePorc(@RequestBody ContsTypeVO contsTypeVO){ |
47 | 47 |
// 콘텐츠 영문명 중복 검사 |
48 |
- boolean isEngNmExist = contsTypeService.findByCheckContsEngNm(contsTypeVO.getContsEngNm()); |
|
48 |
+ boolean isEngNmExist = contsTypeService.findByCheckContsEngNm(contsTypeVO); |
|
49 | 49 |
// 컴포넌트 URL 중복 검사 |
50 |
- boolean isCompnCrsExist = contsTypeService.findByCheckCompnCrs(contsTypeVO.getCompnPath()); |
|
50 |
+ boolean isCompnCrsExist = contsTypeService.findByCheckCompnCrs(contsTypeVO); |
|
51 | 51 |
|
52 | 52 |
// 콘텐츠 유형 등록 |
53 | 53 |
HashMap<String, Object> result = contsTypeService.contsSave(contsTypeVO); |
... | ... | @@ -64,9 +64,9 @@ |
64 | 64 |
@PostMapping("/updateProc.json") |
65 | 65 |
public ResponseEntity<?> updateProc(@RequestBody ContsTypeVO contsTypeVO) { |
66 | 66 |
// 콘텐츠 영문명 중복 검사 |
67 |
- boolean isEngNmExist = contsTypeService.findByCheckContsEngNm(contsTypeVO.getContsEngNm()); |
|
67 |
+ boolean isEngNmExist = contsTypeService.findByCheckContsEngNm(contsTypeVO); |
|
68 | 68 |
// 컴포넌트 URL 중복 검사 |
69 |
- boolean isCompnCrsExist = contsTypeService.findByCheckCompnCrs(contsTypeVO.getCompnPath()); |
|
69 |
+ boolean isCompnCrsExist = contsTypeService.findByCheckCompnCrs(contsTypeVO); |
|
70 | 70 |
|
71 | 71 |
// 콘텐츠 유형 수정 처리 |
72 | 72 |
int result = contsTypeService.contsUpdate(contsTypeVO); |
--- src/main/resources/mybatis/mapper/contsType/contsType-SQL.xml
+++ src/main/resources/mybatis/mapper/contsType/contsType-SQL.xml
... | ... | @@ -32,11 +32,12 @@ |
32 | 32 |
작성일 : 2025.05.19 |
33 | 33 |
내 용 : 콘텐츠 영문명 중복 확인 |
34 | 34 |
--> |
35 |
- <select id="findByCheckContsEngNm" parameterType="String" resultType="boolean"> |
|
35 |
+ <select id="findByCheckContsEngNm" parameterType="ContsTypeVO" resultType="boolean"> |
|
36 | 36 |
SELECT COUNT(conts_eng_nm) |
37 | 37 |
FROM conts_type_mng |
38 | 38 |
WHERE LOWER(conts_eng_nm) = LOWER(#{contsEngNm}) |
39 | 39 |
AND use_yn = 'Y' |
40 |
+ AND conts_id != #{contsId} |
|
40 | 41 |
</select> |
41 | 42 |
|
42 | 43 |
<!-- |
... | ... | @@ -44,11 +45,12 @@ |
44 | 45 |
작성일 : 2025.05.19 |
45 | 46 |
내 용 : 컴포넌트 URL 중복 확인 |
46 | 47 |
--> |
47 |
- <select id="findByCheckCompnCrs" parameterType="String" resultType="boolean"> |
|
48 |
+ <select id="findByCheckCompnCrs" parameterType="ContsTypeVO" resultType="boolean"> |
|
48 | 49 |
SELECT COUNT(compn_path) |
49 | 50 |
FROM conts_type_mng |
50 | 51 |
WHERE LOWER(compn_path) = LOWER(#{compnPath}) |
51 | 52 |
AND use_yn = 'Y' |
53 |
+ AND conts_id != #{contsId} |
|
52 | 54 |
</select> |
53 | 55 |
|
54 | 56 |
<!-- |
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?