--- src/main/java/com/takensoft/cms/menu/dao/MenuAuthorDAO.java
+++ src/main/java/com/takensoft/cms/menu/dao/MenuAuthorDAO.java
... | ... | @@ -9,29 +9,38 @@ |
9 | 9 |
/** |
10 | 10 |
* @author : 박정하 |
11 | 11 |
* @since : 2024.05.07 |
12 |
+ * @modification |
|
13 |
+ * since | author | description |
|
14 |
+ * 2024.05.07 | 박정하 | 최초 등록 |
|
15 |
+ * 2024.04.15 | 박정하 | 메뉴별 권한 등록 |
|
16 |
+ * 2024.05.02 | 박정하 | 메뉴 권한 수정 |
|
17 |
+ * 2024.05.08 | 박정하 | 메뉴 권한 조회 |
|
12 | 18 |
* |
13 | 19 |
* 메뉴 권한 정보 관련 Mapper |
14 | 20 |
*/ |
15 | 21 |
@Mapper("menuAuthorDAO") |
16 | 22 |
public interface MenuAuthorDAO { |
17 | 23 |
/** |
18 |
- * @author takensoft |
|
19 |
- * @since 2024.04.15 |
|
24 |
+ * @param menuAuthorVO - 메뉴별 권한 정보 객체 |
|
25 |
+ * @return int - 등록 성공 여부 |
|
26 |
+ * |
|
20 | 27 |
* 메뉴별 권한 등록 |
21 | 28 |
*/ |
22 |
- public int menuAuthrtSave(MenuAuthorVO menuAuthorVO); |
|
29 |
+ int menuAuthrtSave(MenuAuthorVO menuAuthorVO); |
|
23 | 30 |
|
24 | 31 |
/** |
25 |
- * @author 박정하 |
|
26 |
- * @since 2024.05.02 |
|
32 |
+ * @param params - 메뉴별 권한 정보 객체 |
|
33 |
+ * @return int - 수정 성공 여부 |
|
34 |
+ * |
|
27 | 35 |
* 메뉴 권한 수정 |
28 | 36 |
*/ |
29 |
- public int updateMenuAuthrt(HashMap<String, Object> params) throws Exception; |
|
37 |
+ int updateMenuAuthrt(HashMap<String, Object> params); |
|
30 | 38 |
|
31 | 39 |
/** |
32 |
- * @author 박정하 |
|
33 |
- * @since 2024.05.08 |
|
40 |
+ * @param authorVO - 메뉴 권한 정보 객체 |
|
41 |
+ * @return List<HashMap<String, Object>> - 메뉴 권한 정보 목록 |
|
42 |
+ * |
|
34 | 43 |
* 메뉴 권한 조회 |
35 | 44 |
*/ |
36 |
- public List<HashMap<String, Object>> findAll(AuthorVO authorVO) throws Exception; |
|
45 |
+ List<HashMap<String, Object>> findAll(AuthorVO authorVO); |
|
37 | 46 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/menu/dao/MenuDAO.java
+++ src/main/java/com/takensoft/cms/menu/dao/MenuDAO.java
... | ... | @@ -11,137 +11,170 @@ |
11 | 11 |
import java.util.List; |
12 | 12 |
|
13 | 13 |
/** |
14 |
- * @author : takensoft |
|
15 |
- * @since : 2024.04.01 |
|
14 |
+ * @author takensoft |
|
15 |
+ * @since 2024.04.01 |
|
16 |
+ * @modification |
|
17 |
+ * since | author | description |
|
18 |
+ * 2024.04.01 | takensoft | 최초 등록 |
|
19 |
+ * 2024.04.08 | takensoft | findTopMenu, findChildMenus, save, findByMenu, findByMenuGrd, findByMenuSn, saveMenuStsfdg 추가 |
|
20 |
+ * 2024.04.15 | takensoft | findExceptTopMenu, update 추가 |
|
21 |
+ * 2024.04.24 | takensoft | findChildNode 추가 |
|
22 |
+ * 2024.04.25 | takensoft | findByTopNode 추가 |
|
23 |
+ * 2024.04.29 | 박정하 | deleteMenu 추가 |
|
24 |
+ * 2024.05.02 | 박정하 | findUpMenuId 추가 |
|
25 |
+ * 2024.05.09 | 박정하 | findByMenuWithRouter 추가 |
|
26 |
+ * 2024.05.10 | 박정하 | menuUpdateByHierachy, updateByContsId 추가 |
|
27 |
+ * 2024.06.07 | 방선주 | bbsMngMenuDelete 추가 |
|
28 |
+ * 2024.07.18 | 박정하 | findAllCnt 추가 |
|
16 | 29 |
* |
17 |
- * 메뉴 정보 관련 Mapper |
|
30 |
+ * 메뉴 정보 관련 DAO |
|
18 | 31 |
*/ |
19 | 32 |
@Mapper("menuDAO") |
20 | 33 |
public interface MenuDAO { |
21 | 34 |
/** |
22 |
- * @author takensoft |
|
23 |
- * @since 2024.04.08 |
|
35 |
+ * @param |
|
36 |
+ * @return List<MenuVO> - 최상위 메뉴 목록 |
|
37 |
+ * |
|
24 | 38 |
* 최상위 메뉴 조회 |
25 | 39 |
*/ |
26 | 40 |
List<MenuVO> findTopMenu(); |
27 | 41 |
|
28 | 42 |
/** |
29 |
- * @author takensoft |
|
30 |
- * @since 2024.04.08 |
|
43 |
+ * @param menuId - 상위 메뉴 ID |
|
44 |
+ * @return List<MenuVO> - 하위 메뉴 목록 |
|
45 |
+ * |
|
31 | 46 |
* 하위 메뉴 조회 |
32 | 47 |
*/ |
33 | 48 |
List<MenuVO> findChildMenus(String menuId); |
34 | 49 |
|
35 | 50 |
/** |
36 |
- * @author takensoft |
|
37 |
- * @since 2024.04.15 |
|
51 |
+ * @param |
|
52 |
+ * @return List<MenuVO> - 메뉴 목록 |
|
53 |
+ * |
|
38 | 54 |
* 메뉴 전체 조회(최상위 메뉴 제외-> grd:0) |
39 | 55 |
*/ |
40 | 56 |
List<MenuVO> findExceptTopMenu(); |
41 | 57 |
|
42 | 58 |
/** |
43 |
- * @author takensoft |
|
44 |
- * @since 2024.04.08 |
|
59 |
+ * @param menuVO - 메뉴 정보 |
|
60 |
+ * @return int - 등록 성공 여부 |
|
61 |
+ * |
|
45 | 62 |
* 메뉴 등록 |
46 | 63 |
*/ |
47 | 64 |
int save(MenuVO menuVO); |
48 | 65 |
|
49 | 66 |
/** |
50 |
- * @author takensoft |
|
51 |
- * @since 2024.04.15 |
|
67 |
+ * @param menuVO - 메뉴 정보 |
|
68 |
+ * @return int - 수정 성공 여부 |
|
69 |
+ * |
|
52 | 70 |
* 메뉴 수정 |
53 | 71 |
*/ |
54 | 72 |
int update(MenuVO menuVO); |
55 | 73 |
|
56 | 74 |
/** |
57 |
- * @author takensoft |
|
58 |
- * @since 2024.04.08 |
|
75 |
+ * @param menuId - 메뉴 ID |
|
76 |
+ * @return MenuVO - 메뉴 정보 |
|
77 |
+ * |
|
59 | 78 |
* 메뉴 상세 조회 |
60 | 79 |
*/ |
61 | 80 |
MenuVO findByMenu(String menuId); |
62 | 81 |
|
63 | 82 |
/** |
64 |
- * @author takensoft |
|
65 |
- * @since 2024.04.08 |
|
83 |
+ * @param upMenuId - 상위 메뉴 ID |
|
84 |
+ * @return int - 상위 메뉴 깊이 |
|
85 |
+ * |
|
66 | 86 |
* 메뉴 깊이 조회 |
67 | 87 |
*/ |
68 | 88 |
int findByMenuGrd(String upMenuId); |
69 | 89 |
|
70 | 90 |
/** |
71 |
- * @author takensoft |
|
72 |
- * @since 2024.04.08 |
|
91 |
+ * @param upMenuId - 상위 메뉴 ID |
|
92 |
+ * @return int - 메뉴 순서 max 값 |
|
93 |
+ * |
|
73 | 94 |
* 메뉴 순서 조회 |
74 | 95 |
*/ |
75 | 96 |
int findByMenuSn(String upMenuId); |
76 | 97 |
|
77 | 98 |
/** |
78 |
- * @author takensoft |
|
79 |
- * @since 2024.04.08 |
|
99 |
+ * @param menuStsfdgVO - 메뉴 만족도 정보 |
|
100 |
+ * @return int - 등록 성공 여부 |
|
101 |
+ * |
|
80 | 102 |
* 메뉴별 만족도 등록 |
81 | 103 |
*/ |
82 | 104 |
int saveMenuStsfdg(MenuStsfdgVO menuStsfdgVO); |
83 | 105 |
|
84 | 106 |
/************************************** Hierachy 전용 **************************************/ |
107 |
+ |
|
85 | 108 |
/** |
86 |
- * @author takensoft |
|
87 |
- * @since 2024.04.25 |
|
109 |
+ * @param |
|
110 |
+ * @return List<HierachyVO> - 부서 목록 |
|
111 |
+ * |
|
88 | 112 |
* 최상위 부서 조회 |
89 | 113 |
*/ |
90 | 114 |
List<HierachyVO> findByTopNode(); |
115 |
+ |
|
91 | 116 |
/** |
92 |
- * @author takensoft |
|
93 |
- * @since 2024.04.24 |
|
117 |
+ * @param id - 상위 부서 ID |
|
118 |
+ * @return List<HierachyVO> - 하위 부서 목록 |
|
119 |
+ * |
|
94 | 120 |
* 하위 부서 조회 |
95 | 121 |
*/ |
96 | 122 |
List<HierachyVO> findChildNode(String id); |
97 | 123 |
/************************************** Hierachy 전용 **************************************/ |
98 | 124 |
|
99 | 125 |
/** |
100 |
- * @author 박정하 |
|
101 |
- * @since 2024.04.29 |
|
126 |
+ * @param menuVO - 메뉴 정보 |
|
127 |
+ * @return int - 삭제 성공 여부 |
|
128 |
+ * |
|
102 | 129 |
* 상위,하위 메뉴 삭제 |
103 | 130 |
*/ |
104 | 131 |
int deleteMenu(MenuVO menuVO); |
105 | 132 |
|
106 | 133 |
/** |
107 |
- * @author 박정하 |
|
108 |
- * @since 2024.05.02 |
|
134 |
+ * @param MenuId - 메뉴 ID |
|
135 |
+ * @return String - 상위 메뉴 ID |
|
136 |
+ * |
|
109 | 137 |
* 상위 메뉴 조회 |
110 | 138 |
*/ |
111 | 139 |
String findUpMenuId(String MenuId); |
112 | 140 |
|
113 | 141 |
/** |
114 |
- * @author takensoft |
|
115 |
- * @since 2024.05.09 |
|
142 |
+ * @param menuRequest - 메뉴 조회 param 정보 |
|
143 |
+ * @return List<SysMenuVO> - 메뉴 목록 |
|
144 |
+ * |
|
116 | 145 |
* 메뉴 조회(시스템용) |
117 | 146 |
*/ |
118 | 147 |
List<SysMenuVO> findByMenuWithRouter(MenuRequest menuRequest); |
119 | 148 |
|
120 | 149 |
/** |
121 |
- * @author 박정하 |
|
122 |
- * @since 2024.05.10 |
|
150 |
+ * @param menuVO - 메뉴 정보 |
|
151 |
+ * @return int - 수정 성공 여부 |
|
152 |
+ * |
|
123 | 153 |
* 메뉴 정보 수정 (hierachyVO 사용) |
124 | 154 |
*/ |
125 |
- public int menuUpdateByHierachy(MenuVO menuVO) throws Exception; |
|
155 |
+ int menuUpdateByHierachy(MenuVO menuVO); |
|
126 | 156 |
|
127 | 157 |
/** |
128 |
- * @author 박정하 |
|
129 |
- * @since 2024.05.10 |
|
158 |
+ * @param contsTypeVO - 콘텐츠 유형 정보 |
|
159 |
+ * @return int - 수정 성공 여부 |
|
160 |
+ * |
|
130 | 161 |
* 메뉴 수정 (콘텐츠 유형) |
131 | 162 |
*/ |
132 |
- public int updateByContsId(ContsTypeVO contsTypeVO) throws Exception; |
|
163 |
+ int updateByContsId(ContsTypeVO contsTypeVO); |
|
133 | 164 |
|
134 | 165 |
/** |
135 |
- * @author 방선주 |
|
136 |
- * @since 2024.06.07 |
|
137 |
- * 게시판 관리에서 게시판 삭제 시 게시판 메뉴 미노출로 변경 |
|
166 |
+ * @param menuVO - 메뉴 정보 |
|
167 |
+ * @return int - 미노출 변경 성공 여부 |
|
168 |
+ * |
|
169 |
+ * 게시판 삭제 시 게시판 메뉴 미노출 |
|
138 | 170 |
*/ |
139 |
- public int bbsMngMenuDelete(MenuVO menuVO) throws Exception; |
|
171 |
+ int bbsMngMenuDelete(MenuVO menuVO); |
|
140 | 172 |
|
141 | 173 |
/** |
142 |
- * @author 박정하 |
|
143 |
- * @since 2024.07.18 |
|
174 |
+ * @param params - 메뉴 정보 |
|
175 |
+ * @return int - 메뉴 개수 |
|
176 |
+ * |
|
144 | 177 |
* 메뉴 개수 조회 (접속 통계용) |
145 | 178 |
*/ |
146 |
- public int findAllCnt(HashMap<String, Object> params) throws Exception; |
|
179 |
+ int findAllCnt(HashMap<String, Object> params); |
|
147 | 180 |
} |
--- src/main/java/com/takensoft/cms/menu/service/Impl/MenuAuthorServiceImpl.java
+++ src/main/java/com/takensoft/cms/menu/service/Impl/MenuAuthorServiceImpl.java
... | ... | @@ -7,34 +7,44 @@ |
7 | 7 |
import com.takensoft.cms.menu.service.MenuAuthorService; |
8 | 8 |
import com.takensoft.cms.menu.vo.MenuAuthorVO; |
9 | 9 |
import com.takensoft.cms.menu.vo.MenuVO; |
10 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
11 |
+import com.takensoft.common.exception.CustomUpdateFailException; |
|
10 | 12 |
import com.takensoft.common.util.JWTUtil; |
11 | 13 |
import lombok.RequiredArgsConstructor; |
12 | 14 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
13 | 15 |
import org.springframework.cache.annotation.CacheEvict; |
16 |
+import org.springframework.dao.DataAccessException; |
|
14 | 17 |
import org.springframework.stereotype.Service; |
15 | 18 |
import org.springframework.transaction.annotation.Transactional; |
16 | 19 |
|
17 | 20 |
import java.util.*; |
18 | 21 |
|
19 | 22 |
/** |
20 |
- * @author : 박정하 |
|
21 |
- * @since : 2024.05.07 |
|
23 |
+ * @author 박정하 |
|
24 |
+ * @since 2024.05.07 |
|
25 |
+ * @modification |
|
26 |
+ * since | author | description |
|
27 |
+ * 2024.05.07 | 박정하 | 최초 등록 |
|
28 |
+ * |
|
29 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
30 |
+ * MenuAuthorService - 메뉴 권한 서비스 인터페이스 |
|
22 | 31 |
* |
23 | 32 |
* 메뉴 권한 정보 관련 구현체 |
24 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
25 |
- * MenuAuthorService : 메뉴 정보 인터페이스 상속 |
|
26 | 33 |
*/ |
27 | 34 |
@Service("menuAuthorServiceImpl") |
28 | 35 |
@RequiredArgsConstructor |
29 | 36 |
public class MenuAuthorServiceImpl extends EgovAbstractServiceImpl implements MenuAuthorService { |
37 |
+ |
|
30 | 38 |
private final MenuDAO menuDAO; |
31 | 39 |
private final MenuAuthorDAO menuAuthorDAO; |
32 | 40 |
private final AuthorDAO authorDAO; |
33 | 41 |
private final JWTUtil jwtUtil; |
34 | 42 |
|
35 | 43 |
/** |
36 |
- * @author takensoft |
|
37 |
- * @since 2024.04.15 |
|
44 |
+ * @param menuId - 메뉴 ID |
|
45 |
+ * @param AuthrtCd - 권한 코드 |
|
46 |
+ * @return MenuAuthorVO - 메뉴 권한 등록 정보 |
|
47 |
+ |
|
38 | 48 |
* 메뉴별 권한 등록을 위한 전처리 |
39 | 49 |
*/ |
40 | 50 |
private MenuAuthorVO saveMenuAuthor(String menuId, String AuthrtCd) { |
... | ... | @@ -45,8 +55,14 @@ |
45 | 55 |
} |
46 | 56 |
|
47 | 57 |
/** |
48 |
- * @author takensoft |
|
49 |
- * @since 2024.04.15 |
|
58 |
+ * @param id - 메뉴 ID |
|
59 |
+ * @param type - 메뉴 등록 타입 |
|
60 |
+ * @return int - 등록 결과 |
|
61 |
+ * @throws CustomInsertFailException - 등록 실패 예외 발생 시 |
|
62 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
63 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
64 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
65 |
+ * |
|
50 | 66 |
* 메뉴별 권한 등록 |
51 | 67 |
* 파라미터로 들어오는 id는 type에 따라 권한 코드 or 메뉴 아이디로 들어옴 |
52 | 68 |
*/ |
... | ... | @@ -56,71 +72,104 @@ |
56 | 72 |
public int menuAuthrtSave(String id, String type) { |
57 | 73 |
int result = 0; |
58 | 74 |
// 타입이 null or empty 경우 에러 발생 |
59 |
- if(type == null || type.equals("")) { |
|
60 |
- throw new IllegalArgumentException("type is null or empty"); |
|
61 |
- } |
|
62 |
- // 신규 메뉴 등록 시 |
|
63 |
- if("menu".equals(type)) { |
|
64 |
- // 등록된 권한 목록 조회 |
|
65 |
- List<AuthorVO> authList = authorDAO.findAllSystem(); |
|
66 |
- for(AuthorVO author : authList) { |
|
67 |
- MenuAuthorVO menuAuthor = saveMenuAuthor(id, author.getAuthrtCd()); |
|
68 |
- result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
75 |
+ try { |
|
76 |
+ if (type == null || type.equals("")) { |
|
77 |
+ throw new IllegalArgumentException("type is null or empty"); |
|
69 | 78 |
} |
70 |
- // 신규 권한 등록 시 |
|
71 |
- } else if("author".equals(type)) { |
|
72 |
- // 등록된 메뉴 목록 조회 |
|
73 |
- List<MenuVO> menuList = menuDAO.findExceptTopMenu(); |
|
74 |
- for(MenuVO menu : menuList) { |
|
75 |
- MenuAuthorVO menuAuthor = saveMenuAuthor(menu.getMenuId(), id); |
|
76 |
- result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
79 |
+ // 신규 메뉴 등록 시 |
|
80 |
+ if ("menu".equals(type)) { |
|
81 |
+ // 등록된 권한 목록 조회 |
|
82 |
+ List<AuthorVO> authList = authorDAO.findAllSystem(); |
|
83 |
+ for (AuthorVO author : authList) { |
|
84 |
+ MenuAuthorVO menuAuthor = saveMenuAuthor(id, author.getAuthrtCd()); |
|
85 |
+ result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
86 |
+ } |
|
87 |
+ // 신규 권한 등록 시 |
|
88 |
+ } else if ("author".equals(type)) { |
|
89 |
+ // 등록된 메뉴 목록 조회 |
|
90 |
+ List<MenuVO> menuList = menuDAO.findExceptTopMenu(); |
|
91 |
+ for (MenuVO menu : menuList) { |
|
92 |
+ MenuAuthorVO menuAuthor = saveMenuAuthor(menu.getMenuId(), id); |
|
93 |
+ result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
94 |
+ } |
|
95 |
+ // 타입이 맞지 않다면 에러 |
|
96 |
+ } else { |
|
97 |
+ throw new IllegalArgumentException("Invalid value : " + type); |
|
77 | 98 |
} |
78 |
- // 타입이 맞지 않다면 에러 |
|
79 |
- } else { |
|
80 |
- throw new IllegalArgumentException("Invalid value : " + type); |
|
99 |
+ return result; |
|
100 |
+ } catch (CustomInsertFailException cife){ |
|
101 |
+ throw cife; |
|
102 |
+ } catch (DataAccessException dae) { |
|
103 |
+ throw dae; |
|
104 |
+ } catch (NullPointerException ne) { |
|
105 |
+ throw ne; |
|
106 |
+ } catch (Exception e) { |
|
107 |
+ throw new RuntimeException(e); |
|
81 | 108 |
} |
82 |
- return result; |
|
83 | 109 |
} |
84 | 110 |
|
85 | 111 |
/** |
86 |
- * @author 박정하 |
|
87 |
- * @since 2024.05.02 |
|
112 |
+ * @param params - 메뉴 권한 수정 정보 |
|
113 |
+ * @return int - 수정 결과 |
|
114 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
115 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
116 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
117 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
118 |
+ * |
|
88 | 119 |
* 메뉴 권한 수정 |
89 | 120 |
*/ |
90 | 121 |
@Override |
91 | 122 |
@Transactional(rollbackFor = Exception.class) |
92 | 123 |
@CacheEvict(value = "routerAuthInfo", allEntries = true) |
93 |
- public int updateMenuAuthrtProc(HashMap<String, Object> params) throws Exception { |
|
94 |
- int result = 0; |
|
95 |
- List<HashMap<String, Object>> menuList = (List<HashMap<String, Object>>)params.get("menuList"); |
|
96 |
- String authrtCd = params.get("authrtCd").toString(); |
|
97 |
- for(HashMap<String, Object> menu : menuList) { |
|
98 |
- menu.put("mdfr", jwtUtil.getWriter()); |
|
99 |
- menu.put("authrtCd", authrtCd); |
|
100 |
- result += menuAuthorDAO.updateMenuAuthrt(menu); |
|
124 |
+ public int updateMenuAuthrtProc(HashMap<String, Object> params){ |
|
125 |
+ try { |
|
126 |
+ int result = 0; |
|
127 |
+ List<HashMap<String, Object>> menuList = (List<HashMap<String, Object>>) params.get("menuList"); |
|
128 |
+ String authrtCd = params.get("authrtCd").toString(); |
|
129 |
+ for (HashMap<String, Object> menu : menuList) { |
|
130 |
+ menu.put("mdfr", jwtUtil.getWriter()); |
|
131 |
+ menu.put("authrtCd", authrtCd); |
|
132 |
+ result += menuAuthorDAO.updateMenuAuthrt(menu); |
|
133 |
+ } |
|
134 |
+ return result; |
|
135 |
+ } catch (CustomUpdateFailException cufe){ |
|
136 |
+ throw cufe; |
|
137 |
+ } catch (DataAccessException dae) { |
|
138 |
+ throw dae; |
|
139 |
+ } catch (NullPointerException ne) { |
|
140 |
+ throw ne; |
|
141 |
+ } catch (Exception e) { |
|
142 |
+ throw new RuntimeException(e); |
|
101 | 143 |
} |
102 |
- return result; |
|
103 | 144 |
} |
104 | 145 |
|
105 | 146 |
/** |
106 | 147 |
* @author 박정하 |
107 | 148 |
* @since 2024.05.08 |
149 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
150 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
108 | 151 |
* 메뉴 권한 조회 |
109 | 152 |
*/ |
110 | 153 |
@Override |
111 |
- public List<HashMap<String, Object>> findAll(AuthorVO authorVO) throws Exception { |
|
112 |
- List<HashMap<String, Object>> result = menuAuthorDAO.findAll(authorVO); |
|
113 |
- for(HashMap<String, Object> menuAuthor : result) { |
|
114 |
- if (menuAuthor.get("upMenuId") != null) { |
|
115 |
- if (menuAuthor.get("inqAuthrt") != null && menuAuthor.get("regAuthrt") != null && menuAuthor.get("mdfcnAuthrt") != null && menuAuthor.get("delAuthrt") != null && menuAuthor.get("fileDwnldAuthrt") != null) { |
|
116 |
- if(menuAuthor.get("inqAuthrt").equals("Y") && menuAuthor.get("regAuthrt").equals("Y") && menuAuthor.get("mdfcnAuthrt").equals("Y") && menuAuthor.get("delAuthrt").equals("Y") && menuAuthor.get("fileDwnldAuthrt").equals("Y")) { |
|
117 |
- menuAuthor.put("checkedAll", "Y"); |
|
118 |
- } else { |
|
119 |
- menuAuthor.put("checkedAll", "N"); |
|
154 |
+ public List<HashMap<String, Object>> findAll(AuthorVO authorVO) { |
|
155 |
+ try { |
|
156 |
+ List<HashMap<String, Object>> result = menuAuthorDAO.findAll(authorVO); |
|
157 |
+ for (HashMap<String, Object> menuAuthor : result) { |
|
158 |
+ if (menuAuthor.get("upMenuId") != null) { |
|
159 |
+ if (menuAuthor.get("inqAuthrt") != null && menuAuthor.get("regAuthrt") != null && menuAuthor.get("mdfcnAuthrt") != null && menuAuthor.get("delAuthrt") != null && menuAuthor.get("fileDwnldAuthrt") != null) { |
|
160 |
+ if (menuAuthor.get("inqAuthrt").equals("Y") && menuAuthor.get("regAuthrt").equals("Y") && menuAuthor.get("mdfcnAuthrt").equals("Y") && menuAuthor.get("delAuthrt").equals("Y") && menuAuthor.get("fileDwnldAuthrt").equals("Y")) { |
|
161 |
+ menuAuthor.put("checkedAll", "Y"); |
|
162 |
+ } else { |
|
163 |
+ menuAuthor.put("checkedAll", "N"); |
|
164 |
+ } |
|
120 | 165 |
} |
121 | 166 |
} |
122 | 167 |
} |
168 |
+ return result; |
|
169 |
+ } catch (DataAccessException dae) { |
|
170 |
+ throw dae; |
|
171 |
+ } catch (Exception e) { |
|
172 |
+ throw e; |
|
123 | 173 |
} |
124 |
- return result; |
|
125 | 174 |
} |
126 | 175 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/menu/service/Impl/MenuServiceImpl.java
+++ src/main/java/com/takensoft/cms/menu/service/Impl/MenuServiceImpl.java
... | ... | @@ -9,25 +9,41 @@ |
9 | 9 |
import com.takensoft.cms.menu.vo.MenuVO; |
10 | 10 |
import com.takensoft.cms.menu.vo.SysMenuVO; |
11 | 11 |
import com.takensoft.common.HierachyVO; |
12 |
+import com.takensoft.common.exception.CustomDeleteFailException; |
|
13 |
+import com.takensoft.common.exception.CustomInsertFailException; |
|
14 |
+import com.takensoft.common.exception.CustomUpdateFailException; |
|
12 | 15 |
import com.takensoft.common.idgen.service.IdgenService; |
13 | 16 |
import com.takensoft.common.util.JWTUtil; |
14 | 17 |
import lombok.RequiredArgsConstructor; |
15 | 18 |
import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; |
16 | 19 |
import org.springframework.cache.annotation.CacheEvict; |
17 | 20 |
import org.springframework.cache.annotation.Cacheable; |
21 |
+import org.springframework.dao.DataAccessException; |
|
18 | 22 |
import org.springframework.stereotype.Service; |
19 | 23 |
import org.springframework.transaction.annotation.Transactional; |
20 | 24 |
|
21 | 25 |
import java.util.*; |
22 | 26 |
|
23 | 27 |
/** |
24 |
- * @author : takensoft |
|
25 |
- * @since : 2024.04.01 |
|
28 |
+ * @author takensoft |
|
29 |
+ * @since 2024.04.01 |
|
30 |
+ * @modification |
|
31 |
+ * since | author | description |
|
32 |
+ * 2024.04.01 | takensoft | 최초 등록 |
|
33 |
+ * 2024.04.08 | takensoft | menuSave, findAll, findByChildMenu, findByMenu 추가 |
|
34 |
+ * 2024.04.09 | takensoft | MenuUpdate 추가 |
|
35 |
+ * 2024.04.15 | takensoft | saveMenuAuthor 추가 |
|
36 |
+ * 2024.04.25 | takensoft | findByTopNode, findChildNode 추가 |
|
37 |
+ * 2024.04.29 | 박정하 | menuDelete 추가 |
|
38 |
+ * 2024.05.09 | takensoft | findByMenuWithRouter 추가 |
|
39 |
+ * 2024.05.10 | 박정하 | updateList, updateChildNode 추가 |
|
40 |
+ * 2024.06.07 | 방선주 | bbsMngMenuDelete 추가 |
|
41 |
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스 |
|
42 |
+ * MenuService - 메뉴 정보 인터페이스 상속 |
|
26 | 43 |
* |
27 |
- * 메뉴 정보 관련 구현체 |
|
28 |
- * EgovAbstractServiceImpl : 전자정부 상속 |
|
29 |
- * AuthorService : 메뉴 정보 인터페이스 상속 |
|
44 |
+ * 팝업 관련 서비스 구현체 |
|
30 | 45 |
*/ |
46 |
+ |
|
31 | 47 |
@Service("menuServiceImpl") |
32 | 48 |
@RequiredArgsConstructor |
33 | 49 |
public class MenuServiceImpl extends EgovAbstractServiceImpl implements MenuService { |
... | ... | @@ -38,8 +54,10 @@ |
38 | 54 |
private final JWTUtil jwtUtil; |
39 | 55 |
|
40 | 56 |
/** |
41 |
- * @author takensoft |
|
42 |
- * @since 2024.04.15 |
|
57 |
+ * @param menuId - 메뉴 ID |
|
58 |
+ * @param AuthrtCd - 권한 코드 |
|
59 |
+ * @return MenuAuthorVO - 메뉴 권한 VO |
|
60 |
+ |
|
43 | 61 |
* 메뉴별 권한 등록을 위한 전처리 |
44 | 62 |
*/ |
45 | 63 |
private MenuAuthorVO saveMenuAuthor(String menuId, String AuthrtCd) { |
... | ... | @@ -50,211 +68,360 @@ |
50 | 68 |
} |
51 | 69 |
|
52 | 70 |
/** |
53 |
- * @author takensoft |
|
54 |
- * @since 2024.04.08 |
|
71 |
+ * @param menuVO - 메뉴 VO |
|
72 |
+ * @return int - 메뉴 등록 결과 |
|
73 |
+ * @throws CustomInsertFailException - 등록 실패 예외 발생 시 |
|
74 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
75 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
76 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
77 |
+ * |
|
55 | 78 |
* 메뉴 등록 |
56 | 79 |
*/ |
57 | 80 |
@Override |
58 | 81 |
@Transactional(rollbackFor = Exception.class) |
59 | 82 |
@CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
60 |
- public int menuSave(MenuVO menuVO) throws Exception { |
|
61 |
- // 메뉴 아이디 생성 |
|
62 |
- String menuId = menuIdgn.getNextStringId(); |
|
63 |
- menuVO.setMenuId(menuId); |
|
64 |
- // 상위 메뉴가 존재하는 경우 |
|
65 |
- if(menuVO.getUpMenuId() != null && !menuVO.getUpMenuId().equals("")) { |
|
66 |
- // 상위 메뉴 아이디 보다 깊이(레벨) 1추가 |
|
67 |
- menuVO.setMenuGrd(menuDAO.findByMenuGrd(menuVO.getUpMenuId()) + 1); |
|
68 |
- // 동일한 깊이의 메뉴 순서 보다 1추가 |
|
69 |
- menuVO.setMenuSn(menuDAO.findByMenuSn(menuVO.getUpMenuId()) + 1); |
|
70 |
- // 상위메뉴가 존재 하지 않는 경우 |
|
71 |
- } else { |
|
72 |
- menuVO.setMenuGrd(0); |
|
73 |
- menuVO.setMenuSn(menuDAO.findByMenuSn(null) + 1); |
|
74 |
- } |
|
75 |
- // 작성자 정보 |
|
76 |
- String writer = jwtUtil.getWriter(); |
|
77 |
- menuVO.setRgtr(writer); |
|
78 |
- // 시스템 제공 여부 |
|
79 |
- menuVO.setSysPvsnYn("1"); |
|
80 |
- if(menuVO.getMenuGrd() != 0) { |
|
81 |
- String upMenuId = menuVO.getUpMenuId(); |
|
82 |
- for (int i = 0; i < menuVO.getMenuGrd() - 1; i++) { |
|
83 |
- upMenuId = menuDAO.findUpMenuId(upMenuId); |
|
84 |
- } |
|
85 |
- if (upMenuId.equals("MENU_000000000000001")) { |
|
86 |
- menuVO.setSysPvsnYn("0"); |
|
87 |
- } |
|
88 |
- } |
|
89 |
- // 메뉴 등록 |
|
90 |
- int result = menuDAO.save(menuVO); |
|
91 |
- |
|
92 |
- // 메뉴별 권한 등록 |
|
93 |
- if(result > 0 && menuVO.getMenuGrd() != 0) { |
|
94 |
- String oriMenuId = menuVO.getMenuId(); |
|
95 |
- for (int i = 0; i < menuVO.getMenuGrd(); i++) { |
|
96 |
- oriMenuId = menuDAO.findUpMenuId(oriMenuId); |
|
97 |
- } |
|
98 |
- if (oriMenuId.equals("MENU_000000000000001")) { |
|
99 |
- MenuAuthorVO menuAuthor = saveMenuAuthor(menuId, "ROLE_ADMIN"); |
|
100 |
- result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
83 |
+ public int menuSave(MenuVO menuVO) { |
|
84 |
+ try { |
|
85 |
+ // 메뉴 아이디 생성 |
|
86 |
+ String menuId = menuIdgn.getNextStringId(); |
|
87 |
+ menuVO.setMenuId(menuId); |
|
88 |
+ // 상위 메뉴가 존재하는 경우 |
|
89 |
+ if (menuVO.getUpMenuId() != null && !menuVO.getUpMenuId().equals("")) { |
|
90 |
+ // 상위 메뉴 아이디 보다 깊이(레벨) 1추가 |
|
91 |
+ menuVO.setMenuGrd(menuDAO.findByMenuGrd(menuVO.getUpMenuId()) + 1); |
|
92 |
+ // 동일한 깊이의 메뉴 순서 보다 1추가 |
|
93 |
+ menuVO.setMenuSn(menuDAO.findByMenuSn(menuVO.getUpMenuId()) + 1); |
|
94 |
+ // 상위메뉴가 존재 하지 않는 경우 |
|
101 | 95 |
} else { |
102 |
- result += menuAuthorService.menuAuthrtSave(menuId, "menu"); |
|
96 |
+ menuVO.setMenuGrd(0); |
|
97 |
+ menuVO.setMenuSn(menuDAO.findByMenuSn(null) + 1); |
|
103 | 98 |
} |
99 |
+ // 작성자 정보 |
|
100 |
+ String writer = jwtUtil.getWriter(); |
|
101 |
+ menuVO.setRgtr(writer); |
|
102 |
+ // 시스템 제공 여부 |
|
103 |
+ menuVO.setSysPvsnYn("1"); |
|
104 |
+ if (menuVO.getMenuGrd() != 0) { |
|
105 |
+ String upMenuId = menuVO.getUpMenuId(); |
|
106 |
+ for (int i = 0; i < menuVO.getMenuGrd() - 1; i++) { |
|
107 |
+ upMenuId = menuDAO.findUpMenuId(upMenuId); |
|
108 |
+ } |
|
109 |
+ if (upMenuId.equals("MENU_000000000000001")) { |
|
110 |
+ menuVO.setSysPvsnYn("0"); |
|
111 |
+ } |
|
112 |
+ } |
|
113 |
+ // 메뉴 등록 |
|
114 |
+ int result = menuDAO.save(menuVO); |
|
115 |
+ |
|
116 |
+ // 메뉴별 권한 등록 |
|
117 |
+ if (result > 0 && menuVO.getMenuGrd() != 0) { |
|
118 |
+ String oriMenuId = menuVO.getMenuId(); |
|
119 |
+ for (int i = 0; i < menuVO.getMenuGrd(); i++) { |
|
120 |
+ oriMenuId = menuDAO.findUpMenuId(oriMenuId); |
|
121 |
+ } |
|
122 |
+ if (oriMenuId.equals("MENU_000000000000001")) { |
|
123 |
+ MenuAuthorVO menuAuthor = saveMenuAuthor(menuId, "ROLE_ADMIN"); |
|
124 |
+ result += menuAuthorDAO.menuAuthrtSave(menuAuthor); |
|
125 |
+ } else { |
|
126 |
+ result += menuAuthorService.menuAuthrtSave(menuId, "menu"); |
|
127 |
+ } |
|
128 |
+ } |
|
129 |
+ return result; |
|
130 |
+ } catch (CustomInsertFailException cife){ |
|
131 |
+ throw cife; |
|
132 |
+ } catch (DataAccessException dae) { |
|
133 |
+ throw dae; |
|
134 |
+ } catch (NullPointerException ne) { |
|
135 |
+ throw ne; |
|
136 |
+ } catch (Exception e) { |
|
137 |
+ throw new RuntimeException(e); |
|
104 | 138 |
} |
105 |
- return result; |
|
106 | 139 |
} |
107 | 140 |
|
108 | 141 |
/** |
109 |
- * @author takensoft |
|
110 |
- * @since 2024.04.08 |
|
142 |
+ * @param |
|
143 |
+ * @return List<MenuVO> - 메뉴 목록 |
|
144 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
145 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
146 |
+ * |
|
111 | 147 |
* 전체 메뉴 조회 |
112 | 148 |
* !!현재 java버전과 mybatis버전이 낮은관계로 재귀적 쿼리 작성 불가!! |
113 | 149 |
*/ |
114 | 150 |
@Override |
115 |
- public List<MenuVO> findAll() throws Exception { |
|
116 |
- // 상위 메뉴 조회 |
|
117 |
- List<MenuVO> topMenus = menuDAO.findTopMenu(); |
|
118 |
- // 상위 메뉴에 따른 하위 메뉴 조회 |
|
119 |
- for(MenuVO menu : topMenus) { |
|
120 |
- List<MenuVO> childMenus = findByChildMenu(menu.getMenuId()); |
|
121 |
- menu.setChildMenuList(childMenus); |
|
122 |
- } |
|
151 |
+ public List<MenuVO> findAll() { |
|
152 |
+ try{ |
|
153 |
+ // 상위 메뉴 조회 |
|
154 |
+ List<MenuVO> topMenus = menuDAO.findTopMenu(); |
|
155 |
+ // 상위 메뉴에 따른 하위 메뉴 조회 |
|
156 |
+ for(MenuVO menu : topMenus) { |
|
157 |
+ List<MenuVO> childMenus = findByChildMenu(menu.getMenuId()); |
|
158 |
+ menu.setChildMenuList(childMenus); |
|
159 |
+ } |
|
123 | 160 |
|
124 |
- return topMenus; |
|
161 |
+ return topMenus; |
|
162 |
+ } catch (DataAccessException dae) { |
|
163 |
+ throw dae; |
|
164 |
+ } catch (Exception e) { |
|
165 |
+ throw e; |
|
166 |
+ } |
|
125 | 167 |
} |
126 | 168 |
|
127 | 169 |
/** |
128 |
- * @author takensoft |
|
129 |
- * @since 2024.04.08 |
|
170 |
+ * @param menuId - 메뉴 ID |
|
171 |
+ * @return List<MenuVO> - 메뉴 목록 |
|
172 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
173 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
174 |
+ * |
|
130 | 175 |
* 하위 메뉴 조회 |
131 | 176 |
*/ |
132 | 177 |
@Override |
133 |
- public List<MenuVO> findByChildMenu(String menuId) throws Exception { |
|
134 |
- List<MenuVO> childMenus = menuDAO.findChildMenus(menuId); |
|
135 |
- for(MenuVO menu : childMenus) { |
|
136 |
- List<MenuVO> grandChildMenus = findByChildMenu(menu.getMenuId()); |
|
137 |
- menu.setChildMenuList(grandChildMenus); |
|
178 |
+ public List<MenuVO> findByChildMenu(String menuId) { |
|
179 |
+ try { |
|
180 |
+ List<MenuVO> childMenus = menuDAO.findChildMenus(menuId); |
|
181 |
+ for (MenuVO menu : childMenus) { |
|
182 |
+ List<MenuVO> grandChildMenus = findByChildMenu(menu.getMenuId()); |
|
183 |
+ menu.setChildMenuList(grandChildMenus); |
|
184 |
+ } |
|
185 |
+ return childMenus; |
|
186 |
+ } catch (DataAccessException dae) { |
|
187 |
+ throw dae; |
|
188 |
+ } catch (Exception e) { |
|
189 |
+ throw e; |
|
138 | 190 |
} |
139 |
- return childMenus; |
|
140 | 191 |
} |
141 | 192 |
|
142 | 193 |
/** |
143 |
- * @author takensoft |
|
144 |
- * @since 2024.04.08 |
|
194 |
+ * @param menuId - 메뉴 ID |
|
195 |
+ * @return MenuVO - 메뉴 정보 |
|
196 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
197 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
198 |
+ * |
|
145 | 199 |
* 메뉴 상세 조회 |
146 | 200 |
*/ |
147 | 201 |
@Override |
148 |
- public MenuVO findByMenu(String menuId) throws Exception { |
|
149 |
- return menuDAO.findByMenu(menuId); |
|
202 |
+ public MenuVO findByMenu(String menuId) { |
|
203 |
+ try{ |
|
204 |
+ return menuDAO.findByMenu(menuId); |
|
205 |
+ } catch (DataAccessException dae) { |
|
206 |
+ throw dae; |
|
207 |
+ } catch (Exception e) { |
|
208 |
+ throw e; |
|
209 |
+ } |
|
150 | 210 |
} |
151 | 211 |
|
152 | 212 |
/** |
153 |
- * @author takensoft |
|
154 |
- * @since 2024.04.09 |
|
213 |
+ * @param menuVO - 메뉴 VO |
|
214 |
+ * @return int - 수정 결과 |
|
215 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
216 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
217 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
218 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
219 |
+ * |
|
155 | 220 |
* 메뉴 수정 |
156 | 221 |
*/ |
157 | 222 |
@Override |
158 | 223 |
@CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
159 |
- public int MenuUpdate(MenuVO menuVO) throws Exception { |
|
160 |
- // 토큰정보에서 사용자 아이디 조회 후 등록 |
|
161 |
- menuVO.setMdfr(jwtUtil.getWriter()); |
|
162 |
- return menuDAO.update(menuVO); |
|
224 |
+ public int MenuUpdate(MenuVO menuVO) { |
|
225 |
+ try{ |
|
226 |
+ // 토큰정보에서 사용자 아이디 조회 후 등록 |
|
227 |
+ menuVO.setMdfr(jwtUtil.getWriter()); |
|
228 |
+ return menuDAO.update(menuVO); |
|
229 |
+ } catch (CustomUpdateFailException cufe){ |
|
230 |
+ throw cufe; |
|
231 |
+ } catch (DataAccessException dae) { |
|
232 |
+ throw dae; |
|
233 |
+ } catch (NullPointerException ne) { |
|
234 |
+ throw ne; |
|
235 |
+ } catch (Exception e) { |
|
236 |
+ throw new RuntimeException(e); |
|
237 |
+ } |
|
163 | 238 |
} |
164 | 239 |
|
165 | 240 |
/************************************** Hierachy 전용 **************************************/ |
166 | 241 |
/** |
167 |
- * @author takensoft |
|
168 |
- * @since 2024.04.25 |
|
242 |
+ * @param |
|
243 |
+ * @return List<HierachyVO> - 최상위 메뉴 목록 |
|
244 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
245 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
246 |
+ * |
|
169 | 247 |
* 최상위 메뉴 조회 |
170 | 248 |
*/ |
171 | 249 |
@Override |
172 |
- public List<HierachyVO> findByTopNode() throws Exception { |
|
173 |
- List<HierachyVO> topDeptList = menuDAO.findByTopNode(); |
|
174 |
- for(HierachyVO vo : topDeptList) { |
|
175 |
- List<HierachyVO> child = findChildNode(vo.getId()); |
|
176 |
- vo.setChildList(child); |
|
250 |
+ public List<HierachyVO> findByTopNode() { |
|
251 |
+ try { |
|
252 |
+ List<HierachyVO> topDeptList = menuDAO.findByTopNode(); |
|
253 |
+ for (HierachyVO vo : topDeptList) { |
|
254 |
+ List<HierachyVO> child = findChildNode(vo.getId()); |
|
255 |
+ vo.setChildList(child); |
|
256 |
+ } |
|
257 |
+ return topDeptList; |
|
258 |
+ } catch (DataAccessException dae) { |
|
259 |
+ throw dae; |
|
260 |
+ } catch (Exception e) { |
|
261 |
+ throw e; |
|
177 | 262 |
} |
178 |
- return topDeptList; |
|
179 | 263 |
} |
180 | 264 |
|
181 | 265 |
/** |
182 |
- * @author takensoft |
|
183 |
- * @since 2024.04.25 |
|
266 |
+ * @param id - 메뉴 ID |
|
267 |
+ * @return List<HierachyVO> - 메뉴 목록 |
|
268 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
269 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
270 |
+ * |
|
184 | 271 |
* 하위 메뉴 조회 |
185 | 272 |
*/ |
186 | 273 |
@Override |
187 |
- public List<HierachyVO> findChildNode(String id) throws Exception { |
|
188 |
- List<HierachyVO> childList = menuDAO.findChildNode(id); |
|
189 |
- for(HierachyVO vo : childList) { |
|
190 |
- List<HierachyVO> child = findChildNode(vo.getId()); |
|
191 |
- vo.setChildList(child); |
|
274 |
+ public List<HierachyVO> findChildNode(String id){ |
|
275 |
+ try { |
|
276 |
+ List<HierachyVO> childList = menuDAO.findChildNode(id); |
|
277 |
+ for (HierachyVO vo : childList) { |
|
278 |
+ List<HierachyVO> child = findChildNode(vo.getId()); |
|
279 |
+ vo.setChildList(child); |
|
280 |
+ } |
|
281 |
+ return childList; |
|
282 |
+ } catch (DataAccessException dae) { |
|
283 |
+ throw dae; |
|
284 |
+ } catch (Exception e) { |
|
285 |
+ throw e; |
|
192 | 286 |
} |
193 |
- return childList; |
|
194 | 287 |
} |
195 | 288 |
/************************************** Hierachy 전용 **************************************/ |
196 | 289 |
|
197 | 290 |
/** |
198 |
- * @author 박정하 |
|
199 |
- * @since 2024.04.29 |
|
291 |
+ * @param menuVO - 메뉴 VO |
|
292 |
+ * @return int - 삭제 결과 |
|
293 |
+ * @throws CustomUpdateFailException - 삭제 실패 예외 발생 시 |
|
294 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
295 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
296 |
+ * |
|
200 | 297 |
* 메뉴 정보 삭제 |
201 | 298 |
*/ |
202 | 299 |
@Override |
203 | 300 |
@Transactional(rollbackFor = Exception.class) |
204 |
- public int menuDelete(MenuVO menuVO) throws Exception { |
|
205 |
- menuVO.setMdfr(jwtUtil.getWriter()); |
|
206 |
- return menuDAO.deleteMenu(menuVO); |
|
301 |
+ public int menuDelete(MenuVO menuVO) { |
|
302 |
+ try { |
|
303 |
+ menuVO.setMdfr(jwtUtil.getWriter()); |
|
304 |
+ return menuDAO.deleteMenu(menuVO); |
|
305 |
+ } catch (CustomUpdateFailException cufe){ |
|
306 |
+ throw cufe; |
|
307 |
+ } catch (DataAccessException dae) { |
|
308 |
+ throw dae; |
|
309 |
+ } catch (Exception e) { |
|
310 |
+ throw new RuntimeException(e); |
|
311 |
+ } |
|
207 | 312 |
} |
208 | 313 |
|
209 | 314 |
/************************************** 홈페이지 메뉴 호출 전용 **************************************/ |
210 | 315 |
/** |
211 |
- * @author takensoft |
|
212 |
- * @since 2024.05.09 |
|
316 |
+ * @param mReq - 메뉴 요청 객체 |
|
317 |
+ * @return List<SysMenuVO> - 메뉴 목록 |
|
318 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
319 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
320 |
+ * |
|
213 | 321 |
* 메뉴 조회(시스템용) |
214 | 322 |
*/ |
215 | 323 |
@Override |
216 | 324 |
@Cacheable(value = "findByMenuWithRouter", key = "#mReq.menuType") |
217 | 325 |
public List<SysMenuVO> findByMenuWithRouter(MenuRequest mReq) { |
218 |
- if(mReq.isChck() && mReq.getMenuType().equals("adm")) { |
|
219 |
- mReq.setMenuId("MENU_000000000000001"); |
|
220 |
- } else if(mReq.isChck() && mReq.getMenuType().equals("company")) { |
|
221 |
- mReq.setMenuId("MENU_000000000000002"); |
|
222 |
- } else if(mReq.isChck() && mReq.getMenuType().equals("government")) { |
|
223 |
- mReq.setMenuId("MENU_000000000000003"); |
|
326 |
+ try { |
|
327 |
+ if (mReq.isChck() && mReq.getMenuType().equals("adm")) { |
|
328 |
+ mReq.setMenuId("MENU_000000000000001"); |
|
329 |
+ } else if (mReq.isChck() && mReq.getMenuType().equals("company")) { |
|
330 |
+ mReq.setMenuId("MENU_000000000000002"); |
|
331 |
+ } else if (mReq.isChck() && mReq.getMenuType().equals("government")) { |
|
332 |
+ mReq.setMenuId("MENU_000000000000003"); |
|
333 |
+ } |
|
334 |
+ mReq.setChck(false); |
|
335 |
+ List<SysMenuVO> result = menuDAO.findByMenuWithRouter(mReq); |
|
336 |
+ for (SysMenuVO vo : result) { |
|
337 |
+ mReq.setMenuId(vo.getMenuId()); |
|
338 |
+ List<SysMenuVO> child = findByMenuWithRouter(mReq); |
|
339 |
+ vo.setChildList(child); |
|
340 |
+ } |
|
341 |
+ return result; |
|
342 |
+ } catch (DataAccessException dae) { |
|
343 |
+ throw dae; |
|
344 |
+ } catch (Exception e) { |
|
345 |
+ throw e; |
|
224 | 346 |
} |
225 |
- mReq.setChck(false); |
|
226 |
- List<SysMenuVO> result = menuDAO.findByMenuWithRouter(mReq); |
|
227 |
- for(SysMenuVO vo : result) { |
|
228 |
- mReq.setMenuId(vo.getMenuId()); |
|
229 |
- List<SysMenuVO> child = findByMenuWithRouter(mReq); |
|
230 |
- vo.setChildList(child); |
|
231 |
- } |
|
232 |
- return result; |
|
233 | 347 |
} |
234 | 348 |
/************************************** 홈페이지 메뉴 호출 전용 **************************************/ |
235 | 349 |
|
236 | 350 |
/** |
237 |
- * @author 박정하 |
|
238 |
- * @since 2024.05.10 |
|
351 |
+ * @param deptList - 부서 리스트 |
|
352 |
+ * @return int - 수정 결과 |
|
353 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
354 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
355 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
356 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
357 |
+ * |
|
239 | 358 |
* 메뉴 정보 수정 (hierachyVO 사용) |
240 | 359 |
*/ |
241 | 360 |
@Override |
242 | 361 |
@CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
243 | 362 |
@Transactional(rollbackFor = Exception.class) |
244 |
- public int updateList(List<HierachyVO> deptList) throws Exception { |
|
363 |
+ public int updateList(List<HierachyVO> deptList){ |
|
245 | 364 |
int result = 0; |
246 |
- String writer = jwtUtil.getWriter(); |
|
365 |
+ try { |
|
366 |
+ String writer = jwtUtil.getWriter(); |
|
247 | 367 |
|
248 |
- if(deptList != null && deptList.size() > 0) { |
|
368 |
+ if (deptList != null && deptList.size() > 0) { |
|
369 |
+ int sn = 1; |
|
370 |
+ for (HierachyVO hierachyVO : deptList) { |
|
371 |
+ // 최상위 노드 수정 |
|
372 |
+ MenuVO vo = new MenuVO(); |
|
373 |
+ vo.setMenuId(hierachyVO.getId()); |
|
374 |
+ vo.setUpMenuId(null); |
|
375 |
+ vo.setMenuGrd(0); |
|
376 |
+ vo.setMenuSn(sn); |
|
377 |
+ vo.setMdfr(writer); |
|
378 |
+ result += menuDAO.menuUpdateByHierachy(vo); |
|
379 |
+ |
|
380 |
+ // 하위 노드 수정 |
|
381 |
+ if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
382 |
+ result += updateChildNode(hierachyVO.getChildList(), vo); |
|
383 |
+ } |
|
384 |
+ sn++; |
|
385 |
+ } |
|
386 |
+ } |
|
387 |
+ return result; |
|
388 |
+ } catch (CustomUpdateFailException cufe){ |
|
389 |
+ throw cufe; |
|
390 |
+ } catch (DataAccessException dae) { |
|
391 |
+ throw dae; |
|
392 |
+ } catch (NullPointerException ne) { |
|
393 |
+ throw ne; |
|
394 |
+ } catch (Exception e) { |
|
395 |
+ throw new RuntimeException(e); |
|
396 |
+ } |
|
397 |
+ } |
|
398 |
+ /** |
|
399 |
+ * @author 박정하 |
|
400 |
+ * @since 2024.05.10 |
|
401 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
402 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
403 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
404 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
405 |
+ * |
|
406 |
+ * 하위 메뉴 수정 |
|
407 |
+ */ |
|
408 |
+ @Override |
|
409 |
+ @CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
|
410 |
+ public int updateChildNode(List<HierachyVO> childList, MenuVO upMenuVO) { |
|
411 |
+ int result = 0; |
|
412 |
+ try { |
|
413 |
+ String upDeptId = upMenuVO.getMenuId(); |
|
414 |
+ int grd = upMenuVO.getMenuGrd() + 1; |
|
249 | 415 |
int sn = 1; |
250 |
- for(HierachyVO hierachyVO : deptList) { |
|
251 |
- // 최상위 노드 수정 |
|
416 |
+ String mdfr = upMenuVO.getMdfr(); |
|
417 |
+ for (HierachyVO hierachyVO : childList) { |
|
418 |
+ // 현재 노드 수정 |
|
252 | 419 |
MenuVO vo = new MenuVO(); |
253 | 420 |
vo.setMenuId(hierachyVO.getId()); |
254 |
- vo.setUpMenuId(null); |
|
255 |
- vo.setMenuGrd(0); |
|
421 |
+ vo.setUpMenuId(upDeptId); |
|
422 |
+ vo.setMenuGrd(grd); |
|
256 | 423 |
vo.setMenuSn(sn); |
257 |
- vo.setMdfr(writer); |
|
424 |
+ vo.setMdfr(mdfr); |
|
258 | 425 |
result += menuDAO.menuUpdateByHierachy(vo); |
259 | 426 |
|
260 | 427 |
// 하위 노드 수정 |
... | ... | @@ -263,48 +430,40 @@ |
263 | 430 |
} |
264 | 431 |
sn++; |
265 | 432 |
} |
433 |
+ return result; |
|
434 |
+ } catch (CustomUpdateFailException cufe){ |
|
435 |
+ throw cufe; |
|
436 |
+ } catch (DataAccessException dae) { |
|
437 |
+ throw dae; |
|
438 |
+ } catch (NullPointerException ne) { |
|
439 |
+ throw ne; |
|
440 |
+ } catch (Exception e) { |
|
441 |
+ throw new RuntimeException(e); |
|
266 | 442 |
} |
267 |
- return result; |
|
268 |
- } |
|
269 |
- /** |
|
270 |
- * @author 박정하 |
|
271 |
- * @since 2024.05.10 |
|
272 |
- * 하위 메뉴 수정 |
|
273 |
- */ |
|
274 |
- @Override |
|
275 |
- @CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
|
276 |
- public int updateChildNode(List<HierachyVO> childList, MenuVO upMenuVO) throws Exception { |
|
277 |
- int result = 0; |
|
278 |
- String upDeptId = upMenuVO.getMenuId(); |
|
279 |
- int grd = upMenuVO.getMenuGrd() + 1; |
|
280 |
- int sn = 1; |
|
281 |
- String mdfr = upMenuVO.getMdfr(); |
|
282 |
- for(HierachyVO hierachyVO : childList) { |
|
283 |
- // 현재 노드 수정 |
|
284 |
- MenuVO vo = new MenuVO(); |
|
285 |
- vo.setMenuId(hierachyVO.getId()); |
|
286 |
- vo.setUpMenuId(upDeptId); |
|
287 |
- vo.setMenuGrd(grd); |
|
288 |
- vo.setMenuSn(sn); |
|
289 |
- vo.setMdfr(mdfr); |
|
290 |
- result += menuDAO.menuUpdateByHierachy(vo); |
|
291 |
- |
|
292 |
- // 하위 노드 수정 |
|
293 |
- if (hierachyVO.getChildList() != null && hierachyVO.getChildList().size() > 0) { |
|
294 |
- result += updateChildNode(hierachyVO.getChildList(), vo); |
|
295 |
- } |
|
296 |
- sn++; |
|
297 |
- } |
|
298 |
- return result; |
|
299 | 443 |
} |
300 | 444 |
/** |
301 | 445 |
* @author 방선주 |
302 | 446 |
* @since 2024.06.07 |
447 |
+ * @throws CustomUpdateFailException - 수정 실패 예외 발생 시 |
|
448 |
+ * @throws DataAccessException - 데이터베이스 접근 예외 발생 시 |
|
449 |
+ * @throws NullPointerException - Null 값이 발생할 경우 |
|
450 |
+ * @throws Exception - 그 외 예외 발생 시 |
|
451 |
+ * |
|
303 | 452 |
* 게시판 관리에서 게시판 삭제 시 게시판 메뉴 미노출로 변경 |
304 | 453 |
*/ |
305 | 454 |
@Override |
306 | 455 |
@CacheEvict(value = "findByMenuWithRouter", allEntries = true) |
307 |
- public int bbsMngMenuDelete(MenuVO menuVO) throws Exception { |
|
308 |
- return menuDAO.bbsMngMenuDelete(menuVO); |
|
456 |
+ public int bbsMngMenuDelete(MenuVO menuVO) { |
|
457 |
+ try { |
|
458 |
+ return menuDAO.bbsMngMenuDelete(menuVO); |
|
459 |
+ } catch (CustomUpdateFailException cufe){ |
|
460 |
+ throw cufe; |
|
461 |
+ } catch (DataAccessException dae) { |
|
462 |
+ throw dae; |
|
463 |
+ } catch (NullPointerException ne) { |
|
464 |
+ throw ne; |
|
465 |
+ } catch (Exception e) { |
|
466 |
+ throw new RuntimeException(e); |
|
467 |
+ } |
|
309 | 468 |
} |
310 | 469 |
} |
--- src/main/java/com/takensoft/cms/menu/service/MenuAuthorService.java
+++ src/main/java/com/takensoft/cms/menu/service/MenuAuthorService.java
... | ... | @@ -5,30 +5,37 @@ |
5 | 5 |
import java.util.*; |
6 | 6 |
|
7 | 7 |
/** |
8 |
- * @author : 박정하 |
|
9 |
- * @since : 2024.05.07 |
|
8 |
+ * @author 박정하 |
|
9 |
+ * @since 2024.05.07 |
|
10 |
+ * @modification |
|
11 |
+ * since | author | description |
|
12 |
+ * 2024.05.07 | 박정하 | 최초 등록 |
|
10 | 13 |
* |
11 |
- * 메뉴 권한 정보 관련 인터페이스 |
|
14 |
+ * 메뉴 권한 정보 관련 인터페이스 |
|
12 | 15 |
*/ |
13 | 16 |
public interface MenuAuthorService { |
14 | 17 |
/** |
15 |
- * @author takensoft |
|
16 |
- * @since 2024.04.15 |
|
18 |
+ * @param menuId - 메뉴 ID, |
|
19 |
+ * @param type - 메뉴 타입 |
|
20 |
+ * @return int - 등록 결과 |
|
21 |
+ * |
|
17 | 22 |
* 메뉴별 권한 등록 |
18 | 23 |
*/ |
19 |
- public int menuAuthrtSave(String menuId, String type); |
|
24 |
+ int menuAuthrtSave(String menuId, String type); |
|
20 | 25 |
|
21 | 26 |
/** |
22 |
- * @author 박정하 |
|
23 |
- * @since 2024.05.02 |
|
27 |
+ * @param params - 메뉴 권한 정보 |
|
28 |
+ * @return int - 수정 결과 |
|
29 |
+ * |
|
24 | 30 |
* 메뉴 권한 수정 |
25 | 31 |
*/ |
26 |
- public int updateMenuAuthrtProc(HashMap<String, Object> params) throws Exception; |
|
32 |
+ int updateMenuAuthrtProc(HashMap<String, Object> params); |
|
27 | 33 |
|
28 | 34 |
/** |
29 |
- * @author 박정하 |
|
30 |
- * @since 2024.05.08 |
|
35 |
+ * @param authorVO - 권한 정보 |
|
36 |
+ * @return List<HashMap<String, Object>> - 메뉴 권한 목록 |
|
37 |
+ * |
|
31 | 38 |
* 메뉴 권한 조회 |
32 | 39 |
*/ |
33 |
- public List<HashMap<String, Object>> findAll(AuthorVO authorVO) throws Exception; |
|
40 |
+ List<HashMap<String, Object>> findAll(AuthorVO authorVO); |
|
34 | 41 |
}(No newline at end of file) |
--- src/main/java/com/takensoft/cms/menu/service/MenuService.java
+++ src/main/java/com/takensoft/cms/menu/service/MenuService.java
... | ... | @@ -12,91 +12,113 @@ |
12 | 12 |
import java.util.List; |
13 | 13 |
|
14 | 14 |
/** |
15 |
- * @author : takensoft |
|
16 |
- * @since : 2024.04.01 |
|
15 |
+ * @author takensoft |
|
16 |
+ * @since 2024.04.01 |
|
17 |
+ * @modification |
|
18 |
+ * since | author | description |
|
19 |
+ * 2024.04.01 | takensoft | 최초 등록 |
|
17 | 20 |
* |
18 | 21 |
* 메뉴 정보 관련 인터페이스 |
19 | 22 |
*/ |
20 | 23 |
public interface MenuService { |
24 |
+ |
|
21 | 25 |
/** |
22 |
- * @author takensoft |
|
23 |
- * @since 2024.04.08 |
|
26 |
+ * @param menuVO - 메뉴 정보 |
|
27 |
+ * @return int - 등록 결과 |
|
28 |
+ * |
|
24 | 29 |
* 메뉴 등록 |
25 | 30 |
*/ |
26 |
- public int menuSave(MenuVO menuVO) throws Exception; |
|
31 |
+ int menuSave(MenuVO menuVO); |
|
27 | 32 |
|
28 | 33 |
/** |
29 |
- * @author takensoft |
|
30 |
- * @since 2024.04.08 |
|
34 |
+ * @param |
|
35 |
+ * @return List<MenuVO> - 전체 메뉴 정보 |
|
36 |
+ * |
|
31 | 37 |
* 전체 메뉴 조회 |
32 | 38 |
*/ |
33 |
- public List<MenuVO> findAll() throws Exception; |
|
39 |
+ List<MenuVO> findAll(); |
|
34 | 40 |
|
35 | 41 |
/** |
36 |
- * @author takensoft |
|
37 |
- * @since 2024.04.08 |
|
42 |
+ * @param menuId - 메뉴 ID |
|
43 |
+ * @return List<MenuVO> - 하위 메뉴 정보 |
|
44 |
+ * |
|
38 | 45 |
* 하위 메뉴 조회 |
39 | 46 |
*/ |
40 |
- public List<MenuVO> findByChildMenu(String menuId) throws Exception; |
|
47 |
+ List<MenuVO> findByChildMenu(String menuId); |
|
41 | 48 |
|
42 | 49 |
/** |
43 |
- * @author takensoft |
|
44 |
- * @since 2024.04.08 |
|
50 |
+ * @param menuId - 메뉴 ID |
|
51 |
+ * @return MenuVO - 메뉴 정보 |
|
52 |
+ * |
|
45 | 53 |
* 메뉴 조회 |
46 | 54 |
*/ |
47 |
- public MenuVO findByMenu(String menuId) throws Exception; |
|
55 |
+ MenuVO findByMenu(String menuId); |
|
48 | 56 |
|
49 | 57 |
/** |
50 |
- * @author takensoft |
|
51 |
- * @since 2024.04.09 |
|
58 |
+ * @param menuVO - 메뉴 정보 |
|
59 |
+ * @return int - 수정 결과 |
|
60 |
+ * |
|
52 | 61 |
* 메뉴 수정 |
53 | 62 |
*/ |
54 |
- public int MenuUpdate(MenuVO menuVO) throws Exception; |
|
63 |
+ int MenuUpdate(MenuVO menuVO); |
|
55 | 64 |
|
56 | 65 |
/************************************** Hierachy 전용 **************************************/ |
66 |
+ |
|
57 | 67 |
/** |
58 |
- * @author takensoft |
|
59 |
- * @since 2024.04.25 |
|
60 |
- * 최상위 코드 조회 |
|
68 |
+ * @param |
|
69 |
+ * @return List<HierachyVO> - 최상위 메뉴 목록 |
|
70 |
+ * |
|
71 |
+ * 최상위 메뉴 조회 |
|
61 | 72 |
*/ |
62 |
- public List<HierachyVO> findByTopNode() throws Exception; |
|
73 |
+ List<HierachyVO> findByTopNode(); |
|
74 |
+ |
|
63 | 75 |
/** |
64 |
- * @author takensoft |
|
65 |
- * @since 2024.04.25 |
|
76 |
+ * @param id - 메뉴 ID |
|
77 |
+ * @return List<HierachyVO> - 하위 메뉴 정보 |
|
78 |
+ * |
|
66 | 79 |
* 하위 코드 조회 |
67 | 80 |
*/ |
68 |
- public List<HierachyVO> findChildNode(String id) throws Exception; |
|
81 |
+ List<HierachyVO> findChildNode(String id); |
|
69 | 82 |
/************************************** Hierachy 전용 **************************************/ |
70 | 83 |
|
71 | 84 |
/** |
72 |
- * @author 박정하 |
|
73 |
- * @since 2024.04.29 |
|
85 |
+ * @param menuVO - 메뉴 정보 |
|
86 |
+ * @return int - 삭제 결과 |
|
87 |
+ * |
|
74 | 88 |
* 메뉴 정보 삭제 |
75 | 89 |
*/ |
76 |
- public int menuDelete(MenuVO menuVO) throws Exception; |
|
77 |
- /** |
|
78 |
- * @author takensoft |
|
79 |
- * @since 2024.05.09 |
|
80 |
- * 메뉴 조회(시스템용) |
|
81 |
- */ |
|
82 |
- public List<SysMenuVO> findByMenuWithRouter(MenuRequest menuRequest); |
|
90 |
+ int menuDelete(MenuVO menuVO); |
|
83 | 91 |
|
84 | 92 |
/** |
85 |
- * @author 박정하 |
|
86 |
- * @since 2024.05.09 |
|
93 |
+ * @param menuRequest - 메뉴 조회 param 객체 |
|
94 |
+ * @return int - List<SysMenuVO> - 메뉴 목록 |
|
95 |
+ * |
|
96 |
+ * 메뉴 조회(시스템용) |
|
97 |
+ */ |
|
98 |
+ List<SysMenuVO> findByMenuWithRouter(MenuRequest menuRequest); |
|
99 |
+ |
|
100 |
+ /** |
|
101 |
+ * @param deptList - 부서 리스트 |
|
102 |
+ * @return int - 수정 결과 |
|
103 |
+ * |
|
87 | 104 |
* 메뉴 목록 수정 |
88 | 105 |
*/ |
89 |
- public int updateList(List<HierachyVO> deptList) throws Exception; |
|
106 |
+ int updateList(List<HierachyVO> deptList); |
|
107 |
+ |
|
90 | 108 |
/** |
91 |
- * @author 박정하 |
|
92 |
- * @since 2024.05.10 |
|
109 |
+ * @param childList - 하위 부서 목록 |
|
110 |
+ * @param menuVO - 메뉴 정보 |
|
111 |
+ * @return int - 등록 결과 |
|
112 |
+ * |
|
93 | 113 |
* 하위 메뉴 수정 |
94 | 114 |
*/ |
95 |
- public int updateChildNode(List<HierachyVO> childList, MenuVO menuVO) throws Exception; |
|
115 |
+ int updateChildNode(List<HierachyVO> childList, MenuVO menuVO); |
|
116 |
+ |
|
96 | 117 |
/** |
97 |
- * @author 방선주 |
|
98 |
- * @since 2024.06.07 |
|
99 |
- * 게시판 관리에서 게시판 삭제 시 게시판 메뉴 미노출로 변경 |
|
118 |
+ * @param menuVO - 메뉴 정보 |
|
119 |
+ * @return int - 수정 결과 |
|
120 |
+ * |
|
121 |
+ * 게시판 삭제 시 게시판 메뉴 미노출 |
|
100 | 122 |
*/ |
101 |
- public int bbsMngMenuDelete(MenuVO menuVO) throws Exception; |
|
123 |
+ int bbsMngMenuDelete(MenuVO menuVO); |
|
102 | 124 |
} |
--- src/main/java/com/takensoft/cms/menu/vo/MenuRequest.java
+++ src/main/java/com/takensoft/cms/menu/vo/MenuRequest.java
... | ... | @@ -10,12 +10,6 @@ |
10 | 10 |
/** |
11 | 11 |
* @author : takensoft |
12 | 12 |
* @since : 2024.05.09 |
13 |
- * |
|
14 |
- * 메뉴 조회 파라미터 |
|
15 |
- */ |
|
16 |
-/** |
|
17 |
- * @author : takensoft |
|
18 |
- * @since : 2024.05.09 |
|
19 | 13 |
* @modification |
20 | 14 |
* since | author | description |
21 | 15 |
* 2024.05.09 | takensoft | 최초 등록 |
--- src/main/java/com/takensoft/cms/menu/web/MenuAuthorController.java
+++ src/main/java/com/takensoft/cms/menu/web/MenuAuthorController.java
... | ... | @@ -31,19 +31,18 @@ |
31 | 31 |
@RequiredArgsConstructor |
32 | 32 |
@RequestMapping(value = "/admin/menuAuthor") |
33 | 33 |
public class MenuAuthorController { |
34 |
+ |
|
34 | 35 |
private final MenuAuthorService menuAuthorService; |
35 | 36 |
private final ResponseUtil resUtil; |
37 |
+ |
|
36 | 38 |
/** |
37 |
- * @author 박정하 |
|
38 |
- * @since 2024.05.02 |
|
39 |
- * @param |
|
40 |
- * @return |
|
41 |
- * @throws Exception |
|
39 |
+ * @param authorVO - 권한 정보를 포함하는 VO |
|
40 |
+ * @return ResponseEntity - 메뉴 권한 목록 조회 결과를 포함하는 ResponseEntity |
|
42 | 41 |
* |
43 | 42 |
* 메뉴 권한 목록 조회 |
44 | 43 |
*/ |
45 | 44 |
@PostMapping(value = "/findAllByAuthor.json") |
46 |
- public ResponseEntity<?> findAllByAuthor(@RequestBody AuthorVO authorVO) throws Exception { |
|
45 |
+ public ResponseEntity<?> findAllByAuthor(@RequestBody AuthorVO authorVO) { |
|
47 | 46 |
List<HashMap<String, Object>> result = menuAuthorService.findAll(authorVO); |
48 | 47 |
|
49 | 48 |
// 응답 처리 |
... | ... | @@ -51,16 +50,13 @@ |
51 | 50 |
} |
52 | 51 |
|
53 | 52 |
/** |
54 |
- * @author 박정하 |
|
55 |
- * @since 2024.05.02 |
|
56 |
- * @param params |
|
57 |
- * @return |
|
58 |
- * @throws Exception |
|
53 |
+ * @param params - 메뉴 권한 정보를 포함하는 HashMap |
|
54 |
+ * @return ResponseEntity - 메뉴 권한 수정 결과를 포함하는 ResponseEntity |
|
59 | 55 |
* |
60 | 56 |
* 메뉴 권한 수정 |
61 | 57 |
*/ |
62 | 58 |
@PostMapping(value = "/updateMenuAuthrtProc.json") |
63 |
- public ResponseEntity<?> updateMenuAuthrtProc(@RequestBody HashMap<String, Object> params) throws Exception { |
|
59 |
+ public ResponseEntity<?> updateMenuAuthrtProc(@RequestBody HashMap<String, Object> params) { |
|
64 | 60 |
// 메뉴 권한 수정 |
65 | 61 |
int result = menuAuthorService.updateMenuAuthrtProc(params); |
66 | 62 |
|
--- src/main/java/com/takensoft/cms/menu/web/MenuController.java
+++ src/main/java/com/takensoft/cms/menu/web/MenuController.java
... | ... | @@ -28,8 +28,11 @@ |
28 | 28 |
* @modification |
29 | 29 |
* since | author | description |
30 | 30 |
* 2024.04.01 | takensoft | 최초 등록 |
31 |
+ * 2024.04.08 | takensoft | SaveProc, findAll, findByMenu, updateProc, deleteProc 추가 |
|
32 |
+ * 2024.04.29 | 박정하 | deleteProc 추가 |
|
33 |
+ * 2024.05.10 | 박정하 | updateListProc 추가 |
|
31 | 34 |
* |
32 |
- * 메뉴 정보 관련 컨트롤러 |
|
35 |
+ * 메뉴 정보 관련 Controller |
|
33 | 36 |
*/ |
34 | 37 |
@RestController |
35 | 38 |
@RequiredArgsConstructor |
... | ... | @@ -42,16 +45,13 @@ |
42 | 45 |
private final CodeManageService codeManageService; |
43 | 46 |
|
44 | 47 |
/** |
45 |
- * @author takensoft |
|
46 |
- * @since 2024.04.08 |
|
47 |
- * @param menuVO |
|
48 |
- * @return |
|
49 |
- * @throws Exception |
|
48 |
+ * @param menuVO - 메뉴 정보 |
|
49 |
+ * @return ResponseEntity - 메뉴 등록 결과를 포함하는 ResponseEntity |
|
50 | 50 |
* |
51 | 51 |
* 메뉴 등록 |
52 | 52 |
*/ |
53 | 53 |
@PostMapping(value = "/saveProc.json") |
54 |
- public ResponseEntity<?> SaveProc(@RequestBody MenuVO menuVO) throws Exception { |
|
54 |
+ public ResponseEntity<?> SaveProc(@RequestBody MenuVO menuVO) { |
|
55 | 55 |
// 메뉴 등록 |
56 | 56 |
int result = menuService.menuSave(menuVO); |
57 | 57 |
|
... | ... | @@ -64,16 +64,13 @@ |
64 | 64 |
} |
65 | 65 |
|
66 | 66 |
/** |
67 |
- * @author takensoft |
|
68 |
- * @since 2024.04.08 |
|
69 | 67 |
* @param |
70 |
- * @return |
|
71 |
- * @throws Exception |
|
68 |
+ * @return ResponseEntity - 메뉴 조회 결과를 포함하는 ResponseEntity |
|
72 | 69 |
* |
73 | 70 |
* 메뉴 목록 조회 (관리자 페이지용) |
74 | 71 |
*/ |
75 | 72 |
@GetMapping(value = "/findAll.json") |
76 |
- public ResponseEntity<?> findAll() throws Exception { |
|
73 |
+ public ResponseEntity<?> findAll() { |
|
77 | 74 |
// Tree용 |
78 | 75 |
List<HierachyVO> hierachyList = menuService.findByTopNode(); |
79 | 76 |
|
... | ... | @@ -90,16 +87,13 @@ |
90 | 87 |
} |
91 | 88 |
|
92 | 89 |
/** |
93 |
- * @author takensoft |
|
94 |
- * @since 2024.04.08 |
|
95 |
- * @param menuVO |
|
96 |
- * @return |
|
97 |
- * @throws Exception |
|
90 |
+ * @param menuVO - 메뉴 정보 |
|
91 |
+ * @return ResponseEntity - 메뉴 상세 조회 결과를 포함하는 ResponseEntity |
|
98 | 92 |
* |
99 | 93 |
* 메뉴 상세 조회 (관리자 페이지용) |
100 | 94 |
*/ |
101 | 95 |
@PostMapping("/findByMenu.json") |
102 |
- public ResponseEntity<?> findByMenu(@RequestBody MenuVO menuVO) throws Exception { |
|
96 |
+ public ResponseEntity<?> findByMenu(@RequestBody MenuVO menuVO) { |
|
103 | 97 |
// 메뉴 조회 |
104 | 98 |
MenuVO result = menuService.findByMenu(menuVO.getMenuId()); |
105 | 99 |
// 응답 처리 |
... | ... | @@ -107,16 +101,13 @@ |
107 | 101 |
} |
108 | 102 |
|
109 | 103 |
/** |
110 |
- * @author takensoft |
|
111 |
- * @since 2024.04.08 |
|
112 |
- * @param menuVO |
|
113 |
- * @return |
|
114 |
- * @throws Exception |
|
104 |
+ * @param menuVO - 메뉴 정보 |
|
105 |
+ * @return ResponseEntity - 메뉴 정보 수정 결과를 포함하는 ResponseEntity |
|
115 | 106 |
* |
116 | 107 |
* 메뉴 정보 수정 |
117 | 108 |
*/ |
118 | 109 |
@PostMapping(value = "/updateProc.json") |
119 |
- public ResponseEntity<?> updateProc(@RequestBody MenuVO menuVO) throws Exception { |
|
110 |
+ public ResponseEntity<?> updateProc(@RequestBody MenuVO menuVO){ |
|
120 | 111 |
// 메뉴 등록 |
121 | 112 |
int result = menuService.MenuUpdate(menuVO); |
122 | 113 |
|
... | ... | @@ -132,16 +123,13 @@ |
132 | 123 |
} |
133 | 124 |
|
134 | 125 |
/** |
135 |
- * @author 박정하 |
|
136 |
- * @since 2024.04.29 |
|
137 |
- * @param menuVO |
|
138 |
- * @return |
|
139 |
- * @throws Exception |
|
126 |
+ * @param menuVO - 메뉴 정보 |
|
127 |
+ * @return ResponseEntity - 메뉴 정보 삭제 결과를 포함하는 ResponseEntity |
|
140 | 128 |
* |
141 | 129 |
* 메뉴 정보 삭제 |
142 | 130 |
*/ |
143 | 131 |
@PostMapping(value = "/deleteProc.json") |
144 |
- public ResponseEntity<?> deleteProc(@RequestBody MenuVO menuVO) throws Exception { |
|
132 |
+ public ResponseEntity<?> deleteProc(@RequestBody MenuVO menuVO){ |
|
145 | 133 |
// 메뉴 삭제 |
146 | 134 |
int result = menuService.menuDelete(menuVO); |
147 | 135 |
|
... | ... | @@ -158,16 +146,13 @@ |
158 | 146 |
} |
159 | 147 |
|
160 | 148 |
/** |
161 |
- * @author 박정하 |
|
162 |
- * @since 2024.05.10 |
|
163 |
- * @param menuList |
|
164 |
- * @return |
|
165 |
- * @throws Exception |
|
149 |
+ * @param menuList - 메뉴 목록 |
|
150 |
+ * @return ResponseEntity - 메뉴 정보 수정 결과를 포함하는 ResponseEntity |
|
166 | 151 |
* |
167 | 152 |
* 메뉴 목록 수정 |
168 | 153 |
*/ |
169 | 154 |
@PostMapping(value = "/updateListProc.json") |
170 |
- public ResponseEntity<?> updateListProc(@RequestBody List<HierachyVO> menuList) throws Exception { |
|
155 |
+ public ResponseEntity<?> updateListProc(@RequestBody List<HierachyVO> menuList){ |
|
171 | 156 |
// 메뉴 목록 수정 |
172 | 157 |
int result = menuService.updateList(menuList); |
173 | 158 |
|
--- src/main/java/com/takensoft/cms/menu/web/SystemMenuController.java
+++ src/main/java/com/takensoft/cms/menu/web/SystemMenuController.java
... | ... | @@ -29,7 +29,7 @@ |
29 | 29 |
* since | author | description |
30 | 30 |
* 2024.04.30 | takensoft | 최초 등록 |
31 | 31 |
* |
32 |
- * 메뉴 정보 관련 컨트롤러(사용자단용) |
|
32 |
+ * 메뉴 정보 관련 Controller(사용자단용) |
|
33 | 33 |
*/ |
34 | 34 |
@RestController |
35 | 35 |
@RequiredArgsConstructor |
... | ... | @@ -39,17 +39,15 @@ |
39 | 39 |
|
40 | 40 |
private final MenuService menuService; |
41 | 41 |
private final ResponseUtil resUtil; |
42 |
+ |
|
42 | 43 |
/** |
43 |
- * @author takensoft |
|
44 |
- * @since 2024.04.30 |
|
45 |
- * @param |
|
46 |
- * @return |
|
47 |
- * @throws Exception |
|
44 |
+ * @param menuRequest - 메뉴 요청 정보 |
|
45 |
+ * @return ResponseEntity - 메뉴 정보 응답 ResponseEntity |
|
48 | 46 |
* |
49 | 47 |
* 메뉴 조회(홈페이지 메뉴 조회용) |
50 | 48 |
*/ |
51 | 49 |
@PostMapping(value = "/findByMenu.json") |
52 |
- public ResponseEntity<?> findByMenu(@RequestBody MenuRequest menuRequest) throws Exception { |
|
50 |
+ public ResponseEntity<?> findByMenu(@RequestBody MenuRequest menuRequest){ |
|
53 | 51 |
List<SysMenuVO> menuList = menuService.findByMenuWithRouter(menuRequest); |
54 | 52 |
HashMap<String, Object> result = new HashMap<>(); |
55 | 53 |
result.put("menuList", menuList); |
--- src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
+++ src/main/java/com/takensoft/cms/popup/service/Impl/PopupServiceImpl.java
... | ... | @@ -48,12 +48,6 @@ |
48 | 48 |
private final CodeManageService codeManageService; |
49 | 49 |
|
50 | 50 |
/** |
51 |
- * @author : 박정하 |
|
52 |
- * @since : 2024.05.13 |
|
53 |
- * |
|
54 |
- * 팝업 등록 |
|
55 |
- */ |
|
56 |
- /** |
|
57 | 51 |
* @param popupVO - 팝업 등록 정보를 포함하는 객체 |
58 | 52 |
* @param multipartFileList - 첨부파일 리스트 |
59 | 53 |
* @return HashMap<String, Object> - 등록 결과 및 팝업 ID |
... | ... | @@ -263,12 +257,6 @@ |
263 | 257 |
} |
264 | 258 |
} |
265 | 259 |
|
266 |
- /** |
|
267 |
- * @author : 박정하 |
|
268 |
- * @since : 2024.05.14 |
|
269 |
- * |
|
270 |
- * 팝업 삭제 |
|
271 |
- */ |
|
272 | 260 |
/** |
273 | 261 |
* @param popupVO - 팝업 정보 |
274 | 262 |
* @return int - 삭제 결과(0: 실패, 1: 성공) |
--- src/main/java/com/takensoft/cms/search/web/SearchController.java
+++ src/main/java/com/takensoft/cms/search/web/SearchController.java
... | ... | @@ -36,9 +36,7 @@ |
36 | 36 |
|
37 | 37 |
/** |
38 | 38 |
* @param searchVO - 검색 조건을 포함하는 VO |
39 |
- * @return ResponseEntity |
|
40 |
- * - body: 검색 결과를 포함하는 SearchResultVO |
|
41 |
- * - message: 성공 메시지 |
|
39 |
+ * @return ResponseEntity - 통합 검색 결과를 포함하는 ResponseEntity |
|
42 | 40 |
* |
43 | 41 |
* 통합 검색 |
44 | 42 |
*/ |
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?