
--- src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
+++ src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
... | ... | @@ -10,65 +10,80 @@ |
10 | 10 |
|
11 | 11 |
/** |
12 | 12 |
* @author : takensoft |
13 |
- * @since : 2024.04.17 |
|
13 |
+ * @since :2024.04.17 |
|
14 |
+ * @modification |
|
15 |
+ * since | author | description |
|
16 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
17 |
+ * 2024.04.23 | 박정하 | findAllCnt 추가 |
|
18 |
+ * 2024.04.29 | 박정하 | findAllByExpsr 추가 |
|
19 |
+ * 2024.05.02 | takensoft | findByContsAuthrt 추가 |
|
20 |
+ * 2025.03.13 | 방선주 | 코드 리펙토링 |
|
14 | 21 |
* |
15 |
- * 콘텐츠 유형 관리 관련 Mapper |
|
22 |
+ * 콘텐츠 유형 관리 관련 DAO |
|
16 | 23 |
*/ |
17 | 24 |
@Mapper("contsTypeDAO") |
18 | 25 |
public interface ContsTypeDAO { |
19 | 26 |
|
20 | 27 |
/** |
21 |
- * @author takensoft |
|
22 |
- * @since 2024.04.17 |
|
28 |
+ * @param contsTypeVO - 컨텐츠 유형 관리 객체 |
|
29 |
+ * @return int - 등록 성공 여부 |
|
30 |
+ * |
|
23 | 31 |
* 콘텐츠 유형 등록 |
24 | 32 |
*/ |
25 | 33 |
int save(ContsTypeVO contsTypeVO); |
26 | 34 |
|
27 | 35 |
/** |
28 |
- * @author takensoft |
|
29 |
- * @since 2024.04.17 |
|
36 |
+ * @param contsTypeVO - 컨텐츠 유형 관리 객체 |
|
37 |
+ * @return int - 등록 수정 여부 |
|
38 |
+ * |
|
30 | 39 |
* 콘텐츠 유형 수정 |
31 | 40 |
*/ |
32 | 41 |
int update(ContsTypeVO contsTypeVO); |
33 | 42 |
|
34 | 43 |
/** |
35 |
- * @author takensoft |
|
36 |
- * @since 2024.04.17 |
|
44 |
+ * @param pagination - pagination 객체 |
|
45 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 |
|
46 |
+ * |
|
37 | 47 |
* 콘텐츠 유형 목록 조회 |
38 | 48 |
*/ |
39 | 49 |
List<ContsTypeVO> findAll(Pagination pagination); |
40 | 50 |
|
41 | 51 |
/** |
42 |
- * @author takensoft |
|
43 |
- * @since 2024.04.17 |
|
52 |
+ * @param contsTypeVO - 컨텐츠 유형 관리 객체 |
|
53 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 |
|
54 |
+ * |
|
44 | 55 |
* 콘텐츠 유형 목록 조회(노출인 목록만) |
45 | 56 |
*/ |
46 | 57 |
List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO); |
47 | 58 |
|
48 | 59 |
/** |
49 |
- * @author takensoft |
|
50 |
- * @since 2024.04.17 |
|
60 |
+ * @param contsId - 콘텐츠 ID |
|
61 |
+ * @return ContsTypeVO - 콘텐츠 유형 상세 조회 |
|
62 |
+ * |
|
51 | 63 |
* 콘텐츠 유형 상세 조회 |
52 | 64 |
*/ |
53 | 65 |
ContsTypeVO findByContsType(String contsId); |
54 | 66 |
|
55 | 67 |
/** |
56 |
- * @author 박정하 |
|
57 |
- * @since 2024.04.23 |
|
58 |
- * 콘텐츠 유형 목록 갯수(관리자 페이지용) |
|
68 |
+ * @param pagination - pagination 객체 |
|
69 |
+ * @return int - 등록 유형 목록 개수 |
|
70 |
+ * |
|
71 |
+ * 콘텐츠 유형 목록 개수(관리자 페이지용) |
|
59 | 72 |
*/ |
60 | 73 |
int findAllCnt(Pagination pagination); |
61 | 74 |
|
62 | 75 |
/** |
63 |
- * @author 박정하 |
|
64 |
- * @since 2024.04.29 |
|
76 |
+ * @param contsTypeVO - 컨텐츠 유형 관리 객체 |
|
77 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 |
|
78 |
+ * |
|
65 | 79 |
* 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
66 | 80 |
*/ |
67 | 81 |
List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO); |
68 | 82 |
|
69 | 83 |
/** |
70 |
- * @author takensoft |
|
71 |
- * @since 2024.05.02 |
|
84 |
+ * @param |
|
85 |
+ * @return List<ContsAuthrtVO> - 콘텐츠 권한 포함 조회 목록 |
|
86 |
+ * |
|
72 | 87 |
* 콘텐츠 조회(권한 포함) |
73 | 88 |
*/ |
74 | 89 |
List<ContsAuthrtVO> findByContsAuthrt(); |
--- src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
+++ src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
... | ... | @@ -6,61 +6,74 @@ |
6 | 6 |
import java.util.HashMap; |
7 | 7 |
import java.util.List; |
8 | 8 |
import java.util.Map; |
9 |
- |
|
10 | 9 |
/** |
11 |
- * @author : takensoft |
|
12 |
- * @since : 2024.04.17 |
|
10 |
+ * @author takensoft |
|
11 |
+ * @since 2024.04.17 |
|
12 |
+ * @modification |
|
13 |
+ * since | author | description |
|
14 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
15 |
+ * 2024.04.29 | 박정하 | findAllByExpsr 추가 |
|
16 |
+ * 2024.05.10 | takensoft | findByContsAuthrt 추가 |
|
17 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
13 | 18 |
* |
14 | 19 |
* 콘텐츠 유형 관리 관련 인터페이스 |
15 | 20 |
*/ |
16 | 21 |
public interface ContsTypeService { |
17 | 22 |
|
18 | 23 |
/** |
19 |
- * @author takensoft |
|
20 |
- * @since 2024.04.17 |
|
24 |
+ * @param contsTypeVO - 콘텐츠 유형 VO |
|
25 |
+ * @return HashMap<String, Object> - 콘텐츠 유형 등록 결과 |
|
26 |
+ * |
|
21 | 27 |
* 콘텐츠 유형 등록 |
22 | 28 |
*/ |
23 |
- public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO) throws Exception; |
|
29 |
+ HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO); |
|
24 | 30 |
|
25 | 31 |
/** |
26 |
- * @author takensoft |
|
27 |
- * @since 2024.04.17 |
|
32 |
+ * @param contsTypeVO - 콘텐츠 유형 VO |
|
33 |
+ * @return int - 콘텐츠 유형 수정 결과 |
|
34 |
+ * |
|
28 | 35 |
* 콘텐츠 유형 수정 |
29 | 36 |
*/ |
30 |
- public int contsUpdate(ContsTypeVO contsTypeVO) throws Exception; |
|
37 |
+ int contsUpdate(ContsTypeVO contsTypeVO); |
|
31 | 38 |
|
32 | 39 |
/** |
33 |
- * @author takensoft |
|
34 |
- * @since 2024.04.17 |
|
40 |
+ * @param params - pagination 객체 |
|
41 |
+ * @return int - Map<String, Object> - 콘텐츠 유형 목록 조회 결과 |
|
42 |
+ * |
|
35 | 43 |
* 콘텐츠 유형 목록 조회 |
36 | 44 |
*/ |
37 |
- public Map<String, Object> findAll(Map<String, String> params) throws Exception; |
|
45 |
+ Map<String, Object> findAll(Map<String, String> params); |
|
38 | 46 |
|
39 | 47 |
/** |
40 |
- * @author takensoft |
|
41 |
- * @since 2024.04.17 |
|
48 |
+ * @param contsTypeVO - 콘텐츠 유형 VO |
|
49 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 |
|
50 |
+ * |
|
42 | 51 |
* 콘텐츠 유형 목록 조회(노출인 목록만) |
43 | 52 |
*/ |
44 |
- public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception; |
|
53 |
+ List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO); |
|
45 | 54 |
|
46 | 55 |
/** |
47 |
- * @author takensoft |
|
48 |
- * @since 2024.04.17 |
|
56 |
+ * @param contsId - 콘텐츠 ID |
|
57 |
+ * @return ContsTypeVO - 콘텐츠 유형 상세 조회 결과 |
|
58 |
+ * |
|
49 | 59 |
* 콘텐츠 유형 상세 조회 |
50 | 60 |
*/ |
51 |
- public ContsTypeVO findByContsType(String contsId) throws Exception; |
|
61 |
+ ContsTypeVO findByContsType(String contsId); |
|
52 | 62 |
|
53 | 63 |
/** |
54 |
- * @author 박정하 |
|
55 |
- * @since 2024.04.29 |
|
64 |
+ * @param contsTypeVO - 콘텐츠 유형 VO |
|
65 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 |
|
66 |
+ * |
|
56 | 67 |
* 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
57 | 68 |
*/ |
58 |
- public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO) throws Exception; |
|
69 |
+ List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO); |
|
70 |
+ |
|
59 | 71 |
|
60 | 72 |
/** |
61 |
- * @author takensoft |
|
62 |
- * @since 2024.05.02 |
|
63 |
- * 콘텐츠 조회(권한 포함) |
|
73 |
+ * @param |
|
74 |
+ * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 |
|
75 |
+ * |
|
76 |
+ * 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
|
64 | 77 |
*/ |
65 |
- public List<ContsAuthrtVO> findByContsAuthrt() throws Exception; |
|
78 |
+ List<ContsAuthrtVO> findByContsAuthrt(); |
|
66 | 79 |
} |
--- src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
+++ src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
... | ... | @@ -10,12 +10,15 @@ |
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.CustomUpdateFailException; |
|
13 | 15 |
import com.takensoft.common.idgen.service.IdgenService; |
14 | 16 |
import com.takensoft.common.util.JWTUtil; |
15 | 17 |
import lombok.RequiredArgsConstructor; |
16 | 18 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
17 | 19 |
import org.springframework.cache.annotation.CacheEvict; |
18 | 20 |
import org.springframework.cache.annotation.Cacheable; |
21 |
+import org.springframework.dao.DataAccessException; |
|
19 | 22 |
import org.springframework.stereotype.Service; |
20 | 23 |
import org.springframework.transaction.annotation.Transactional; |
21 | 24 |
|
... | ... | @@ -24,15 +27,24 @@ |
24 | 27 |
|
25 | 28 |
/** |
26 | 29 |
* @author : takensoft |
27 |
- * @since : 2024.04.17 |
|
30 |
+ * @since :2024.04.17 |
|
31 |
+ * @modification |
|
32 |
+ * since | author | description |
|
33 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
34 |
+ * 2024.04.29 | 박정하 | findAllByExpsr 추가 |
|
35 |
+ * 2024.05.02 | takensoft | findByContsAuthrt 추가 |
|
36 |
+ * 2024.05.08 | takensoft | groupAndShareAuth, findMostComprehensiveAuth 추가 |
|
37 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
38 |
+ * |
|
39 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
40 |
+ * ContsTypeService - 콘텐츠 유형 관리 관련 인터페이스 상속 |
|
28 | 41 |
* |
29 | 42 |
* 콘텐츠 유형 관리 관련 구현체 |
30 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
31 |
- * ContsTypeService : 콘텐츠 유형 관리 관련 인터페이스 상속 |
|
32 | 43 |
*/ |
33 | 44 |
@Service("contsTypeService") |
34 | 45 |
@RequiredArgsConstructor |
35 | 46 |
public class ContsTypeServiceImpl extends EgovAbstractServiceImpl implements ContsTypeService { |
47 |
+ |
|
36 | 48 |
private final ContsTypeDAO contsTypeDAO; |
37 | 49 |
private final BbsRouterDAO bbsRouterDAO; |
38 | 50 |
private final IdgenService contsTypeIdgn; |
... | ... | @@ -41,192 +53,296 @@ |
41 | 53 |
private final MenuDAO menuDAO; |
42 | 54 |
|
43 | 55 |
/** |
44 |
- * @author takensoft |
|
45 |
- * @since 2024.04.17 |
|
56 |
+ * @param contsTypeVO - 콘텐츠 유형 객체 |
|
57 |
+ * @return HashMap<String, Object> - 콘텐츠 유형 등록 결과값 |
|
58 |
+ * @throws CustomInsertFailException - 콘텐츠 유형 등록 실패 시 |
|
59 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
60 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
61 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
62 |
+ * |
|
46 | 63 |
* 콘텐츠 유형 등록 |
47 | 64 |
*/ |
48 | 65 |
@Override |
49 | 66 |
@Transactional(rollbackFor = Exception.class) |
50 | 67 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
51 |
- public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO) throws Exception { |
|
52 |
- HashMap<String, Object> result = new HashMap<>(); |
|
68 |
+ public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO){ |
|
69 |
+ try { |
|
70 |
+ HashMap<String, Object> result = new HashMap<>(); |
|
53 | 71 |
|
54 |
- // 콘텐츠 유형 아이디 생성 |
|
55 |
- String contsId = contsTypeIdgn.getNextStringId(); |
|
56 |
- contsTypeVO.setContsId(contsId); |
|
72 |
+ // 콘텐츠 유형 아이디 생성 |
|
73 |
+ String contsId = contsTypeIdgn.getNextStringId(); |
|
74 |
+ contsTypeVO.setContsId(contsId); |
|
57 | 75 |
|
58 |
- // 등록된 토큰에서 사용자 정보 조회 |
|
59 |
- contsTypeVO.setRgtr(jwtUtil.getWriter()); |
|
76 |
+ // 등록된 토큰에서 사용자 정보 조회 |
|
77 |
+ contsTypeVO.setRgtr(jwtUtil.getWriter()); |
|
60 | 78 |
|
61 |
- // 콘텐츠 유형 등록 |
|
62 |
- int insertResult = contsTypeDAO.save(contsTypeVO); |
|
79 |
+ // 콘텐츠 유형 등록 결과 |
|
80 |
+ int insertResult = contsTypeDAO.save(contsTypeVO); |
|
81 |
+ if (insertResult == 0) { |
|
82 |
+ throw new CustomInsertFailException("콘텐츠 유형 등록에 실패했습니다."); |
|
83 |
+ } |
|
63 | 84 |
|
64 |
- // 메뉴 등록 |
|
65 |
- if (contsTypeVO.getExpsrYn().equals("Y")) { |
|
66 |
- MenuVO menuVO = new MenuVO(); |
|
67 |
- menuVO.setUpMenuId("MENU_000000000000018"); // 상위메뉴아이디(콘텐츠 관리 메뉴 아이디) |
|
68 |
- menuVO.setMenuNm(contsTypeVO.getContsKornNm()); // 메뉴명 |
|
69 |
- menuVO.setMenuType("conts"); // 메뉴타입 |
|
70 |
- menuVO.setMenuTypeCtgry(contsId); // 메뉴타입항목(콘텐츠 유형 아이디) |
|
71 |
- menuVO.setLinkType("0"); // 링크유형(현재창) |
|
72 |
- menuVO.setDgstfnExmnUseYn("N"); // 만족도조사사용여부(미노출) |
|
73 |
- menuVO.setMenuExpsrYn("Y"); // 메뉴노출여부(노출) |
|
74 |
- menuVO.setMenuUser("A"); // 메뉴사용자(관리자) |
|
75 |
- menuVO.setSysPvsnYn("0"); // 시스템제공여부(시스템등록) |
|
76 |
- menuService.menuSave(menuVO); |
|
85 |
+ // 메뉴 등록 |
|
86 |
+ if (contsTypeVO.getExpsrYn().equals("Y")) { |
|
87 |
+ MenuVO menuVO = new MenuVO(); |
|
88 |
+ menuVO.setUpMenuId("MENU_000000000000018"); // 상위메뉴아이디(콘텐츠 관리 메뉴 아이디) |
|
89 |
+ menuVO.setMenuNm(contsTypeVO.getContsKornNm()); // 메뉴명 |
|
90 |
+ menuVO.setMenuType("conts"); // 메뉴타입 |
|
91 |
+ menuVO.setMenuTypeCtgry(contsId); // 메뉴타입항목(콘텐츠 유형 아이디) |
|
92 |
+ menuVO.setLinkType("0"); // 링크유형(현재창) |
|
93 |
+ menuVO.setDgstfnExmnUseYn("N"); // 만족도조사사용여부(미노출) |
|
94 |
+ menuVO.setMenuExpsrYn("Y"); // 메뉴노출여부(노출) |
|
95 |
+ menuVO.setMenuUser("A"); // 메뉴사용자(관리자) |
|
96 |
+ menuVO.setSysPvsnYn("0"); // 시스템제공여부(시스템등록) |
|
97 |
+ int insertMenu = menuService.menuSave(menuVO); |
|
98 |
+ if (insertMenu == 0) { |
|
99 |
+ throw new CustomInsertFailException("메뉴 등록에 실패했습니다."); |
|
100 |
+ } |
|
101 |
+ } |
|
102 |
+ |
|
103 |
+ result.put("contsId", contsId); |
|
104 |
+ result.put("result", insertResult); |
|
105 |
+ return result; |
|
106 |
+ } catch (CustomInsertFailException cife) { |
|
107 |
+ throw cife; |
|
108 |
+ } catch (DataAccessException dae) { |
|
109 |
+ throw dae; |
|
110 |
+ } catch (NullPointerException npe) { |
|
111 |
+ throw npe; |
|
112 |
+ } catch (Exception e) { |
|
113 |
+ throw e; |
|
77 | 114 |
} |
78 |
- |
|
79 |
- result.put("contsId", contsId); |
|
80 |
- result.put("result", insertResult); |
|
81 |
- return result; |
|
82 | 115 |
} |
83 | 116 |
|
84 | 117 |
/** |
85 |
- * @author takensoft |
|
86 |
- * @since 2024.04.17 |
|
118 |
+ * @param contsTypeVO - 콘텐츠 유형 객체 |
|
119 |
+ * @return int - 콘텐츠 유형 수정 결과값 |
|
120 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
121 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
122 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
123 |
+ * |
|
87 | 124 |
* 콘텐츠 유형 수정 |
88 | 125 |
*/ |
89 | 126 |
@Override |
90 | 127 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
91 |
- public int contsUpdate(ContsTypeVO contsTypeVO) throws Exception { |
|
92 |
- int result = 0; |
|
93 |
- // 등록된 토큰에서 사용자 정보 조회 |
|
94 |
- contsTypeVO.setMdfr(jwtUtil.getWriter()); |
|
95 |
- result += contsTypeDAO.update(contsTypeVO); |
|
128 |
+ @Transactional |
|
129 |
+ public int contsUpdate(ContsTypeVO contsTypeVO){ |
|
130 |
+ try { |
|
131 |
+ // 콘텐츠 유형 수정 결과 |
|
132 |
+ int result = 0; |
|
133 |
+ // 등록된 토큰에서 사용자 정보 조회 |
|
134 |
+ contsTypeVO.setMdfr(jwtUtil.getWriter()); |
|
96 | 135 |
|
97 |
- // 메뉴 수정 |
|
98 |
- menuDAO.updateByContsId(contsTypeVO); |
|
99 |
- return result; |
|
136 |
+ result = contsTypeDAO.update(contsTypeVO); |
|
137 |
+ if (result == 0) { |
|
138 |
+ throw new CustomUpdateFailException("콘텐츠 유형 수정에 실패했습니다."); |
|
139 |
+ } |
|
140 |
+ // 메뉴 수정 |
|
141 |
+ int updateMenu = menuDAO.updateByContsId(contsTypeVO); |
|
142 |
+ if (updateMenu == 0) { |
|
143 |
+ throw new CustomUpdateFailException("메뉴 수정에 실패했습니다."); |
|
144 |
+ } |
|
145 |
+ return result; |
|
146 |
+ } catch (DataAccessException dae) { |
|
147 |
+ throw dae; |
|
148 |
+ } catch (NullPointerException npe) { |
|
149 |
+ throw npe; |
|
150 |
+ } catch (Exception e) { |
|
151 |
+ throw e; |
|
152 |
+ } |
|
100 | 153 |
} |
101 | 154 |
|
102 | 155 |
/** |
103 |
- * @author takensoft |
|
104 |
- * @since 2024.04.17 |
|
156 |
+ * @param params - pagination 객체 |
|
157 |
+ * @return Map<String, Object> - 콘텐츠 유형 목록 조회 결과값 |
|
158 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
159 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
160 |
+ * |
|
105 | 161 |
* 콘텐츠 유형 목록 조회 |
106 | 162 |
*/ |
107 | 163 |
@Override |
108 |
- public Map<String, Object> findAll(Map<String, String> params) throws Exception { |
|
109 |
- Map<String, Object> result = new HashMap<>(); |
|
110 |
- Pagination search = new Pagination(0, params); |
|
111 |
- int cnt = contsTypeDAO.findAllCnt(search); |
|
112 |
- Pagination pagination = new Pagination(cnt, params); |
|
113 |
- List<ContsTypeVO> list = contsTypeDAO.findAll(pagination); |
|
164 |
+ public Map<String, Object> findAll(Map<String, String> params){ |
|
165 |
+ try { |
|
166 |
+ Map<String, Object> result = new HashMap<>(); |
|
167 |
+ Pagination search = new Pagination(0, params); |
|
168 |
+ int cnt = contsTypeDAO.findAllCnt(search); |
|
169 |
+ Pagination pagination = new Pagination(cnt, params); |
|
170 |
+ List<ContsTypeVO> list = contsTypeDAO.findAll(pagination); |
|
114 | 171 |
|
115 |
- result.put("list", list); |
|
116 |
- result.put("pagination", pagination); |
|
117 |
- return result; |
|
172 |
+ result.put("list", list); |
|
173 |
+ result.put("pagination", pagination); |
|
174 |
+ return result; |
|
175 |
+ } catch (DataAccessException dae) { |
|
176 |
+ throw dae; |
|
177 |
+ } catch (Exception e) { |
|
178 |
+ throw e; |
|
179 |
+ } |
|
118 | 180 |
} |
119 | 181 |
|
120 | 182 |
/** |
121 |
- * @author takensoft |
|
122 |
- * @since 2024.04.17 |
|
183 |
+ * @param contsTypeVO - 콘텐츠 유형 객체 |
|
184 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 조회 결과값 |
|
185 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
186 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
187 |
+ * |
|
123 | 188 |
* 콘텐츠 유형 목록 조회(노출인 목록만) |
124 | 189 |
*/ |
125 | 190 |
@Override |
126 |
- public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception { |
|
127 |
- return contsTypeDAO.findByContsTypeSys(contsTypeVO); |
|
191 |
+ public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO){ |
|
192 |
+ try { |
|
193 |
+ return contsTypeDAO.findByContsTypeSys(contsTypeVO); |
|
194 |
+ } catch (DataAccessException dae) { |
|
195 |
+ throw dae; |
|
196 |
+ } catch (Exception e) { |
|
197 |
+ throw e; |
|
198 |
+ } |
|
128 | 199 |
} |
129 | 200 |
|
130 | 201 |
/** |
131 |
- * @author takensoft |
|
132 |
- * @since 2024.04.17 |
|
202 |
+ * @param contsId - 콘텐츠 유형 아이디 |
|
203 |
+ * @return ContsTypeVO - 콘텐츠 유형 객체 |
|
204 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
205 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
206 |
+ * |
|
133 | 207 |
* 콘텐츠 유형 상세 조회 |
134 | 208 |
*/ |
135 | 209 |
@Override |
136 |
- public ContsTypeVO findByContsType(String contsId) throws Exception { |
|
137 |
- ContsTypeVO contsTypeVO = new ContsTypeVO(); |
|
210 |
+ public ContsTypeVO findByContsType(String contsId){ |
|
211 |
+ try { |
|
212 |
+ ContsTypeVO contsTypeVO = new ContsTypeVO(); |
|
138 | 213 |
|
139 |
- if (contsId != null) { |
|
140 |
- contsTypeVO = contsTypeDAO.findByContsType(contsId); |
|
141 |
- } |
|
214 |
+ if (contsId != null) { |
|
215 |
+ contsTypeVO = contsTypeDAO.findByContsType(contsId); |
|
216 |
+ } |
|
142 | 217 |
|
143 |
- // 메뉴노출 기본값 |
|
144 |
- if (contsTypeVO.getExpsrYn() == null) { |
|
145 |
- contsTypeVO.setExpsrYn("N"); |
|
146 |
- } |
|
147 |
- // 사용여부 기본값 |
|
148 |
- if (contsTypeVO.getUseYn() == null) { |
|
149 |
- contsTypeVO.setUseYn("Y"); |
|
150 |
- } |
|
218 |
+ // 메뉴노출 기본값 |
|
219 |
+ if (contsTypeVO.getExpsrYn() == null) { |
|
220 |
+ contsTypeVO.setExpsrYn("N"); |
|
221 |
+ } |
|
222 |
+ // 사용여부 기본값 |
|
223 |
+ if (contsTypeVO.getUseYn() == null) { |
|
224 |
+ contsTypeVO.setUseYn("Y"); |
|
225 |
+ } |
|
151 | 226 |
|
152 |
- return contsTypeVO; |
|
227 |
+ return contsTypeVO; |
|
228 |
+ } catch (DataAccessException dae) { |
|
229 |
+ throw dae; |
|
230 |
+ } catch (Exception e) { |
|
231 |
+ throw e; |
|
232 |
+ } |
|
153 | 233 |
} |
154 | 234 |
|
155 | 235 |
/** |
156 |
- * @author 박정하 |
|
157 |
- * @since 2024.04.29 |
|
236 |
+ * @param contsTypeVO - 콘텐츠 유형 객체 |
|
237 |
+ * @return List<ContsTypeVO> - 콘텐츠 유형 목록 조회 결과값 |
|
238 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
239 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
240 |
+ * |
|
158 | 241 |
* 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
159 | 242 |
*/ |
160 | 243 |
@Override |
161 |
- public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO) throws Exception { |
|
162 |
- return contsTypeDAO.findAllByExpsr(contsTypeVO); |
|
244 |
+ public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO){ |
|
245 |
+ try { |
|
246 |
+ return contsTypeDAO.findAllByExpsr(contsTypeVO); |
|
247 |
+ } catch (DataAccessException dae) { |
|
248 |
+ throw dae; |
|
249 |
+ } catch (Exception e) { |
|
250 |
+ throw e; |
|
251 |
+ } |
|
163 | 252 |
} |
164 | 253 |
|
165 | 254 |
/** |
166 |
- * @author takensoft |
|
167 |
- * @since 2024.05.02 |
|
168 |
- * 콘텐츠 조회(권한 포함) |
|
255 |
+ * @param |
|
256 |
+ * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 조회 결과값 |
|
257 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
258 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
259 |
+ * |
|
260 |
+ * 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
|
169 | 261 |
*/ |
170 | 262 |
@Override |
171 | 263 |
@Cacheable(value = "routerAuthInfo", key = "'routerAuth'") |
172 |
- public List<ContsAuthrtVO> findByContsAuthrt() throws Exception { |
|
173 |
- // 콘텐츠(라우터)정보 조회 |
|
174 |
- List<ContsAuthrtVO> list = contsTypeDAO.findByContsAuthrt(); |
|
175 |
- // 권한 공유 |
|
176 |
- List<ContsAuthrtVO> result = groupAndShareAuth(list); |
|
264 |
+ public List<ContsAuthrtVO> findByContsAuthrt(){ |
|
265 |
+ try { |
|
266 |
+ // 콘텐츠(라우터)정보 조회 |
|
267 |
+ List<ContsAuthrtVO> list = contsTypeDAO.findByContsAuthrt(); |
|
268 |
+ // 권한 공유 |
|
269 |
+ List<ContsAuthrtVO> result = groupAndShareAuth(list); |
|
177 | 270 |
|
178 |
- // 게시판 라우터 정보 조회 |
|
179 |
- List<ContsAuthrtVO> bbsList = bbsRouterDAO.findByBbsRouterAuthrt(); |
|
180 |
- result.addAll(bbsList); |
|
271 |
+ // 게시판 라우터 정보 조회 |
|
272 |
+ List<ContsAuthrtVO> bbsList = bbsRouterDAO.findByBbsRouterAuthrt(); |
|
273 |
+ result.addAll(bbsList); |
|
181 | 274 |
|
182 |
- return result; |
|
275 |
+ return result; |
|
276 |
+ } catch (DataAccessException dae) { |
|
277 |
+ throw dae; |
|
278 |
+ } catch (Exception e) { |
|
279 |
+ throw e; |
|
280 |
+ } |
|
183 | 281 |
} |
184 | 282 |
|
185 | 283 |
/** |
186 |
- * @author toakensoft |
|
187 |
- * @since 2024.05.08 |
|
284 |
+ * @param routes - 라우터 정보 목록 |
|
285 |
+ * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 조회 결과값 |
|
286 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
287 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
288 |
+ * |
|
188 | 289 |
* 라우터의 특정경로로 그룹화하여 각 그룹 내에서 권한을 공유 |
189 | 290 |
*/ |
190 | 291 |
private List<ContsAuthrtVO> groupAndShareAuth(List<ContsAuthrtVO> routes) { |
191 |
- // 경로의 특정 기준점으로 라우터를 그룹화 |
|
192 |
- Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream() |
|
193 |
- .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출 |
|
292 |
+ try { |
|
293 |
+ // 경로의 특정 기준점으로 라우터를 그룹화 |
|
294 |
+ Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream() |
|
295 |
+ .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출 |
|
194 | 296 |
|
195 |
- /* key */ |
|
297 |
+ /* key */ |
|
196 | 298 |
// Iterator<String> keys = groupedRoutes.keySet().iterator(); |
197 | 299 |
// while(keys.hasNext()) { |
198 | 300 |
// String key = keys.next(); |
199 | 301 |
// System.out.println("key : " + key); |
200 | 302 |
// } |
201 |
- /* key */ |
|
303 |
+ /* key */ |
|
202 | 304 |
|
203 |
- // 그룹화된 각 경로에 대해 권한 정보 공유 |
|
204 |
- groupedRoutes.forEach((basePath, routeGroup) -> { |
|
205 |
- List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회 |
|
206 |
- // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정 |
|
207 |
- routeGroup.forEach(route -> { |
|
208 |
- if(route.getAuthrtList().isEmpty()) { |
|
209 |
- route.setAuthrtList(sharedAuth); |
|
210 |
- } |
|
305 |
+ // 그룹화된 각 경로에 대해 권한 정보 공유 |
|
306 |
+ groupedRoutes.forEach((basePath, routeGroup) -> { |
|
307 |
+ List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회 |
|
308 |
+ // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정 |
|
309 |
+ routeGroup.forEach(route -> { |
|
310 |
+ if (route.getAuthrtList().isEmpty()) { |
|
311 |
+ route.setAuthrtList(sharedAuth); |
|
312 |
+ } |
|
313 |
+ }); |
|
211 | 314 |
}); |
212 |
- }); |
|
213 |
- // 각 그룹의 라우터들을 리스트로 반환 |
|
214 |
- return groupedRoutes.values().stream() |
|
215 |
- .flatMap(List::stream) |
|
216 |
- .collect(Collectors.toList()); |
|
315 |
+ // 각 그룹의 라우터들을 리스트로 반환 |
|
316 |
+ return groupedRoutes.values().stream() |
|
317 |
+ .flatMap(List::stream) |
|
318 |
+ .collect(Collectors.toList()); |
|
319 |
+ } catch (DataAccessException dae) { |
|
320 |
+ throw dae; |
|
321 |
+ } catch (Exception e) { |
|
322 |
+ throw e; |
|
323 |
+ } |
|
217 | 324 |
} |
218 | 325 |
|
219 | 326 |
/** |
220 |
- * @author toakensoft |
|
221 |
- * @since 2024.05.08 |
|
222 |
- * 그룹 내에서 가장 완전한 권한 정보를 가진 라우터를 찾아 해당 권한 리트스 반환 |
|
327 |
+ * @param routeGroup - 콘텐츠 유형과 권한 정보 목록 |
|
328 |
+ * @return List<MenuAuthorVO> - 권한 정보가 있는 첫 번째 라우터의 권한 정보 목록 |
|
329 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
330 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
331 |
+ * |
|
332 |
+ * 그룹 내에서 가장 완전한 권한 정보를 가진 라우터를 찾아 해당 권한 리스트 반환 |
|
223 | 333 |
*/ |
224 | 334 |
private List<MenuAuthorVO> findMostComprehensiveAuth(List<ContsAuthrtVO> routeGroup) { |
225 | 335 |
// 권한정보가 있는 첫 번째 라우터를 찾아 권한 정보 반환 |
226 |
- return routeGroup.stream() |
|
227 |
- .filter(route -> !route.getAuthrtList().isEmpty()) |
|
228 |
- .findFirst() |
|
229 |
- .map(ContsAuthrtVO::getAuthrtList) |
|
230 |
- .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환 |
|
336 |
+ try { |
|
337 |
+ return routeGroup.stream() |
|
338 |
+ .filter(route -> !route.getAuthrtList().isEmpty()) |
|
339 |
+ .findFirst() |
|
340 |
+ .map(ContsAuthrtVO::getAuthrtList) |
|
341 |
+ .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환 |
|
342 |
+ } catch (DataAccessException dae) { |
|
343 |
+ throw dae; |
|
344 |
+ } catch (Exception e) { |
|
345 |
+ throw e; |
|
346 |
+ } |
|
231 | 347 |
} |
232 | 348 |
} |
--- src/main/java/com/takensoft/cms/contsType/vo/ContsAuthrtVO.java
+++ src/main/java/com/takensoft/cms/contsType/vo/ContsAuthrtVO.java
... | ... | @@ -13,6 +13,10 @@ |
13 | 13 |
/** |
14 | 14 |
* @author : takensoft |
15 | 15 |
* @since : 2024.04.17 |
16 |
+ * @modification |
|
17 |
+ * since | author | description |
|
18 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
19 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
16 | 20 |
* |
17 | 21 |
* 콘텐츠 유형과 권한 정보 관련 VO |
18 | 22 |
*/ |
... | ... | @@ -21,32 +25,11 @@ |
21 | 25 |
@NoArgsConstructor |
22 | 26 |
@AllArgsConstructor |
23 | 27 |
public class ContsAuthrtVO { |
24 |
- /** |
|
25 |
- * 콘텐츠 아이디 |
|
26 |
- */ |
|
27 |
- private String contsId; |
|
28 |
- /** |
|
29 |
- * 메뉴 아이디 |
|
30 |
- */ |
|
31 |
- private String menuId; |
|
32 |
- /** |
|
33 |
- * 콘텐츠 한글명 |
|
34 |
- */ |
|
35 |
- private String contsKornNm; |
|
36 |
- /** |
|
37 |
- * 콘텐츠 영문명 |
|
38 |
- */ |
|
39 |
- private String contsEngNm; |
|
40 |
- /** |
|
41 |
- * 페이지 경로 |
|
42 |
- */ |
|
43 |
- private String pageCrs; |
|
44 |
- /** |
|
45 |
- * 컴포넌트 경로 |
|
46 |
- */ |
|
47 |
- private String compnCrs; |
|
48 |
- /** |
|
49 |
- * 권한 목록 |
|
50 |
- */ |
|
51 |
- private List<MenuAuthorVO> authrtList = new ArrayList<MenuAuthorVO>(); |
|
28 |
+ private String contsId; // 콘텐츠 아이디 |
|
29 |
+ private String menuId; // 메뉴 아이디 |
|
30 |
+ private String contsKornNm; // 콘텐츠 한글명 |
|
31 |
+ private String contsEngNm; // 콘텐츠 영문명 |
|
32 |
+ private String pageCrs; // 페이지 경로 |
|
33 |
+ private String compnCrs; // 컴포넌트 경로 |
|
34 |
+ private List<MenuAuthorVO> authrtList = new ArrayList<MenuAuthorVO>(); // 권한 목록 |
|
52 | 35 |
} |
--- src/main/java/com/takensoft/cms/contsType/vo/ContsTypeVO.java
+++ src/main/java/com/takensoft/cms/contsType/vo/ContsTypeVO.java
... | ... | @@ -8,6 +8,10 @@ |
8 | 8 |
/** |
9 | 9 |
* @author : takensoft |
10 | 10 |
* @since : 2024.04.17 |
11 |
+ * @modification |
|
12 |
+ * since | author | description |
|
13 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
14 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
11 | 15 |
* |
12 | 16 |
* 콘텐츠 유형 관리 관련 VO |
13 | 17 |
*/ |
... | ... | @@ -16,56 +20,17 @@ |
16 | 20 |
@NoArgsConstructor |
17 | 21 |
@AllArgsConstructor |
18 | 22 |
public class ContsTypeVO { |
19 |
- /** |
|
20 |
- * 콘텐츠 아이디 |
|
21 |
- */ |
|
22 |
- private String contsId; |
|
23 |
- /** |
|
24 |
- * 콘텐츠 한글명 |
|
25 |
- */ |
|
26 |
- private String contsKornNm; |
|
27 |
- /** |
|
28 |
- * 콘텐츠 영문명 |
|
29 |
- */ |
|
30 |
- private String contsEngNm; |
|
31 |
- /** |
|
32 |
- * 사용자 페이지 경로 |
|
33 |
- */ |
|
34 |
- private String pageCrs; |
|
35 |
- /** |
|
36 |
- * 관리자 페이지 경로 |
|
37 |
- */ |
|
38 |
- private String mngrPageCrs; |
|
39 |
- /** |
|
40 |
- * 컴포넌트 경로 |
|
41 |
- */ |
|
42 |
- private String compnCrs; |
|
43 |
- /** |
|
44 |
- * 노출여부 |
|
45 |
- */ |
|
46 |
- private String expsrYn; |
|
47 |
- /** |
|
48 |
- * 사용여부 |
|
49 |
- */ |
|
50 |
- private String useYn; |
|
51 |
- /** |
|
52 |
- * 시스템 제공 여부 |
|
53 |
- */ |
|
54 |
- private String sysPvsnYn; |
|
55 |
- /** |
|
56 |
- * 등록자 |
|
57 |
- */ |
|
58 |
- private String rgtr; |
|
59 |
- /** |
|
60 |
- * 등록일 |
|
61 |
- */ |
|
62 |
- private String regDt; |
|
63 |
- /** |
|
64 |
- * 수정자 |
|
65 |
- */ |
|
66 |
- private String mdfr; |
|
67 |
- /** |
|
68 |
- * 수정일 |
|
69 |
- */ |
|
70 |
- private String mdfcnDt; |
|
23 |
+ private String contsId; // 콘텐츠 아이디 |
|
24 |
+ private String contsKornNm; // 콘텐츠 한글명 |
|
25 |
+ private String contsEngNm; // 콘텐츠 영문명 |
|
26 |
+ private String pageCrs; // 사용자 페이지 경로 |
|
27 |
+ private String mngrPageCrs; // 관리자 페이지 경로 |
|
28 |
+ private String compnCrs; // 컴포넌트 경로 |
|
29 |
+ private String expsrYn; // 노출여부 |
|
30 |
+ private String useYn; // 사용여부 |
|
31 |
+ private String sysPvsnYn; // 시스템 제공 여부 |
|
32 |
+ private String rgtr; // 등록자 |
|
33 |
+ private String regDt; // 등록일 |
|
34 |
+ private String mdfr; // 수정자 |
|
35 |
+ private String mdfcnDt; // 수정일 |
|
71 | 36 |
} |
--- src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
+++ src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
... | ... | @@ -1,14 +1,11 @@ |
1 | 1 |
package com.takensoft.cms.contsType.web; |
2 | 2 |
|
3 | 3 |
import com.takensoft.cms.contsType.service.ContsTypeService; |
4 |
+import com.takensoft.cms.contsType.vo.ContsAuthrtVO; |
|
4 | 5 |
import com.takensoft.cms.contsType.vo.ContsTypeVO; |
5 | 6 |
import com.takensoft.common.message.MessageCode; |
6 |
-import com.takensoft.common.util.ResponseData; |
|
7 | 7 |
import com.takensoft.common.util.ResponseUtil; |
8 | 8 |
import lombok.RequiredArgsConstructor; |
9 |
-import org.springframework.http.HttpHeaders; |
|
10 |
-import org.springframework.http.HttpStatus; |
|
11 |
-import org.springframework.http.MediaType; |
|
12 | 9 |
import org.springframework.http.ResponseEntity; |
13 | 10 |
import org.springframework.web.bind.annotation.PostMapping; |
14 | 11 |
import org.springframework.web.bind.annotation.RequestBody; |
... | ... | @@ -17,78 +14,61 @@ |
17 | 14 |
|
18 | 15 |
import java.nio.charset.Charset; |
19 | 16 |
import java.util.*; |
17 |
+ |
|
20 | 18 |
/** |
21 |
- * @author takensoft |
|
22 |
- * @since 2024.04.17 |
|
19 |
+ * @author : takensoft |
|
20 |
+ * @since :2024.04.17 |
|
23 | 21 |
* @modification |
24 | 22 |
* since | author | description |
25 |
- * 2024.04.17 | takensoft | 최초 등록 |
|
23 |
+ * 2024.04.17 | takensoft | 최초 등록 |
|
24 |
+ * 2024.04.29 | 박정하 | findAllByExpsr 추가 |
|
25 |
+ * 2025.03.13 | 방선주 | 코드 리펙토링 |
|
26 | 26 |
* |
27 |
- * 콘텐츠 유형 관리 관련 컨트롤러 |
|
27 |
+ * 컨텐츠 유형 관련 Controller |
|
28 | 28 |
*/ |
29 | 29 |
@RestController |
30 | 30 |
@RequiredArgsConstructor |
31 |
-@RequestMapping(value = "/admin/contsType") |
|
31 |
+@RequestMapping(value = {"/admin/contsType", "/sys/contsType"}) |
|
32 | 32 |
public class ContsTypeController { |
33 | 33 |
private final ContsTypeService contsTypeService; |
34 | 34 |
private final ResponseUtil resUtil; |
35 | 35 |
|
36 | 36 |
/** |
37 |
- * @author takensoft |
|
38 |
- * @since 2024.04.17 |
|
39 |
- * @param contsTypeVO |
|
40 |
- * @return |
|
41 |
- * @throws Exception |
|
37 |
+ * @param contsTypeVO - 등록할 컨텐츠 유형 정보 |
|
38 |
+ * @return ResponseEntity - 등록 결과를 포함하는 응답 |
|
42 | 39 |
* |
43 | 40 |
* 콘텐츠 유형 등록 |
44 | 41 |
*/ |
45 | 42 |
@PostMapping("/saveProc.json") |
46 |
- public ResponseEntity<?> savePorc(@RequestBody ContsTypeVO contsTypeVO) throws Exception { |
|
43 |
+ public ResponseEntity<?> savePorc(@RequestBody ContsTypeVO contsTypeVO){ |
|
47 | 44 |
// 콘텐츠 유형 등록 |
48 | 45 |
HashMap<String, Object> result = contsTypeService.contsSave(contsTypeVO); |
49 |
- int insertResult = (int) result.get("result"); |
|
50 |
- |
|
51 | 46 |
// 응답 처리 |
52 |
- if(insertResult > 0) { |
|
53 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
54 |
- } else { |
|
55 |
- return resUtil.errorRes(MessageCode.COMMON_INSERT_FAIL); |
|
56 |
- } |
|
47 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
57 | 48 |
} |
58 | 49 |
|
59 | 50 |
/** |
60 |
- * @author takensoft |
|
61 |
- * @since 2024.04.17 |
|
62 |
- * @param contsTypeVO |
|
63 |
- * @return |
|
64 |
- * @throws Exception |
|
51 |
+ * @param contsTypeVO - 수정할 컨텐츠 유형 정보 |
|
52 |
+ * @return ResponseEntity - 수정 결과를 포함하는 응답 |
|
65 | 53 |
* |
66 | 54 |
* 콘텐츠 유형 수정 |
67 | 55 |
*/ |
68 | 56 |
@PostMapping("/updateProc.json") |
69 |
- public ResponseEntity<?> updateProc(@RequestBody ContsTypeVO contsTypeVO) throws Exception { |
|
57 |
+ public ResponseEntity<?> updateProc(@RequestBody ContsTypeVO contsTypeVO) { |
|
70 | 58 |
// 콘텐츠 유형 수정 처리 |
71 | 59 |
int result = contsTypeService.contsUpdate(contsTypeVO); |
72 |
- |
|
73 | 60 |
// 응답 처리 |
74 |
- if(result > 0) { |
|
75 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
76 |
- } else { |
|
77 |
- return resUtil.errorRes(MessageCode.COMMON_UPDATE_FAIL); |
|
78 |
- } |
|
61 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
79 | 62 |
} |
80 | 63 |
|
81 | 64 |
/** |
82 |
- * @author takensoft |
|
83 |
- * @since 2024.04.17 |
|
84 |
- * @param params |
|
85 |
- * @return |
|
86 |
- * @throws Exception |
|
65 |
+ * @param params - pagination 및 검색 조건을 포함하는 map |
|
66 |
+ * @return ResponseEntity - 콘텐츠 유형 목록을 포함하는 응답 |
|
87 | 67 |
* |
88 | 68 |
* 콘텐츠 유형 목록 조회 |
89 | 69 |
*/ |
90 | 70 |
@PostMapping("/findAll.json") |
91 |
- public ResponseEntity<?> findAll(@RequestBody Map<String, String> params) throws Exception { |
|
71 |
+ public ResponseEntity<?> findAll(@RequestBody Map<String, String> params) { |
|
92 | 72 |
// 콘텐츠 유형 목록 조회 |
93 | 73 |
Map<String, Object> result = contsTypeService.findAll(params); |
94 | 74 |
|
... | ... | @@ -97,59 +77,60 @@ |
97 | 77 |
} |
98 | 78 |
|
99 | 79 |
/** |
100 |
- * @author takensoft |
|
101 |
- * @since 2024.04.17 |
|
102 |
- * @param contsTypeVO |
|
103 |
- * @return |
|
104 |
- * @throws Exception |
|
80 |
+ * @param contsTypeVO - 조회할 콘텐츠 유형 정보 |
|
81 |
+ * @return ResponseEntity - 상세 조회 결과를 포함하는 응답 |
|
105 | 82 |
* |
106 | 83 |
* 콘텐츠 유형 상세 조회 |
107 | 84 |
*/ |
108 | 85 |
@PostMapping("/findByContsType.json") |
109 |
- public ResponseEntity<?> findByContsType(@RequestBody ContsTypeVO contsTypeVO) throws Exception { |
|
86 |
+ public ResponseEntity<?> findByContsType(@RequestBody ContsTypeVO contsTypeVO) { |
|
110 | 87 |
ContsTypeVO result = contsTypeService.findByContsType(contsTypeVO.getContsId()); |
111 |
- |
|
112 | 88 |
// 응답 처리 |
113 | 89 |
return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
114 | 90 |
} |
115 | 91 |
|
116 | 92 |
/** |
117 |
- * @author takensoft |
|
118 |
- * @since 2024.04.17 |
|
119 |
- * @param contsTypeVO |
|
120 |
- * @return |
|
121 |
- * @throws Exception |
|
93 |
+ * @param contsTypeVO - 삭제할 콘텐츠 유형 정보 |
|
94 |
+ * @return ResponseEntity - 콘텐츠 유형 삭제 결과를 포함하는 응답 |
|
122 | 95 |
* |
123 | 96 |
* 콘텐츠 유형 삭제 |
124 | 97 |
*/ |
125 | 98 |
@PostMapping("/deleteProc.json") |
126 |
- public ResponseEntity<?> deleteProc(@RequestBody ContsTypeVO contsTypeVO) throws Exception { |
|
99 |
+ public ResponseEntity<?> deleteProc(@RequestBody ContsTypeVO contsTypeVO) { |
|
127 | 100 |
contsTypeVO.setUseYn("N"); |
128 | 101 |
int result = contsTypeService.contsUpdate(contsTypeVO); |
129 |
- |
|
130 | 102 |
// 응답 처리 |
131 |
- if(result > 0) { |
|
132 |
- return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
133 |
- } else { |
|
134 |
- return resUtil.errorRes(MessageCode.COMMON_DELETE_FAIL); |
|
135 |
- } |
|
103 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
136 | 104 |
} |
137 | 105 |
|
138 | 106 |
/** |
139 |
- * @author 박정하 |
|
140 |
- * @since 2024.04.29 |
|
141 |
- * @param |
|
142 |
- * @return |
|
143 |
- * @throws Exception |
|
107 |
+ * @param contsTypeVO - 조회할 콘텐츠 유형 정보 |
|
108 |
+ * @return ResponseEntity - 콘텐츠 유형 목록 조회 결과를 포함하는 응답 |
|
144 | 109 |
* |
145 | 110 |
* 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
146 | 111 |
*/ |
147 | 112 |
@PostMapping("/findAllByExpsr.json") |
148 |
- public ResponseEntity<?> findAllByExpsr(@RequestBody ContsTypeVO contsTypeVO) throws Exception { |
|
113 |
+ public ResponseEntity<?> findAllByExpsr(@RequestBody ContsTypeVO contsTypeVO) { |
|
149 | 114 |
// 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
150 | 115 |
List<ContsTypeVO> result = contsTypeService.findAllByExpsr(contsTypeVO); |
151 | 116 |
|
152 | 117 |
// 응답 처리 |
153 | 118 |
return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
154 | 119 |
} |
120 |
+ /** ********************* 콘텐츠 유형 관리 관련 컨트롤러 *************************** */ |
|
121 |
+ |
|
122 |
+ /** |
|
123 |
+ * @param |
|
124 |
+ * @return ResponseEntity - 콘텐츠 유형 목록 조회 결과를 포함하는 응답 |
|
125 |
+ * |
|
126 |
+ * 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
|
127 |
+ */ |
|
128 |
+ @PostMapping(value = "/findByContsAuthrtSys.json") |
|
129 |
+ public ResponseEntity<?> findByContsTypeSys(){ |
|
130 |
+ // 콘텐츠 유형 목록 조회 (메뉴 노출 건만) |
|
131 |
+ List<ContsAuthrtVO> result = contsTypeService.findByContsAuthrt(); |
|
132 |
+ |
|
133 |
+ // 응답 처리 |
|
134 |
+ return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); |
|
135 |
+ } |
|
155 | 136 |
} |
--- src/main/java/com/takensoft/cms/contsType/web/SystemContsTypeController.java
... | ... | @@ -1,68 +0,0 @@ |
1 | -package com.takensoft.cms.contsType.web; | |
2 | - | |
3 | -import com.takensoft.cms.contsType.service.ContsTypeService; | |
4 | -import com.takensoft.cms.contsType.vo.ContsAuthrtVO; | |
5 | -import com.takensoft.cms.contsType.vo.ContsTypeVO; | |
6 | -import com.takensoft.common.message.MessageCode; | |
7 | -import com.takensoft.common.util.ResponseData; | |
8 | -import com.takensoft.common.util.ResponseUtil; | |
9 | -import lombok.RequiredArgsConstructor; | |
10 | -import lombok.extern.slf4j.Slf4j; | |
11 | -import org.springframework.http.HttpHeaders; | |
12 | -import org.springframework.http.HttpStatus; | |
13 | -import org.springframework.http.MediaType; | |
14 | -import org.springframework.http.ResponseEntity; | |
15 | -import org.springframework.web.bind.annotation.*; | |
16 | - | |
17 | -import java.nio.charset.Charset; | |
18 | -import java.util.List; | |
19 | -/** | |
20 | - * @author takensoft | |
21 | - * @since 2024.04.17 | |
22 | - * @modification | |
23 | - * since | author | description | |
24 | - * 2024.04.17 | takensoft | 최초 등록 | |
25 | - * | |
26 | - * 콘텐츠 유형 관리 관련 컨트롤러 | |
27 | - */ | |
28 | -@RestController | |
29 | -@RequiredArgsConstructor | |
30 | -@Slf4j | |
31 | -@RequestMapping(value = "/sys/contsType") | |
32 | -public class SystemContsTypeController { | |
33 | - | |
34 | - private final ResponseUtil resUtil; | |
35 | - private final ContsTypeService contsTypeService; | |
36 | - | |
37 | - /** | |
38 | - * @author takensoft | |
39 | - * @since 2024.04.29 | |
40 | - * @param | |
41 | - * @return | |
42 | - * @throws Exception | |
43 | - */ | |
44 | - @PostMapping(value = "/findByContsTypeSys.json") | |
45 | - public ResponseEntity<?> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception { | |
46 | - // 콘텐츠 유형 목록 조회 (메뉴 노출 건만) | |
47 | - List<ContsTypeVO> result = contsTypeService.findByContsTypeSys(contsTypeVO); | |
48 | - | |
49 | - // 응답 처리 | |
50 | - return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); | |
51 | - } | |
52 | - | |
53 | - /** | |
54 | - * @author takensoft | |
55 | - * @since 2024.04.29 | |
56 | - * @param | |
57 | - * @return | |
58 | - * @throws Exception | |
59 | - */ | |
60 | - @PostMapping(value = "/findByContsAuthrtSys.json") | |
61 | - public ResponseEntity<?> findByContsTypeSys() throws Exception { | |
62 | - // 콘텐츠 유형 목록 조회 (메뉴 노출 건만) | |
63 | - List<ContsAuthrtVO> result = contsTypeService.findByContsAuthrt(); | |
64 | - | |
65 | - // 응답 처리 | |
66 | - return resUtil.successRes(result, MessageCode.COMMON_SUCCESS); | |
67 | - } | |
68 | -} |
--- src/main/java/com/takensoft/cms/dept/service/DeptService.java
+++ src/main/java/com/takensoft/cms/dept/service/DeptService.java
... | ... | @@ -15,7 +15,7 @@ |
15 | 15 |
* since | author | description |
16 | 16 |
* 2024.04.09 | takensoft | 최초 등록 |
17 | 17 |
* 2024.05.10 | 박정하 | updateList, updateChildNode 추가 |
18 |
- * 2025.03.13 | 방선주 | 코드 리펙토링 |
|
18 |
+ * 2025.03.14 | 방선주 | 코드 리펙토링 |
|
19 | 19 |
* |
20 | 20 |
* 부서 정보 관련 인터페이스 |
21 | 21 |
*/ |
--- src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
+++ src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
... | ... | @@ -50,6 +50,7 @@ |
50 | 50 |
/** |
51 | 51 |
* @param deptVO - 부서 정보 VO |
52 | 52 |
* @return HashMap<String, Object> - 부서 정보 |
53 |
+ * @throws CustomInsertFailException - 부서 등록 실패 시 |
|
53 | 54 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
54 | 55 |
* @throws NullPointerException - Null 값이 발생할 경우 |
55 | 56 |
* @throws Exception - 그 외 예외 발생 시 |
... | ... | @@ -366,7 +367,7 @@ |
366 | 367 |
} |
367 | 368 |
|
368 | 369 |
/** |
369 |
- * @param params - 부서 아이디 |
|
370 |
+ * @param deptList - 부서 목록 객체 |
|
370 | 371 |
* @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보 |
371 | 372 |
* @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
372 | 373 |
* @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
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?