방선주 방선주 03-17
250317 방선주 contsType 폴더 내 파일 수정
@8a5bafe8f3a36838c4485561444eae3714a3ce05
src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
--- src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
+++ src/main/java/com/takensoft/cms/contsType/dao/ContsTypeDAO.java
@@ -10,65 +10,80 @@
 
 /**
  * @author  : takensoft
- * @since   : 2024.04.17
+ * @since   :2024.04.17
+ * @modification
+ *     since    |    author    | description
+ *  2024.04.17  |   takensoft  | 최초 등록
+ *  2024.04.23  |    박정하     | findAllCnt 추가
+ *  2024.04.29  |    박정하     | findAllByExpsr 추가
+ *  2024.05.02  |   takensoft | findByContsAuthrt 추가
+ *  2025.03.13  |    방선주    | 코드 리펙토링
  *
- * 콘텐츠 유형 관리 관련 Mapper
+ * 콘텐츠 유형 관리 관련 DAO
  */
 @Mapper("contsTypeDAO")
 public interface ContsTypeDAO {
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 컨텐츠 유형 관리 객체
+     * @return int - 등록 성공 여부
+     *
      * 콘텐츠 유형 등록
      */
     int save(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 컨텐츠 유형 관리 객체
+     * @return int - 등록 수정 여부
+     *
      * 콘텐츠 유형 수정
      */
     int update(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param pagination - pagination 객체
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록
+     *
      * 콘텐츠 유형 목록 조회
      */
     List<ContsTypeVO> findAll(Pagination pagination);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 컨텐츠 유형 관리 객체
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록
+     *
      * 콘텐츠 유형 목록 조회(노출인 목록만)
      */
     List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsId - 콘텐츠 ID
+     * @return ContsTypeVO - 콘텐츠 유형 상세 조회
+     *
      * 콘텐츠 유형 상세 조회
      */
     ContsTypeVO findByContsType(String contsId);
 
     /**
-     * @author 박정하
-     * @since 2024.04.23
-     * 콘텐츠 유형 목록 갯수(관리자 페이지용)
+     * @param pagination - pagination 객체
+     * @return int - 등록 유형 목록 개수
+     *
+     * 콘텐츠 유형 목록 개수(관리자 페이지용)
      */
     int findAllCnt(Pagination pagination);
 
     /**
-     * @author 박정하
-     * @since 2024.04.29
+     * @param contsTypeVO - 컨텐츠 유형 관리 객체
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록
+     *
      * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
     List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.05.02
+     * @param
+     * @return List<ContsAuthrtVO> - 콘텐츠 권한 포함 조회 목록
+     *
      * 콘텐츠 조회(권한 포함)
      */
     List<ContsAuthrtVO> findByContsAuthrt();
src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
--- src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
+++ src/main/java/com/takensoft/cms/contsType/service/ContsTypeService.java
@@ -6,61 +6,74 @@
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-
 /**
- * @author  : takensoft
- * @since   : 2024.04.17
+ * @author takensoft
+ * @since 2024.04.17
+ * @modification
+ *     since    |    author    | description
+ *  2024.04.17  |  takensoft   | 최초 등록
+ *  2024.04.29  |    박정하     | findAllByExpsr 추가
+ *  2024.05.10  |  takensoft   | findByContsAuthrt 추가
+ *  2025.03.14  |    방선주     | 코드 리펙토링
  *
  * 콘텐츠 유형 관리 관련 인터페이스
  */
 public interface ContsTypeService {
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 VO
+     * @return HashMap<String, Object> - 콘텐츠 유형 등록 결과
+     *
      * 콘텐츠 유형 등록
      */
-    public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO) throws Exception;
+    HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 VO
+     * @return int - 콘텐츠 유형 수정 결과
+     *
      * 콘텐츠 유형 수정
      */
-    public int contsUpdate(ContsTypeVO contsTypeVO) throws Exception;
+    int contsUpdate(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param params - pagination 객체
+     * @return int - Map<String, Object> - 콘텐츠 유형 목록 조회 결과
+     *
      * 콘텐츠 유형 목록 조회
      */
-    public Map<String, Object> findAll(Map<String, String> params) throws Exception;
+    Map<String, Object> findAll(Map<String, String> params);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 VO
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록
+     *
      * 콘텐츠 유형 목록 조회(노출인 목록만)
      */
-    public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception;
+    List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO);
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsId - 콘텐츠 ID
+     * @return ContsTypeVO - 콘텐츠 유형 상세 조회 결과
+     *
      * 콘텐츠 유형 상세 조회
      */
-    public ContsTypeVO findByContsType(String contsId) throws Exception;
+    ContsTypeVO findByContsType(String contsId);
 
     /**
-     * @author 박정하
-     * @since 2024.04.29
+     * @param contsTypeVO - 콘텐츠 유형 VO
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록
+     *
      * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
-    public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO) throws Exception;
+    List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO);
+
 
     /**
-     * @author takensoft
-     * @since 2024.05.02
-     * 콘텐츠 조회(권한 포함)
+     * @param
+     * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록
+     *
+     * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
-    public List<ContsAuthrtVO> findByContsAuthrt() throws Exception;
+    List<ContsAuthrtVO> findByContsAuthrt();
 }
src/main/java/com/takensoft/cms/contsType/service/Impl/ContsTypeServiceImpl.java
--- 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 @@
 import com.takensoft.cms.menu.vo.MenuAuthorVO;
 import com.takensoft.cms.menu.vo.MenuVO;
 import com.takensoft.common.Pagination;
+import com.takensoft.common.exception.CustomInsertFailException;
+import com.takensoft.common.exception.CustomUpdateFailException;
 import com.takensoft.common.idgen.service.IdgenService;
 import com.takensoft.common.util.JWTUtil;
 import lombok.RequiredArgsConstructor;
 import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
+import org.springframework.dao.DataAccessException;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -24,15 +27,24 @@
 
 /**
  * @author  : takensoft
- * @since   : 2024.04.17
+ * @since   :2024.04.17
+ * @modification
+ *     since    |    author    | description
+ *  2024.04.17  |  takensoft   | 최초 등록
+ *  2024.04.29  |    박정하     | findAllByExpsr 추가
+ *  2024.05.02  |  takensoft   | findByContsAuthrt 추가
+ *  2024.05.08  |  takensoft   | groupAndShareAuth, findMostComprehensiveAuth 추가
+ *  2025.03.14  |    방선주     | 코드 리펙토링
+ *
+ * EgovAbstractServiceImpl - 전자정부 프레임워크에서 제공하는 추상 서비스 구현 클래스
+ * ContsTypeService - 콘텐츠 유형 관리 관련 인터페이스 상속
  *
  * 콘텐츠 유형 관리 관련 구현체
- * EgovAbstractServiceImpl : 전자정부 상속
- * ContsTypeService : 콘텐츠 유형 관리 관련 인터페이스 상속
  */
 @Service("contsTypeService")
 @RequiredArgsConstructor
 public class ContsTypeServiceImpl extends EgovAbstractServiceImpl implements ContsTypeService {
+
     private final ContsTypeDAO contsTypeDAO;
     private final BbsRouterDAO bbsRouterDAO;
     private final IdgenService contsTypeIdgn;
@@ -41,192 +53,296 @@
     private final MenuDAO menuDAO;
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 객체
+     * @return HashMap<String, Object> - 콘텐츠 유형 등록 결과값
+     * @throws CustomInsertFailException - 콘텐츠 유형 등록 실패 시
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws NullPointerException - Null 값이 발생할 경우
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 등록
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
     @CacheEvict(value = "routerAuthInfo", allEntries = true)
-    public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO) throws Exception {
-        HashMap<String, Object> result = new HashMap<>();
+    public HashMap<String, Object> contsSave(ContsTypeVO contsTypeVO){
+        try {
+            HashMap<String, Object> result = new HashMap<>();
 
-        // 콘텐츠 유형 아이디 생성
-        String contsId = contsTypeIdgn.getNextStringId();
-        contsTypeVO.setContsId(contsId);
+            // 콘텐츠 유형 아이디 생성
+            String contsId = contsTypeIdgn.getNextStringId();
+            contsTypeVO.setContsId(contsId);
 
-        // 등록된 토큰에서 사용자 정보 조회
-        contsTypeVO.setRgtr(jwtUtil.getWriter());
+            // 등록된 토큰에서 사용자 정보 조회
+            contsTypeVO.setRgtr(jwtUtil.getWriter());
 
-        // 콘텐츠 유형 등록
-        int insertResult = contsTypeDAO.save(contsTypeVO);
+            // 콘텐츠 유형 등록 결과
+            int insertResult = contsTypeDAO.save(contsTypeVO);
+            if (insertResult == 0) {
+                throw new CustomInsertFailException("콘텐츠 유형 등록에 실패했습니다.");
+            }
 
-        // 메뉴 등록
-        if (contsTypeVO.getExpsrYn().equals("Y")) {
-            MenuVO menuVO = new MenuVO();
-            menuVO.setUpMenuId("MENU_000000000000018"); // 상위메뉴아이디(콘텐츠 관리 메뉴 아이디)
-            menuVO.setMenuNm(contsTypeVO.getContsKornNm()); // 메뉴명
-            menuVO.setMenuType("conts"); // 메뉴타입
-            menuVO.setMenuTypeCtgry(contsId); // 메뉴타입항목(콘텐츠 유형 아이디)
-            menuVO.setLinkType("0"); // 링크유형(현재창)
-            menuVO.setDgstfnExmnUseYn("N"); // 만족도조사사용여부(미노출)
-            menuVO.setMenuExpsrYn("Y"); // 메뉴노출여부(노출)
-            menuVO.setMenuUser("A"); // 메뉴사용자(관리자)
-            menuVO.setSysPvsnYn("0"); // 시스템제공여부(시스템등록)
-            menuService.menuSave(menuVO);
+            // 메뉴 등록
+            if (contsTypeVO.getExpsrYn().equals("Y")) {
+                MenuVO menuVO = new MenuVO();
+                menuVO.setUpMenuId("MENU_000000000000018"); // 상위메뉴아이디(콘텐츠 관리 메뉴 아이디)
+                menuVO.setMenuNm(contsTypeVO.getContsKornNm()); // 메뉴명
+                menuVO.setMenuType("conts"); // 메뉴타입
+                menuVO.setMenuTypeCtgry(contsId); // 메뉴타입항목(콘텐츠 유형 아이디)
+                menuVO.setLinkType("0"); // 링크유형(현재창)
+                menuVO.setDgstfnExmnUseYn("N"); // 만족도조사사용여부(미노출)
+                menuVO.setMenuExpsrYn("Y"); // 메뉴노출여부(노출)
+                menuVO.setMenuUser("A"); // 메뉴사용자(관리자)
+                menuVO.setSysPvsnYn("0"); // 시스템제공여부(시스템등록)
+                int insertMenu = menuService.menuSave(menuVO);
+                if (insertMenu == 0) {
+                    throw new CustomInsertFailException("메뉴 등록에 실패했습니다.");
+                }
+            }
+
+            result.put("contsId", contsId);
+            result.put("result", insertResult);
+            return result;
+        } catch (CustomInsertFailException cife) {
+            throw cife;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (NullPointerException npe) {
+            throw npe;
+        } catch (Exception e) {
+            throw e;
         }
-        
-        result.put("contsId", contsId);
-        result.put("result", insertResult);
-        return result;
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 객체
+     * @return int - 콘텐츠 유형 수정 결과값
+     * @throws CustomUpdateFailException - 수정 실패 예외 발생 시
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 수정
      */
     @Override
     @CacheEvict(value = "routerAuthInfo", allEntries = true)
-    public int contsUpdate(ContsTypeVO contsTypeVO) throws Exception {
-        int result = 0;
-        // 등록된 토큰에서 사용자 정보 조회
-        contsTypeVO.setMdfr(jwtUtil.getWriter());
-        result += contsTypeDAO.update(contsTypeVO);
+    @Transactional
+    public int contsUpdate(ContsTypeVO contsTypeVO){
+        try {
+            // 콘텐츠 유형 수정 결과
+            int result = 0;
+            // 등록된 토큰에서 사용자 정보 조회
+            contsTypeVO.setMdfr(jwtUtil.getWriter());
 
-        // 메뉴 수정
-        menuDAO.updateByContsId(contsTypeVO);
-        return result;
+            result = contsTypeDAO.update(contsTypeVO);
+            if (result == 0) {
+                throw new CustomUpdateFailException("콘텐츠 유형 수정에 실패했습니다.");
+            }
+            // 메뉴 수정
+            int updateMenu = menuDAO.updateByContsId(contsTypeVO);
+            if (updateMenu == 0) {
+                throw new CustomUpdateFailException("메뉴 수정에 실패했습니다.");
+            }
+            return result;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (NullPointerException npe) {
+            throw npe;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param params - pagination 객체
+     * @return Map<String, Object> - 콘텐츠 유형 목록 조회 결과값
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 목록 조회
      */
     @Override
-    public Map<String, Object> findAll(Map<String, String> params) throws Exception {
-        Map<String, Object> result = new HashMap<>();
-        Pagination search = new Pagination(0, params);
-        int cnt = contsTypeDAO.findAllCnt(search);
-        Pagination pagination = new Pagination(cnt, params);
-        List<ContsTypeVO> list = contsTypeDAO.findAll(pagination);
+    public Map<String, Object> findAll(Map<String, String> params){
+        try {
+            Map<String, Object> result = new HashMap<>();
+            Pagination search = new Pagination(0, params);
+            int cnt = contsTypeDAO.findAllCnt(search);
+            Pagination pagination = new Pagination(cnt, params);
+            List<ContsTypeVO> list = contsTypeDAO.findAll(pagination);
 
-        result.put("list", list);
-        result.put("pagination", pagination);
-        return result;
+            result.put("list", list);
+            result.put("pagination", pagination);
+            return result;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsTypeVO - 콘텐츠 유형 객체
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록 조회 결과값
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 목록 조회(노출인 목록만)
      */
     @Override
-    public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception {
-        return contsTypeDAO.findByContsTypeSys(contsTypeVO);
+    public List<ContsTypeVO> findByContsTypeSys(ContsTypeVO contsTypeVO){
+        try {
+            return contsTypeDAO.findByContsTypeSys(contsTypeVO);
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
+     * @param contsId - 콘텐츠 유형 아이디
+     * @return ContsTypeVO - 콘텐츠 유형 객체
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 상세 조회
      */
     @Override
-    public ContsTypeVO findByContsType(String contsId) throws Exception {
-        ContsTypeVO contsTypeVO = new ContsTypeVO();
+    public ContsTypeVO findByContsType(String contsId){
+        try {
+            ContsTypeVO contsTypeVO = new ContsTypeVO();
 
-        if (contsId != null) {
-            contsTypeVO = contsTypeDAO.findByContsType(contsId);
-        }
+            if (contsId != null) {
+                contsTypeVO = contsTypeDAO.findByContsType(contsId);
+            }
 
-        // 메뉴노출 기본값
-        if (contsTypeVO.getExpsrYn() == null) {
-            contsTypeVO.setExpsrYn("N");
-        }
-        // 사용여부 기본값
-        if (contsTypeVO.getUseYn() == null) {
-            contsTypeVO.setUseYn("Y");
-        }
+            // 메뉴노출 기본값
+            if (contsTypeVO.getExpsrYn() == null) {
+                contsTypeVO.setExpsrYn("N");
+            }
+            // 사용여부 기본값
+            if (contsTypeVO.getUseYn() == null) {
+                contsTypeVO.setUseYn("Y");
+            }
 
-        return contsTypeVO;
+            return contsTypeVO;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author 박정하
-     * @since 2024.04.29
+     * @param contsTypeVO - 콘텐츠 유형 객체
+     * @return List<ContsTypeVO> - 콘텐츠 유형 목록 조회 결과값
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
     @Override
-    public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO) throws Exception {
-        return contsTypeDAO.findAllByExpsr(contsTypeVO);
+    public List<ContsTypeVO> findAllByExpsr(ContsTypeVO contsTypeVO){
+        try {
+            return contsTypeDAO.findAllByExpsr(contsTypeVO);
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author takensoft
-     * @since 2024.05.02
-     * 콘텐츠 조회(권한 포함)
+     * @param
+     * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 조회 결과값
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
+     * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
     @Override
     @Cacheable(value = "routerAuthInfo", key = "'routerAuth'")
-    public List<ContsAuthrtVO> findByContsAuthrt() throws Exception {
-        // 콘텐츠(라우터)정보 조회
-        List<ContsAuthrtVO> list = contsTypeDAO.findByContsAuthrt();
-        // 권한 공유
-        List<ContsAuthrtVO> result = groupAndShareAuth(list);
+    public List<ContsAuthrtVO> findByContsAuthrt(){
+        try {
+            // 콘텐츠(라우터)정보 조회
+            List<ContsAuthrtVO> list = contsTypeDAO.findByContsAuthrt();
+            // 권한 공유
+            List<ContsAuthrtVO> result = groupAndShareAuth(list);
 
-        // 게시판 라우터 정보 조회
-        List<ContsAuthrtVO> bbsList = bbsRouterDAO.findByBbsRouterAuthrt();
-        result.addAll(bbsList);
+            // 게시판 라우터 정보 조회
+            List<ContsAuthrtVO> bbsList = bbsRouterDAO.findByBbsRouterAuthrt();
+            result.addAll(bbsList);
 
-        return result;
+            return result;
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author toakensoft
-     * @since 2024.05.08
+     * @param routes - 라우터 정보 목록
+     * @return List<ContsAuthrtVO> - 콘텐츠 유형과 권한 정보 목록 조회 결과값
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
      * 라우터의 특정경로로 그룹화하여 각 그룹 내에서 권한을 공유
      */
     private List<ContsAuthrtVO> groupAndShareAuth(List<ContsAuthrtVO> routes) {
-        // 경로의 특정 기준점으로 라우터를 그룹화
-        Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream()
-                .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출
+        try {
+            // 경로의 특정 기준점으로 라우터를 그룹화
+            Map<String, List<ContsAuthrtVO>> groupedRoutes = routes.stream()
+                    .collect(Collectors.groupingBy(route -> route.getPageCrs().substring(0, route.getPageCrs().lastIndexOf('/')))); // 마지막 슬래시까지 포함된 경로 추출
 
-        /* key */
+            /* key */
 //        Iterator<String> keys = groupedRoutes.keySet().iterator();
 //        while(keys.hasNext()) {
 //            String key = keys.next();
 //            System.out.println("key : " + key);
 //        }
-        /* key */
+            /* key */
 
-        // 그룹화된 각 경로에 대해 권한 정보 공유
-        groupedRoutes.forEach((basePath, routeGroup) -> {
-            List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회
-            // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정
-            routeGroup.forEach(route -> {
-                if(route.getAuthrtList().isEmpty()) {
-                    route.setAuthrtList(sharedAuth);
-                }
+            // 그룹화된 각 경로에 대해 권한 정보 공유
+            groupedRoutes.forEach((basePath, routeGroup) -> {
+                List<MenuAuthorVO> sharedAuth = findMostComprehensiveAuth(routeGroup); // 그룹 내에서 가장 완전한 권한 정보 조회
+                // 그룹의 모든 라우트에 권한 정보가 없으면 공유된 권한 정보로 설정
+                routeGroup.forEach(route -> {
+                    if (route.getAuthrtList().isEmpty()) {
+                        route.setAuthrtList(sharedAuth);
+                    }
+                });
             });
-        });
-        // 각 그룹의 라우터들을 리스트로 반환
-        return groupedRoutes.values().stream()
-                .flatMap(List::stream)
-                .collect(Collectors.toList());
+            // 각 그룹의 라우터들을 리스트로 반환
+            return groupedRoutes.values().stream()
+                    .flatMap(List::stream)
+                    .collect(Collectors.toList());
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 
     /**
-     * @author toakensoft
-     * @since 2024.05.08
-     * 그룹 내에서 가장 완전한 권한 정보를 가진 라우터를 찾아 해당 권한 리트스 반환
+     * @param routeGroup - 콘텐츠 유형과 권한 정보 목록
+     * @return List<MenuAuthorVO> - 권한 정보가 있는 첫 번째 라우터의 권한 정보 목록
+     * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
+     * @throws Exception - 그 외 예외 발생 시
+     *
+     * 그룹 내에서 가장 완전한 권한 정보를 가진 라우터를 찾아 해당 권한 리스트 반환
      */
     private List<MenuAuthorVO> findMostComprehensiveAuth(List<ContsAuthrtVO> routeGroup) {
         // 권한정보가 있는 첫 번째 라우터를 찾아 권한 정보 반환
-        return routeGroup.stream()
-                .filter(route -> !route.getAuthrtList().isEmpty())
-                .findFirst()
-                .map(ContsAuthrtVO::getAuthrtList)
-                .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환
+        try {
+            return routeGroup.stream()
+                    .filter(route -> !route.getAuthrtList().isEmpty())
+                    .findFirst()
+                    .map(ContsAuthrtVO::getAuthrtList)
+                    .orElse(Collections.emptyList()); // 권한 정보가 없으면 빈 리스트 반환
+        } catch (DataAccessException dae) {
+            throw dae;
+        } catch (Exception e) {
+            throw e;
+        }
     }
 }
src/main/java/com/takensoft/cms/contsType/vo/ContsAuthrtVO.java
--- src/main/java/com/takensoft/cms/contsType/vo/ContsAuthrtVO.java
+++ src/main/java/com/takensoft/cms/contsType/vo/ContsAuthrtVO.java
@@ -13,6 +13,10 @@
 /**
  * @author  : takensoft
  * @since   : 2024.04.17
+ * @modification
+ *     since    |    author    | description
+ *  2024.04.17  |  takensoft   | 최초 등록
+ *  2025.03.14  |    방선주     | 코드 리펙토링
  *
  * 콘텐츠 유형과 권한 정보 관련 VO
  */
@@ -21,32 +25,11 @@
 @NoArgsConstructor
 @AllArgsConstructor
 public class ContsAuthrtVO {
-    /**
-     * 콘텐츠 아이디
-     */
-    private String contsId;
-    /**
-     * 메뉴 아이디
-     */
-    private String menuId;
-    /**
-     * 콘텐츠 한글명
-     */
-    private String contsKornNm;
-    /**
-     * 콘텐츠 영문명
-     */
-    private String contsEngNm;
-    /**
-     * 페이지 경로
-     */
-    private String pageCrs;
-    /**
-     * 컴포넌트 경로
-     */
-    private String compnCrs;
-    /**
-     * 권한 목록
-     */
-    private List<MenuAuthorVO> authrtList = new ArrayList<MenuAuthorVO>();
+    private String contsId;     // 콘텐츠 아이디
+    private String menuId;      // 메뉴 아이디
+    private String contsKornNm; // 콘텐츠 한글명
+    private String contsEngNm;  // 콘텐츠 영문명
+    private String pageCrs;     // 페이지 경로
+    private String compnCrs;    // 컴포넌트 경로
+    private List<MenuAuthorVO> authrtList = new ArrayList<MenuAuthorVO>();  // 권한 목록
 }
src/main/java/com/takensoft/cms/contsType/vo/ContsTypeVO.java
--- src/main/java/com/takensoft/cms/contsType/vo/ContsTypeVO.java
+++ src/main/java/com/takensoft/cms/contsType/vo/ContsTypeVO.java
@@ -8,6 +8,10 @@
 /**
  * @author  : takensoft
  * @since   : 2024.04.17
+ * @modification
+ *     since    |    author    | description
+ *  2024.04.17  |  takensoft   | 최초 등록
+ *  2025.03.14  |    방선주     | 코드 리펙토링
  *
  * 콘텐츠 유형 관리 관련 VO
  */
@@ -16,56 +20,17 @@
 @NoArgsConstructor
 @AllArgsConstructor
 public class ContsTypeVO {
-    /**
-     * 콘텐츠 아이디
-     */
-    private String contsId;
-    /**
-     * 콘텐츠 한글명
-     */
-    private String contsKornNm;
-    /**
-     * 콘텐츠 영문명
-     */
-    private String contsEngNm;
-    /**
-     * 사용자 페이지 경로
-     */
-    private String pageCrs;
-    /**
-     * 관리자 페이지 경로
-     */
-    private String mngrPageCrs;
-    /**
-     * 컴포넌트 경로
-     */
-    private String compnCrs;
-    /**
-     * 노출여부
-     */
-    private String expsrYn;
-    /**
-     * 사용여부
-     */
-    private String useYn;
-    /**
-     * 시스템 제공 여부
-     */
-    private String sysPvsnYn;
-    /**
-     * 등록자
-     */
-    private String rgtr;
-    /**
-     * 등록일
-     */
-    private String regDt;
-    /**
-     * 수정자
-     */
-    private String mdfr;
-    /**
-     * 수정일
-     */
-    private String mdfcnDt;
+    private String contsId;     // 콘텐츠 아이디
+    private String contsKornNm; // 콘텐츠 한글명
+    private String contsEngNm;  // 콘텐츠 영문명
+    private String pageCrs;     // 사용자 페이지 경로
+    private String mngrPageCrs; // 관리자 페이지 경로
+    private String compnCrs;    // 컴포넌트 경로
+    private String expsrYn;     // 노출여부
+    private String useYn;       // 사용여부
+    private String sysPvsnYn;   // 시스템 제공 여부
+    private String rgtr;        // 등록자
+    private String regDt;       // 등록일
+    private String mdfr;        // 수정자
+    private String mdfcnDt;     // 수정일
 }
src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
--- src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
+++ src/main/java/com/takensoft/cms/contsType/web/ContsTypeController.java
@@ -1,14 +1,11 @@
 package com.takensoft.cms.contsType.web;
 
 import com.takensoft.cms.contsType.service.ContsTypeService;
+import com.takensoft.cms.contsType.vo.ContsAuthrtVO;
 import com.takensoft.cms.contsType.vo.ContsTypeVO;
 import com.takensoft.common.message.MessageCode;
-import com.takensoft.common.util.ResponseData;
 import com.takensoft.common.util.ResponseUtil;
 import lombok.RequiredArgsConstructor;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
 import org.springframework.http.ResponseEntity;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -17,78 +14,61 @@
 
 import java.nio.charset.Charset;
 import java.util.*;
+
 /**
- * @author takensoft
- * @since 2024.04.17
+ * @author  : takensoft
+ * @since   :2024.04.17
  * @modification
  *     since    |    author    | description
- *  2024.04.17  |  takensoft   | 최초 등록
+ *  2024.04.17  |   takensoft  | 최초 등록
+ *  2024.04.29  |    박정하     | findAllByExpsr 추가
+ *  2025.03.13  |    방선주    | 코드 리펙토링
  *
- * 콘텐츠 유형 관리 관련 컨트롤러
+ * 컨텐츠 유형 관련 Controller
  */
 @RestController
 @RequiredArgsConstructor
-@RequestMapping(value = "/admin/contsType")
+@RequestMapping(value = {"/admin/contsType", "/sys/contsType"})
 public class ContsTypeController {
     private final ContsTypeService contsTypeService;
     private final ResponseUtil resUtil;
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
-     * @param contsTypeVO
-     * @return
-     * @throws Exception
+     * @param contsTypeVO - 등록할 컨텐츠 유형 정보
+     * @return ResponseEntity - 등록 결과를 포함하는 응답
      *
      * 콘텐츠 유형 등록
      */
     @PostMapping("/saveProc.json")
-    public ResponseEntity<?> savePorc(@RequestBody ContsTypeVO contsTypeVO) throws Exception {
+    public ResponseEntity<?> savePorc(@RequestBody ContsTypeVO contsTypeVO){
         // 콘텐츠 유형 등록
         HashMap<String, Object> result = contsTypeService.contsSave(contsTypeVO);
-        int insertResult = (int) result.get("result");
-
         // 응답 처리
-        if(insertResult > 0) {
-            return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
-        } else {
-            return resUtil.errorRes(MessageCode.COMMON_INSERT_FAIL);
-        }
+        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
-     * @param contsTypeVO
-     * @return
-     * @throws Exception
+     * @param contsTypeVO - 수정할 컨텐츠 유형 정보
+     * @return ResponseEntity - 수정 결과를 포함하는 응답
      *
      * 콘텐츠 유형 수정
      */
     @PostMapping("/updateProc.json")
-    public ResponseEntity<?> updateProc(@RequestBody ContsTypeVO contsTypeVO) throws Exception {
+    public ResponseEntity<?> updateProc(@RequestBody ContsTypeVO contsTypeVO) {
         // 콘텐츠 유형 수정 처리
         int result = contsTypeService.contsUpdate(contsTypeVO);
-
         // 응답 처리
-        if(result > 0) {
-            return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
-        } else {
-            return resUtil.errorRes(MessageCode.COMMON_UPDATE_FAIL);
-        }
+        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
-     * @param params
-     * @return
-     * @throws Exception
+     * @param params - pagination 및 검색 조건을 포함하는 map
+     * @return ResponseEntity - 콘텐츠 유형 목록을 포함하는 응답
      *
      * 콘텐츠 유형 목록 조회
      */
     @PostMapping("/findAll.json")
-    public ResponseEntity<?> findAll(@RequestBody Map<String, String> params) throws Exception {
+    public ResponseEntity<?> findAll(@RequestBody Map<String, String> params) {
         // 콘텐츠 유형 목록 조회
         Map<String, Object> result = contsTypeService.findAll(params);
 
@@ -97,59 +77,60 @@
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
-     * @param contsTypeVO
-     * @return
-     * @throws Exception
+     * @param contsTypeVO - 조회할 콘텐츠 유형 정보
+     * @return ResponseEntity - 상세 조회 결과를 포함하는 응답
      *
      * 콘텐츠 유형 상세 조회
      */
     @PostMapping("/findByContsType.json")
-    public ResponseEntity<?> findByContsType(@RequestBody ContsTypeVO contsTypeVO) throws Exception {
+    public ResponseEntity<?> findByContsType(@RequestBody ContsTypeVO contsTypeVO) {
         ContsTypeVO result = contsTypeService.findByContsType(contsTypeVO.getContsId());
-
         // 응답 처리
         return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
     }
 
     /**
-     * @author takensoft
-     * @since 2024.04.17
-     * @param contsTypeVO
-     * @return
-     * @throws Exception
+     * @param contsTypeVO - 삭제할 콘텐츠 유형 정보
+     * @return ResponseEntity - 콘텐츠 유형 삭제 결과를 포함하는 응답
      *
      * 콘텐츠 유형 삭제
      */
     @PostMapping("/deleteProc.json")
-    public ResponseEntity<?> deleteProc(@RequestBody ContsTypeVO contsTypeVO) throws Exception {
+    public ResponseEntity<?> deleteProc(@RequestBody ContsTypeVO contsTypeVO) {
         contsTypeVO.setUseYn("N");
         int result = contsTypeService.contsUpdate(contsTypeVO);
-
         // 응답 처리
-        if(result > 0) {
-            return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
-        } else {
-            return resUtil.errorRes(MessageCode.COMMON_DELETE_FAIL);
-        }
+        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
     }
 
     /**
-     * @author 박정하
-     * @since 2024.04.29
-     * @param
-     * @return
-     * @throws Exception
+     * @param contsTypeVO - 조회할 콘텐츠 유형 정보
+     * @return ResponseEntity - 콘텐츠 유형 목록 조회 결과를 포함하는 응답
      *
      * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
      */
     @PostMapping("/findAllByExpsr.json")
-    public ResponseEntity<?> findAllByExpsr(@RequestBody ContsTypeVO contsTypeVO) throws Exception {
+    public ResponseEntity<?> findAllByExpsr(@RequestBody ContsTypeVO contsTypeVO) {
         // 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
         List<ContsTypeVO> result = contsTypeService.findAllByExpsr(contsTypeVO);
 
         // 응답 처리
         return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
     }
+    /** *********************  콘텐츠 유형 관리 관련 컨트롤러  *************************** */
+
+    /**
+     * @param
+     * @return ResponseEntity - 콘텐츠 유형 목록 조회 결과를 포함하는 응답
+     *
+     * 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
+     */
+    @PostMapping(value = "/findByContsAuthrtSys.json")
+    public ResponseEntity<?> findByContsTypeSys(){
+        // 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
+        List<ContsAuthrtVO> result = contsTypeService.findByContsAuthrt();
+
+        // 응답 처리
+        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
+    }
 }
 
src/main/java/com/takensoft/cms/contsType/web/SystemContsTypeController.java (deleted)
--- src/main/java/com/takensoft/cms/contsType/web/SystemContsTypeController.java
@@ -1,68 +0,0 @@
-package com.takensoft.cms.contsType.web;
-
-import com.takensoft.cms.contsType.service.ContsTypeService;
-import com.takensoft.cms.contsType.vo.ContsAuthrtVO;
-import com.takensoft.cms.contsType.vo.ContsTypeVO;
-import com.takensoft.common.message.MessageCode;
-import com.takensoft.common.util.ResponseData;
-import com.takensoft.common.util.ResponseUtil;
-import lombok.RequiredArgsConstructor;
-import lombok.extern.slf4j.Slf4j;
-import org.springframework.http.HttpHeaders;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-
-import java.nio.charset.Charset;
-import java.util.List;
-/**
- * @author takensoft
- * @since 2024.04.17
- * @modification
- *     since    |    author    | description
- *  2024.04.17  |  takensoft   | 최초 등록
- *
- * 콘텐츠 유형 관리 관련 컨트롤러
- */
-@RestController
-@RequiredArgsConstructor
-@Slf4j
-@RequestMapping(value = "/sys/contsType")
-public class SystemContsTypeController {
-
-    private final ResponseUtil resUtil;
-    private final ContsTypeService contsTypeService;
-
-    /**
-     * @author takensoft
-     * @since 2024.04.29
-     * @param
-     * @return
-     * @throws Exception
-     */
-    @PostMapping(value = "/findByContsTypeSys.json")
-    public ResponseEntity<?> findByContsTypeSys(ContsTypeVO contsTypeVO) throws Exception {
-        // 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
-        List<ContsTypeVO> result = contsTypeService.findByContsTypeSys(contsTypeVO);
-
-        // 응답 처리
-        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
-    }
-
-    /**
-     * @author takensoft
-     * @since 2024.04.29
-     * @param
-     * @return
-     * @throws Exception
-     */
-    @PostMapping(value = "/findByContsAuthrtSys.json")
-    public ResponseEntity<?> findByContsTypeSys() throws Exception {
-        // 콘텐츠 유형 목록 조회 (메뉴 노출 건만)
-        List<ContsAuthrtVO> result = contsTypeService.findByContsAuthrt();
-
-        // 응답 처리
-        return resUtil.successRes(result, MessageCode.COMMON_SUCCESS);
-    }
-}
src/main/java/com/takensoft/cms/dept/service/DeptService.java
--- src/main/java/com/takensoft/cms/dept/service/DeptService.java
+++ src/main/java/com/takensoft/cms/dept/service/DeptService.java
@@ -15,7 +15,7 @@
  *     since    |    author    | description
  *  2024.04.09  |  takensoft   | 최초 등록
  *  2024.05.10  |    박정하     | updateList, updateChildNode 추가
- *  2025.03.13  |    방선주     | 코드 리펙토링
+ *  2025.03.14  |    방선주     | 코드 리펙토링
  *
  * 부서 정보 관련 인터페이스
  */
src/main/java/com/takensoft/cms/dept/service/Impl/DeptServiceImpl.java
--- 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 @@
     /**
      * @param deptVO - 부서 정보 VO
      * @return HashMap<String, Object> - 부서 정보
+     * @throws CustomInsertFailException - 부서 등록 실패 시
      * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
      * @throws NullPointerException - Null 값이 발생할 경우
      * @throws Exception - 그 외 예외 발생 시
@@ -366,7 +367,7 @@
     }
 
     /**
-     * @param params - 부서 아이디
+     * @param deptList - 부서 목록 객체
      * @return Map<String, Object> - 부서에 등록되지 않는 사용자 정보
      * @throws CustomUpdateFailException - 수정 실패 예외 발생 시
      * @throws DataAccessException - 데이터베이스 접근 예외 발생 시
Add a comment
List