From 107508ac1cd0397102810beb4d0b82981d6a677e Mon Sep 17 00:00:00 2001 From: Jurepi Date: Tue, 8 Oct 2024 09:53:51 +0900 Subject: [PATCH 1/3] Source > Format --- .../bbs/service/impl/BBSAddedOptionsDAO.java | 73 ++-- .../service/impl/BBSAttributeManageDAO.java | 8 +- .../bbs/service/impl/BBSLoneMasterDAO.java | 8 +- .../cop/bbs/service/impl/BBSManageDAO.java | 8 +- .../EgovBBSAttributeManageServiceImpl.java | 44 ++- .../impl/EgovBBSLoneMasterServiceImpl.java | 188 ++++++----- .../impl/EgovBBSManageServiceImpl.java | 317 +++++++++--------- .../bbs/web/EgovBBSAdminManageController.java | 31 +- .../web/EgovBBSAttributeManageController.java | 59 ++-- .../bbs/web/EgovBBSLoneMasterController.java | 40 +-- .../cop/bbs/web/EgovBBSManageController.java | 88 ++--- 11 files changed, 435 insertions(+), 429 deletions(-) diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java index 74a8bef..430403a 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java @@ -1,55 +1,56 @@ package egovframework.let.cop.bbs.service.impl; -import egovframework.let.cop.bbs.service.BoardMaster; -import egovframework.let.cop.bbs.service.BoardMasterVO; import org.egovframe.rte.psl.dataaccess.EgovAbstractMapper; - import org.springframework.stereotype.Repository; +import egovframework.let.cop.bbs.service.BoardMaster; +import egovframework.let.cop.bbs.service.BoardMasterVO; + /** * 2단계 기능 추가 (댓글관리, 만족도조사) 관리를 위한 데이터 접근 클래스 + * * @author 공통 서비스 개발팀 한성곤 * @since 2009.06.26 * @version 1.0 * @see - * - *
- * << 개정이력(Modification Information) >>
  * 
+ *      
+ * << 개정이력(Modification Information) >>
+ *
  *   수정일      수정자          수정내용
  *  -------    --------    ---------------------------
- *  2009.06.26  한성곤          최초 생성
- *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성 
- *  
- *  
+ * 2009.06.26 한성곤 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * + *
*/ @Repository("BBSAddedOptionsDAO") public class BBSAddedOptionsDAO extends EgovAbstractMapper { - /** - * 신규 게시판 추가기능 정보를 등록한다. - * - * @param BoardMaster - */ - public int insertAddedOptionsInf(BoardMaster boardMaster) throws Exception { - return insert("BBSAddedOptionsDAO.insertAddedOptionsInf", boardMaster); - } - - /** - * 게시판 추가기능 정보 한 건을 상세조회 한다. - * - * @param BoardMasterVO - */ - public BoardMasterVO selectAddedOptionsInf(BoardMaster vo) throws Exception { - return (BoardMasterVO)selectOne("BBSAddedOptionsDAO.selectAddedOptionsInf", vo); - } - - /** - * 게시판 추가기능 정보를 수정한다. - * - * @param BoardMaster - */ - public void updateAddedOptionsInf(BoardMaster boardMaster) throws Exception { - update("BBSAddedOptionsDAO.updateAddedOptionsInf", boardMaster); - } + /** + * 신규 게시판 추가기능 정보를 등록한다. + * + * @param BoardMaster + */ + public int insertAddedOptionsInf(BoardMaster boardMaster) throws Exception { + return insert("BBSAddedOptionsDAO.insertAddedOptionsInf", boardMaster); + } + + /** + * 게시판 추가기능 정보 한 건을 상세조회 한다. + * + * @param BoardMasterVO + */ + public BoardMasterVO selectAddedOptionsInf(BoardMaster vo) throws Exception { + return (BoardMasterVO) selectOne("BBSAddedOptionsDAO.selectAddedOptionsInf", vo); + } + + /** + * 게시판 추가기능 정보를 수정한다. + * + * @param BoardMaster + */ + public void updateAddedOptionsInf(BoardMaster boardMaster) throws Exception { + update("BBSAddedOptionsDAO.updateAddedOptionsInf", boardMaster); + } } diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java index 1558755..8d86b27 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java @@ -10,7 +10,7 @@ /** * 게시판 속성정보 관리를 위한 데이터 접근 클래스 - * + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.12 * @version 1.0 @@ -21,9 +21,9 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.03.12 이삼섭 최초 생성 - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2009.03.12 이삼섭 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.10 이백행 이클립스 문제(Problems) 제거 * * */ diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java index bd6ed79..1855d0f 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java @@ -10,7 +10,7 @@ /** * 게시판 속성정보 관리를 위한 데이터 접근 클래스 - * + * * @author 공통 서비스 개발팀 한성곤 * @since 2009.08.25 * @version 1.0 @@ -21,9 +21,9 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.08.25 한성곤 최초 생성 - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2009.08.25 한성곤 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.10 이백행 이클립스 문제(Problems) 제거 * * */ diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java index e28b3e7..dc9f06a 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java @@ -11,7 +11,7 @@ /** * 게시물 관리를 위한 데이터 접근 클래스 - * + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.19 * @version 1.0 @@ -22,9 +22,9 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.03.19 이삼섭 최초 생성 - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2009.03.19 이삼섭 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.10 이백행 이클립스 문제(Problems) 제거 * * */ diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java index a826390..8169d5e 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java @@ -5,27 +5,26 @@ import java.util.List; import java.util.Map; -import egovframework.let.cop.bbs.service.BoardMaster; -import egovframework.let.cop.bbs.service.BoardMasterVO; -import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; -import egovframework.let.cop.com.service.BoardUseInf; -import egovframework.let.cop.com.service.EgovUserInfManageService; -import egovframework.let.cop.com.service.UserInfVO; -import egovframework.let.cop.com.service.impl.BBSUseInfoManageDAO; +import javax.annotation.Resource; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; import org.egovframe.rte.fdl.property.EgovPropertyService; - -import javax.annotation.Resource; - import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; +import egovframework.let.cop.bbs.service.BoardMaster; +import egovframework.let.cop.bbs.service.BoardMasterVO; +import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; +import egovframework.let.cop.com.service.BoardUseInf; +import egovframework.let.cop.com.service.EgovUserInfManageService; +import egovframework.let.cop.com.service.UserInfVO; +import egovframework.let.cop.com.service.impl.BBSUseInfoManageDAO; + /** * 게시판 속성관리를 위한 서비스 구현 클래스 - * + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.24 * @version 1.0 @@ -36,15 +35,14 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.03.24 이삼섭 최초 생성 - * 2009.06.26 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2009.03.24 이삼섭 최초 생성 + * 2009.06.26 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * * */ @Service("EgovBBSAttributeManageService") -public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl - implements EgovBBSAttributeManageService { +public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl implements EgovBBSAttributeManageService { private static final Logger LOGGER = LoggerFactory.getLogger(EgovBBSAttributeManageServiceImpl.class); @@ -75,6 +73,7 @@ public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#deleteBBSMasterInf(egovframework.let.cop.bbs.brd.service.BoardMaster) */ + @Override public void deleteBBSMasterInf(BoardMaster boardMaster) throws Exception { attrbMngDAO.deleteBBSMasterInf(boardMaster); @@ -91,6 +90,7 @@ public void deleteBBSMasterInf(BoardMaster boardMaster) throws Exception { * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#insertBBSMastetInf(egovframework.let.cop.bbs.brd.service.BoardMaster) */ + @Override public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { String bbsId = idgenService.getNextStringId(); @@ -130,7 +130,7 @@ public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { bdUseInf = new BoardUseInf(); bdUseInf.setBbsId(bbsId); - bdUseInf.setTrgetId(((UserInfVO) iter.next()).getUniqId()); + bdUseInf.setTrgetId(iter.next().getUniqId()); bdUseInf.setRegistSeCode("REGC07"); bdUseInf.setUseAt("Y"); bdUseInf.setFrstRegisterId(boardMaster.getFrstRegisterId()); @@ -144,7 +144,7 @@ public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { bdUseInf = new BoardUseInf(); bdUseInf.setBbsId(bbsId); - bdUseInf.setTrgetId(((UserInfVO) iter.next()).getUniqId()); + bdUseInf.setTrgetId(iter.next().getUniqId()); bdUseInf.setRegistSeCode("REGC07"); bdUseInf.setUseAt("Y"); bdUseInf.setFrstRegisterId(boardMaster.getFrstRegisterId()); @@ -161,6 +161,7 @@ public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#selectAllBBSMasteInf(egovframework.let.cop.bbs.brd.service.BoardMasterVO) */ + @Override public List selectAllBBSMasteInf(BoardMasterVO vo) throws Exception { return attrbMngDAO.selectAllBBSMasteInf(vo); } @@ -170,6 +171,7 @@ public List selectAllBBSMasteInf(BoardMasterVO vo) throws Excepti * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#selectBBSMasterInf(egovframework.let.cop.bbs.brd.service.BoardMasterVO) */ + @Override public BoardMasterVO selectBBSMasterInf(BoardMaster searchVO) throws Exception { // --------------------------------- // 2009.06.26 : 2단계 기능 추가 @@ -205,6 +207,7 @@ public BoardMasterVO selectBBSMasterInf(BoardMaster searchVO) throws Exception { * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#selectBBSMasterInfs(egovframework.let.cop.bbs.brd.service.BoardMasterVO) */ + @Override public Map selectBBSMasterInfs(BoardMasterVO searchVO) throws Exception { List result = attrbMngDAO.selectBBSMasterInfs(searchVO); int cnt = attrbMngDAO.selectBBSMasterInfsCnt(searchVO); @@ -222,6 +225,7 @@ public Map selectBBSMasterInfs(BoardMasterVO searchVO) throws Ex * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#updateBBSMasterInf(egovframework.let.cop.bbs.brd.service.BoardMaster) */ + @Override public void updateBBSMasterInf(BoardMaster boardMaster) throws Exception { attrbMngDAO.updateBBSMasterInf(boardMaster); @@ -252,6 +256,7 @@ public void updateBBSMasterInf(BoardMaster boardMaster) throws Exception { * * @see egovframework.let.cop.bbs.brd.service.EgovBBSAttributeManageService#validateTemplate(egovframework.let.cop.bbs.brd.service.BoardMasterVO) */ + @Override public void validateTemplate(BoardMasterVO searchVO) throws Exception { LOGGER.debug("validateTemplate method ignored..."); } @@ -259,6 +264,7 @@ public void validateTemplate(BoardMasterVO searchVO) throws Exception { /** * 사용중인 게시판 속성 정보의 목록을 조회 한다. */ + @Override public Map selectBdMstrListByTrget(BoardMasterVO vo) throws Exception { List result = attrbMngDAO.selectBdMstrListByTrget(vo); int cnt = attrbMngDAO.selectBdMstrListCntByTrget(vo); @@ -274,6 +280,7 @@ public Map selectBdMstrListByTrget(BoardMasterVO vo) throws Exce /** * 커뮤니티, 동호회에서 사용중인 게시판 속성 정보의 목록을 전체조회 한다. */ + @Override public List selectAllBdMstrByTrget(BoardMasterVO vo) throws Exception { return attrbMngDAO.selectAllBdMstrByTrget(vo); } @@ -281,6 +288,7 @@ public List selectAllBdMstrByTrget(BoardMasterVO vo) throws Excep /** * 사용중이지 않은 게시판 속성 정보의 목록을 조회 한다. */ + @Override public Map selectNotUsedBdMstrList(BoardMasterVO searchVO) throws Exception { List result = attrbMngDAO.selectNotUsedBdMstrList(searchVO); int cnt = attrbMngDAO.selectNotUsedBdMstrListCnt(searchVO); diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java index e9b137e..c17fb1d 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java @@ -1,116 +1,122 @@ package egovframework.let.cop.bbs.service.impl; + import java.util.HashMap; import java.util.List; import java.util.Map; +import javax.annotation.Resource; + +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; +import org.springframework.stereotype.Service; + import egovframework.let.cop.bbs.service.BoardMaster; import egovframework.let.cop.bbs.service.BoardMasterVO; import egovframework.let.cop.bbs.service.EgovBBSLoneMasterService; import egovframework.let.cop.com.service.BoardUseInf; import egovframework.let.cop.com.service.impl.BBSUseInfoManageDAO; -import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; -import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - /** * 게시판 속성관리를 위한 서비스 구현 클래스 + * * @author 공통 서비스 개발팀 한성곤 * @since 2009.08.25 * @version 1.0 * @see - * - *
- * << 개정이력(Modification Information) >>
  * 
+ *      
+ * << 개정이력(Modification Information) >>
+ *
  *   수정일      수정자          수정내용
  *  -------    --------    ---------------------------
- *  2009.08.25  한성곤          최초 생성
- *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성 
- *  
- *  
+ * 2009.08.25 한성곤 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * + *
*/ @Service("EgovBBSLoneMasterService") public class EgovBBSLoneMasterServiceImpl extends EgovAbstractServiceImpl implements EgovBBSLoneMasterService { - @Resource(name = "BBSLoneMasterDAO") - private BBSLoneMasterDAO masterDAO; - - @Resource(name = "BBSUseInfoManageDAO") - private BBSUseInfoManageDAO bbsUseDAO; - - @Resource(name = "egovBBSMstrIdGnrService") - private EgovIdGnrService idgenService; - - /** - * 등록된 게시판 속성정보를 삭제한다. - */ - public void deleteMaster(BoardMaster boardMaster) throws Exception { - masterDAO.deleteMaster(boardMaster); - - BoardUseInf bdUseInf = new BoardUseInf(); - - bdUseInf.setBbsId(boardMaster.getBbsId()); - bdUseInf.setLastUpdusrId(boardMaster.getLastUpdusrId()); - - bbsUseDAO.deleteBBSUseInfByBoardId(bdUseInf); - } - - /** - * 신규 게시판 속성정보를 생성한다. - */ - public String insertMaster(BoardMaster boardMaster) throws Exception { - String bbsId = idgenService.getNextStringId(); - - boardMaster.setBbsId(bbsId); - - masterDAO.insertMaster(boardMaster); - - //---------------------------------------------- - // 게시판 사용 등록 (시스템) - //---------------------------------------------- - BoardUseInf bdUseInf = new BoardUseInf(); - - bdUseInf.setBbsId(bbsId); - bdUseInf.setTrgetId("SYSTEM_DEFAULT_BOARD"); - bdUseInf.setRegistSeCode("REGC01"); - bdUseInf.setFrstRegisterId(boardMaster.getFrstRegisterId()); - bdUseInf.setUseAt("Y"); - - bbsUseDAO.insertBBSUseInf(bdUseInf); - - return bbsId; - } - - /** - * 게시판 속성정보 한 건을 상세조회한다. - */ - public BoardMasterVO selectMaster(BoardMaster searchVO) throws Exception { - return masterDAO.selectMaster(searchVO); - } - - /** - * 게시판 속성 정보의 목록을 조회 한다. - */ - public Map selectMasterList(BoardMasterVO searchVO) throws Exception { - List result = masterDAO.selectMasterList(searchVO); - int cnt = masterDAO.selectMasterListCnt(searchVO); - - Map map = new HashMap(); - - map.put("resultList", result); - map.put("resultCnt", Integer.toString(cnt)); - - return map; - } - - /** - * 게시판 속성정보를 수정한다. - */ - public void updateMaster(BoardMaster boardMaster) throws Exception { - masterDAO.updateMaster(boardMaster); - } + @Resource(name = "BBSLoneMasterDAO") + private BBSLoneMasterDAO masterDAO; + + @Resource(name = "BBSUseInfoManageDAO") + private BBSUseInfoManageDAO bbsUseDAO; + + @Resource(name = "egovBBSMstrIdGnrService") + private EgovIdGnrService idgenService; + + /** + * 등록된 게시판 속성정보를 삭제한다. + */ + @Override + public void deleteMaster(BoardMaster boardMaster) throws Exception { + masterDAO.deleteMaster(boardMaster); + + BoardUseInf bdUseInf = new BoardUseInf(); + + bdUseInf.setBbsId(boardMaster.getBbsId()); + bdUseInf.setLastUpdusrId(boardMaster.getLastUpdusrId()); + + bbsUseDAO.deleteBBSUseInfByBoardId(bdUseInf); + } + + /** + * 신규 게시판 속성정보를 생성한다. + */ + @Override + public String insertMaster(BoardMaster boardMaster) throws Exception { + String bbsId = idgenService.getNextStringId(); + + boardMaster.setBbsId(bbsId); + + masterDAO.insertMaster(boardMaster); + + // ---------------------------------------------- + // 게시판 사용 등록 (시스템) + // ---------------------------------------------- + BoardUseInf bdUseInf = new BoardUseInf(); + + bdUseInf.setBbsId(bbsId); + bdUseInf.setTrgetId("SYSTEM_DEFAULT_BOARD"); + bdUseInf.setRegistSeCode("REGC01"); + bdUseInf.setFrstRegisterId(boardMaster.getFrstRegisterId()); + bdUseInf.setUseAt("Y"); + + bbsUseDAO.insertBBSUseInf(bdUseInf); + + return bbsId; + } + + /** + * 게시판 속성정보 한 건을 상세조회한다. + */ + @Override + public BoardMasterVO selectMaster(BoardMaster searchVO) throws Exception { + return masterDAO.selectMaster(searchVO); + } + + /** + * 게시판 속성 정보의 목록을 조회 한다. + */ + @Override + public Map selectMasterList(BoardMasterVO searchVO) throws Exception { + List result = masterDAO.selectMasterList(searchVO); + int cnt = masterDAO.selectMasterListCnt(searchVO); + + Map map = new HashMap(); + + map.put("resultList", result); + map.put("resultCnt", Integer.toString(cnt)); + + return map; + } + + /** + * 게시판 속성정보를 수정한다. + */ + @Override + public void updateMaster(BoardMaster boardMaster) throws Exception { + masterDAO.updateMaster(boardMaster); + } } diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java index 4f9e95a..4fd26b6 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java @@ -6,6 +6,12 @@ import java.util.List; import java.util.Map; +import javax.annotation.Resource; + +import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; +import org.egovframe.rte.fdl.property.EgovPropertyService; +import org.springframework.stereotype.Service; + import egovframework.com.cmm.service.EgovFileMngService; import egovframework.com.cmm.service.FileVO; import egovframework.let.cop.bbs.service.Board; @@ -13,187 +19,190 @@ import egovframework.let.cop.bbs.service.EgovBBSManageService; import egovframework.let.utl.fcc.service.EgovDateUtil; -import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; -import org.egovframe.rte.fdl.property.EgovPropertyService; - -import javax.annotation.Resource; - -import org.springframework.stereotype.Service; - /** * 게시물 관리를 위한 서비스 구현 클래스 + * * @author 공통 서비스 개발팀 한성곤 * @since 2009.03.19 * @version 1.0 * @see - * - *
- * << 개정이력(Modification Information) >>
  * 
+ *      
+ * << 개정이력(Modification Information) >>
+ *
  *   수정일      수정자          수정내용
  *  -------    --------    ---------------------------
- *  2009.03.19  이삼섭          최초 생성
- *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성 
- *  
- *  
+ * 2009.03.19 이삼섭 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * + *
*/ @Service("EgovBBSManageService") public class EgovBBSManageServiceImpl extends EgovAbstractServiceImpl implements EgovBBSManageService { - @Resource(name = "BBSManageDAO") - private BBSManageDAO bbsMngDAO; + @Resource(name = "BBSManageDAO") + private BBSManageDAO bbsMngDAO; - @Resource(name = "EgovFileMngService") - private EgovFileMngService fileService; + @Resource(name = "EgovFileMngService") + private EgovFileMngService fileService; - @Resource(name = "propertiesService") - protected EgovPropertyService propertyService; + @Resource(name = "propertiesService") + protected EgovPropertyService propertyService; - /** - * 게시물 한 건을 삭제 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteBoardArticle(egovframework.let.cop.bbs.brd.service.Board) - */ - public void deleteBoardArticle(Board board) throws Exception { - FileVO fvo = new FileVO(); - - fvo.setAtchFileId(board.getAtchFileId()); + /** + * 게시물 한 건을 삭제 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteBoardArticle(egovframework.let.cop.bbs.brd.service.Board) + */ + @Override + public void deleteBoardArticle(Board board) throws Exception { + FileVO fvo = new FileVO(); - board.setNttSj("이 글은 작성자에 의해서 삭제되었습니다."); + fvo.setAtchFileId(board.getAtchFileId()); - bbsMngDAO.deleteBoardArticle(board); + board.setNttSj("이 글은 작성자에 의해서 삭제되었습니다."); - if (!"".equals(fvo.getAtchFileId()) || fvo.getAtchFileId() != null) { - fileService.deleteAllFileInf(fvo); - } - } - - /** - * 게시판에 게시물 또는 답변 게시물을 등록 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#insertBoardArticle(egovframework.let.cop.bbs.brd.service.Board) - */ - public void insertBoardArticle(Board board) throws Exception { - // SORT_ORDR는 부모글의 소트 오더와 같게, NTT_NO는 순서대로 부여 - - if ("Y".equals(board.getReplyAt())) { - // 답글인 경우 1. Parnts를 세팅, 2.Parnts의 sortOrdr을 현재글의 sortOrdr로 가져오도록, 3.nttNo는 현재 게시판의 순서대로 - // replyLc는 부모글의 ReplyLc + 1 - - @SuppressWarnings("unused") - long tmpNttId = 0L; // 답글 게시물 ID - - tmpNttId = bbsMngDAO.replyBoardArticle(board); - - } else { - // 답글이 아닌경우 Parnts = 0, replyLc는 = 0, sortOrdr = nttNo(Query에서 처리) - board.setParnts("0"); - board.setReplyLc("0"); - board.setReplyAt("N"); - - bbsMngDAO.insertBoardArticle(board); + bbsMngDAO.deleteBoardArticle(board); + + if (!"".equals(fvo.getAtchFileId()) || fvo.getAtchFileId() != null) { + fileService.deleteAllFileInf(fvo); + } } - } /** - * 게시물 대하여 상세 내용을 조회 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticle(egovframework.let.cop.bbs.brd.service.BoardVO) - */ - public BoardVO selectBoardArticle(BoardVO boardVO) throws Exception { - if (boardVO.isPlusCount()) { - int iniqireCo = bbsMngDAO.selectMaxInqireCo(boardVO); - - boardVO.setInqireCo(iniqireCo); - bbsMngDAO.updateInqireCo(boardVO); + * 게시판에 게시물 또는 답변 게시물을 등록 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#insertBoardArticle(egovframework.let.cop.bbs.brd.service.Board) + */ + @Override + public void insertBoardArticle(Board board) throws Exception { + // SORT_ORDR는 부모글의 소트 오더와 같게, NTT_NO는 순서대로 부여 + + if ("Y".equals(board.getReplyAt())) { + // 답글인 경우 1. Parnts를 세팅, 2.Parnts의 sortOrdr을 현재글의 sortOrdr로 가져오도록, 3.nttNo는 현재 + // 게시판의 순서대로 + // replyLc는 부모글의 ReplyLc + 1 + + @SuppressWarnings("unused") + long tmpNttId = 0L; // 답글 게시물 ID + + tmpNttId = bbsMngDAO.replyBoardArticle(board); + + } else { + // 답글이 아닌경우 Parnts = 0, replyLc는 = 0, sortOrdr = nttNo(Query에서 처리) + board.setParnts("0"); + board.setReplyLc("0"); + board.setReplyAt("N"); + + bbsMngDAO.insertBoardArticle(board); + } } - return bbsMngDAO.selectBoardArticle(boardVO); - } + /** + * 게시물 대하여 상세 내용을 조회 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticle(egovframework.let.cop.bbs.brd.service.BoardVO) + */ + @Override + public BoardVO selectBoardArticle(BoardVO boardVO) throws Exception { + if (boardVO.isPlusCount()) { + int iniqireCo = bbsMngDAO.selectMaxInqireCo(boardVO); + + boardVO.setInqireCo(iniqireCo); + bbsMngDAO.updateInqireCo(boardVO); + } + + return bbsMngDAO.selectBoardArticle(boardVO); + } /** - * 조건에 맞는 게시물 목록을 조회 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticles(egovframework.let.cop.bbs.brd.service.BoardVO) - */ - public Map selectBoardArticles(BoardVO boardVO, String attrbFlag) throws Exception { - List list = bbsMngDAO.selectBoardArticleList(boardVO); - List result = new ArrayList(); - - if ("BBSA01".equals(attrbFlag)) { - // 유효게시판 임 - String today = EgovDateUtil.getToday(); - - BoardVO vo; - Iterator iter = list.iterator(); - while (iter.hasNext()) { - vo = (BoardVO)iter.next(); - - if (!"".equals(vo.getNtceBgnde()) || !"".equals(vo.getNtceEndde())) { - if (EgovDateUtil.getDaysDiff(today, vo.getNtceBgnde()) > 0 || EgovDateUtil.getDaysDiff(today, vo.getNtceEndde()) < 0) { - // 시작일이 오늘날짜보다 크거나, 종료일이 오늘 날짜보다 작은 경우 - vo.setIsExpired("Y"); - } + * 조건에 맞는 게시물 목록을 조회 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticles(egovframework.let.cop.bbs.brd.service.BoardVO) + */ + @Override + public Map selectBoardArticles(BoardVO boardVO, String attrbFlag) throws Exception { + List list = bbsMngDAO.selectBoardArticleList(boardVO); + List result = new ArrayList(); + + if ("BBSA01".equals(attrbFlag)) { + // 유효게시판 임 + String today = EgovDateUtil.getToday(); + + BoardVO vo; + Iterator iter = list.iterator(); + while (iter.hasNext()) { + vo = iter.next(); + + if (!"".equals(vo.getNtceBgnde()) || !"".equals(vo.getNtceEndde())) { + if (EgovDateUtil.getDaysDiff(today, vo.getNtceBgnde()) > 0 || EgovDateUtil.getDaysDiff(today, vo.getNtceEndde()) < 0) { + // 시작일이 오늘날짜보다 크거나, 종료일이 오늘 날짜보다 작은 경우 + vo.setIsExpired("Y"); + } + } + result.add(vo); + } + } else { + result = list; } - result.add(vo); - } - } else { - result = list; + + int cnt = bbsMngDAO.selectBoardArticleListCnt(boardVO); + + Map map = new HashMap(); + + map.put("resultList", result); + map.put("resultCnt", Integer.toString(cnt)); + + return map; } - int cnt = bbsMngDAO.selectBoardArticleListCnt(boardVO); - - Map map = new HashMap(); - - map.put("resultList", result); - map.put("resultCnt", Integer.toString(cnt)); - - return map; - } - - /** - * 게시물 한 건의 내용을 수정 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#updateBoardArticle(egovframework.let.cop.bbs.brd.service.Board) - */ - public void updateBoardArticle(Board board) throws Exception { - bbsMngDAO.updateBoardArticle(board); - } - - /** - * 방명록 내용을 삭제 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) - */ - public void deleteGuestList(BoardVO boardVO) throws Exception { - bbsMngDAO.deleteGuestList(boardVO); - } - - /** - * 방명록에 대한 목록을 조회 한다. - * - * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) - */ - public Map selectGuestList(BoardVO boardVO) throws Exception { - List result = bbsMngDAO.selectGuestList(boardVO); - int cnt = bbsMngDAO.selectGuestListCnt(boardVO); - - Map map = new HashMap(); - - map.put("resultList", result); - map.put("resultCnt", Integer.toString(cnt)); - - return map; - } - - /** - * 방명록에 대한 패스워드를 조회 한다. - * - * @param board - * @return - * @throws Exception - */ - public String getPasswordInf(Board board) throws Exception { - return bbsMngDAO.getPasswordInf(board); - } + /** + * 게시물 한 건의 내용을 수정 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#updateBoardArticle(egovframework.let.cop.bbs.brd.service.Board) + */ + @Override + public void updateBoardArticle(Board board) throws Exception { + bbsMngDAO.updateBoardArticle(board); + } + + /** + * 방명록 내용을 삭제 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) + */ + @Override + public void deleteGuestList(BoardVO boardVO) throws Exception { + bbsMngDAO.deleteGuestList(boardVO); + } + + /** + * 방명록에 대한 목록을 조회 한다. + * + * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) + */ + @Override + public Map selectGuestList(BoardVO boardVO) throws Exception { + List result = bbsMngDAO.selectGuestList(boardVO); + int cnt = bbsMngDAO.selectGuestListCnt(boardVO); + + Map map = new HashMap(); + + map.put("resultList", result); + map.put("resultCnt", Integer.toString(cnt)); + + return map; + } + + /** + * 방명록에 대한 패스워드를 조회 한다. + * + * @param board + * @return + * @throws Exception + */ + @Override + public String getPasswordInf(Board board) throws Exception { + return bbsMngDAO.getPasswordInf(board); + } } diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java index fb29155..cf6350c 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java @@ -35,7 +35,7 @@ /** * 게시물 관리를 위한 컨트롤러 클래스 - * + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.19 * @version 1.0 @@ -48,7 +48,7 @@ * ------- -------- --------------------------- * 2009.03.19 이삼섭 최초 생성 * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.10 이백행 이클립스 문제(Problems) 제거 * 2024.09.02 이백행 요청 메서드 정리 * @@ -119,8 +119,7 @@ protected String unscript(String data) { * @throws Exception */ @GetMapping("/cop/bbs/admin/selectBoardList.do") - public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model, - HttpServletRequest request) throws Exception { + public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model, HttpServletRequest request) throws Exception { System.out.println(boardVO.getBbsId()); // 메인화면에서 넘어온 경우 메뉴 갱신을 위해 추가 request.getSession().setAttribute("menuNo", "5000000"); @@ -285,10 +284,9 @@ public String addBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Model * @throws Exception */ @PostMapping("/cop/bbs/admin/insertBoardArticle.do") - public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, ModelMap model) - throws Exception { + public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, + ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -401,10 +399,9 @@ public String addReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, * @throws Exception */ @PostMapping("/cop/bbs/admin/replyBoardArticle.do") - public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -479,8 +476,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, * @throws Exception */ @GetMapping("/cop/bbs/admin/forUpdateBoardArticle.do") - public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("board") BoardVO vo, ModelMap model) throws Exception { + public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") BoardVO vo, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -528,10 +524,9 @@ public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boar * @throws Exception */ @PostMapping("/cop/bbs/admin/updateBoardArticle.do") - public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java index 5e5564d..39dd59d 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java @@ -3,21 +3,12 @@ import java.util.List; import java.util.Map; -import egovframework.com.cmm.ComDefaultCodeVO; -import egovframework.com.cmm.LoginVO; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.let.cop.bbs.service.BoardMaster; -import egovframework.let.cop.bbs.service.BoardMasterVO; -import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; -import egovframework.let.utl.fcc.service.EgovStringUtil; +import javax.annotation.Resource; import org.egovframe.rte.fdl.cmmn.exception.EgovBizException; import org.egovframe.rte.fdl.property.EgovPropertyService; import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; - -import javax.annotation.Resource; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -28,23 +19,32 @@ import org.springframework.web.bind.support.SessionStatus; import org.springmodules.validation.commons.DefaultBeanValidator; +import egovframework.com.cmm.ComDefaultCodeVO; +import egovframework.com.cmm.LoginVO; +import egovframework.com.cmm.service.EgovCmmUseService; +import egovframework.let.cop.bbs.service.BoardMaster; +import egovframework.let.cop.bbs.service.BoardMasterVO; +import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; +import egovframework.let.utl.fcc.service.EgovStringUtil; + /** - * 게시판 속성관리를 위한 컨트롤러 클래스 + * 게시판 속성관리를 위한 컨트롤러 클래스 + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.12 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *   수정일      수정자          수정내용
  *  -------    --------    ---------------------------
- *  2009.03.12  이삼섭          최초 생성
- *  2009.06.26	한성곤		2단계 기능 추가 (댓글관리, 만족도조사)
- *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *  2009.03.12  이삼섭           최초 생성
+ *  2009.06.26  한성곤           2단계 기능 추가 (댓글관리, 만족도조사)
+ *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
  *
- *  
+ *
*/ @Controller public class EgovBBSAttributeManageController { @@ -121,8 +121,8 @@ public String addBBSMaster(@ModelAttribute("searchVO") BoardMasterVO boardMaster * @throws Exception */ @RequestMapping("/cop/bbs/insertBBSMasterInf.do") - public String insertBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, BindingResult bindingResult, - SessionStatus status, ModelMap model) throws Exception { + public String insertBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + BindingResult bindingResult, SessionStatus status, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -206,12 +206,12 @@ public String selectBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO searc BoardMasterVO vo = bbsAttrbService.selectBBSMasterInf(searchVO); model.addAttribute("result", vo); - + String flag = propertyService.getString("Globals.addedOptions"); if (flag != null && flag.trim().equalsIgnoreCase("true")) { model.addAttribute("addedOptions", "true"); } - ////------------------------------- + //// ------------------------------- return "cop/bbs/EgovBoardMstrUpdt"; } @@ -226,8 +226,8 @@ public String selectBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO searc * @throws Exception */ @RequestMapping("/cop/bbs/UpdateBBSMasterInf.do") - public String updateBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, BindingResult bindingResult, - ModelMap model) throws Exception { + public String updateBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + BindingResult bindingResult, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -260,8 +260,8 @@ public String updateBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO board * @throws Exception */ @RequestMapping("/cop/bbs/DeleteBBSMasterInf.do") - public String deleteBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, SessionStatus status) - throws Exception { + public String deleteBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -322,8 +322,8 @@ public String selectBBSMasterInfsPop(@ModelAttribute("searchVO") BoardMasterVO b * @throws Exception */ @RequestMapping("/cop/bbs/insertBdMstrByTrget.do") - public String insertBdMstrByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, BindingResult bindingResult, - SessionStatus status, ModelMap model) throws Exception { + public String insertBdMstrByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + BindingResult bindingResult, SessionStatus status, ModelMap model) throws Exception { checkAuthority(boardMasterVO); // server-side 권한 확인 @@ -415,7 +415,8 @@ public String selectBdMstrListByTrget(@ModelAttribute("searchVO") BoardMasterVO * @throws Exception */ @RequestMapping("/cop/bbs/SelectBBSMasterInfByTrget.do") - public String selectBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @RequestParam Map commandMap, ModelMap model) throws Exception { + public String selectBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @RequestParam Map commandMap, + ModelMap model) throws Exception { checkAuthority(boardMasterVO); // server-side 권한 확인 @@ -522,8 +523,8 @@ public String addBBSMasterByTrget(@ModelAttribute("searchVO") BoardMasterVO boar * @throws Exception */ @RequestMapping("/cop/bbs/DeleteBBSMasterInfByTrget.do") - public String deleteBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, SessionStatus status) - throws Exception { + public String deleteBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + SessionStatus status) throws Exception { checkAuthority(boardMasterVO); // server-side 권한 확인 diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java index 049a0f6..3dc05b4 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java @@ -3,19 +3,11 @@ import java.util.List; import java.util.Map; -import egovframework.com.cmm.ComDefaultCodeVO; -import egovframework.com.cmm.LoginVO; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.let.cop.bbs.service.BoardMaster; -import egovframework.let.cop.bbs.service.BoardMasterVO; -import egovframework.let.cop.bbs.service.EgovBBSLoneMasterService; +import javax.annotation.Resource; import org.egovframe.rte.fdl.property.EgovPropertyService; import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; - -import javax.annotation.Resource; - import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; @@ -25,22 +17,30 @@ import org.springframework.web.bind.support.SessionStatus; import org.springmodules.validation.commons.DefaultBeanValidator; +import egovframework.com.cmm.ComDefaultCodeVO; +import egovframework.com.cmm.LoginVO; +import egovframework.com.cmm.service.EgovCmmUseService; +import egovframework.let.cop.bbs.service.BoardMaster; +import egovframework.let.cop.bbs.service.BoardMasterVO; +import egovframework.let.cop.bbs.service.EgovBBSLoneMasterService; + /** - * 게시판 속성관리를 위한 컨트롤러 클래스 + * 게시판 속성관리를 위한 컨트롤러 클래스 + * * @author 공통 서비스 개발팀 한성곤 * @since 2009.08.25 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *   수정일      수정자          수정내용
  *  -------    --------    ---------------------------
- *  2009.08.25  한성곤          최초 생성
- *  2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *  2009.08.25  한성곤           최초 생성
+ *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
  *
- *  
+ *
*/ @Controller public class EgovBBSLoneMasterController { @@ -97,8 +97,8 @@ public String addBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMast * @throws Exception */ @RequestMapping("/cop/bbs/insertBoardMaster.do") - public String insertBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, BindingResult bindingResult, - SessionStatus status, ModelMap model) throws Exception { + public String insertBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + BindingResult bindingResult, SessionStatus status, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -198,8 +198,8 @@ public String selectBoardMaster(@ModelAttribute("searchVO") BoardMasterVO search * @throws Exception */ @RequestMapping("/cop/bbs/updateBoardMaster.do") - public String updateBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, BindingResult bindingResult, - ModelMap model) throws Exception { + public String updateBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + BindingResult bindingResult, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -231,8 +231,8 @@ public String updateBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardM * @throws Exception */ @RequestMapping("/cop/bbs/deleteBoardMaster.do") - public String deleteBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, SessionStatus status) - throws Exception { + public String deleteBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO, @ModelAttribute("boardMaster") BoardMaster boardMaster, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java index 34b76ec..05011b0 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java @@ -38,7 +38,7 @@ /** * 게시물 관리를 위한 컨트롤러 클래스 - * + * * @author 공통 서비스 개발팀 이삼섭 * @since 2009.03.19 * @version 1.0 @@ -51,7 +51,7 @@ * ------- -------- --------------------------- * 2009.03.19 이삼섭 최초 생성 * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.24 이백행 요청 메서드 정리 * * @@ -121,8 +121,7 @@ protected String unscript(String data) { * @throws Exception */ @GetMapping("/cop/bbs/selectBoardList.do") - public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model, - HttpServletRequest request) throws Exception { + public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model, HttpServletRequest request) throws Exception { System.out.println(boardVO.getBbsId()); // 메인화면에서 넘어온 경우 메뉴 갱신을 위해 추가 request.getSession().setAttribute("menuNo", "3000000"); @@ -287,10 +286,9 @@ public String addBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Model * @throws Exception */ @PostMapping("/cop/bbs/insertBoardArticle.do") - public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, ModelMap model) - throws Exception { + public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, + ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -403,10 +401,9 @@ public String addReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, * @throws Exception */ @PostMapping("/cop/bbs/replyBoardArticle.do") - public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -481,8 +478,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, * @throws Exception */ @GetMapping("/cop/bbs/forUpdateBoardArticle.do") - public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("board") BoardVO vo, ModelMap model) throws Exception { + public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") BoardVO vo, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -530,10 +526,9 @@ public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boar * @throws Exception */ @PostMapping("/cop/bbs/updateBoardArticle.do") - public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -695,8 +690,8 @@ public String selectGuestList(@ModelAttribute("searchVO") BoardVO boardVO, Model * @throws Exception */ @RequestMapping("/cop/bbs/selectSingleGuestList.do") - public String selectSingleGuestList(@ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("brdMstrVO") BoardMasterVO brdMstrVO, ModelMap model) throws Exception { + public String selectSingleGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("brdMstrVO") BoardMasterVO brdMstrVO, ModelMap model) + throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); @SuppressWarnings("unused") @@ -744,8 +739,7 @@ public String selectSingleGuestList(@ModelAttribute("searchVO") BoardVO boardVO, * @throws Exception */ @RequestMapping("/cop/bbs/deleteGuestList.do") - public String deleteGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, - ModelMap model) throws Exception { + public String deleteGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, ModelMap model) throws Exception { @SuppressWarnings("unused") LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -767,8 +761,8 @@ public String deleteGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode * @throws Exception */ @RequestMapping("/cop/bbs/updateGuestList.do") - public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, - BindingResult bindingResult, ModelMap model) throws Exception { + public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, BindingResult bindingResult, + ModelMap model) throws Exception { // BBST02, BBST04 LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); @@ -839,8 +833,8 @@ public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode * @throws Exception */ @RequestMapping("/cop/bbs/insertGuestList.do") - public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, - BindingResult bindingResult, ModelMap model) throws Exception { + public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, BindingResult bindingResult, + ModelMap model) throws Exception { // 익명으로 등록이 가능한 부분임 // 무인증이 되려면 별도의 컨트롤러를 하나 더 등록해야함 @@ -916,8 +910,7 @@ public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/selectBoardList.do") - public String selectAnonymousBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) - throws Exception { + public String selectAnonymousBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { boardVO.setBbsId(boardVO.getBbsId()); boardVO.setBbsNm(boardVO.getBbsNm()); @@ -984,8 +977,7 @@ public String selectAnonymousBoardArticles(@ModelAttribute("searchVO") BoardVO b * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/addBoardArticle.do") - public String addAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) - throws Exception { + public String addAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { Boolean isAuthenticated = true; @@ -1034,10 +1026,9 @@ public String addAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO board * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/insertBoardArticle.do") - public String insertAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, ModelMap model) - throws Exception { + public String insertAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, SessionStatus status, + ModelMap model) throws Exception { Boolean isAuthenticated = true; @@ -1112,8 +1103,7 @@ public String insertAnonymousBoardArticle(final MultipartHttpServletRequest mult * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/selectBoardArticle.do") - public String selectAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) - throws Exception { + public String selectAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { // 조회수 증가 여부 지정 boardVO.setPlusCount(true); @@ -1169,9 +1159,8 @@ public String selectAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/deleteBoardArticle.do") - public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("board") Board board, @ModelAttribute("bdMstr") BoardMaster bdMstr, ModelMap model) - throws Exception { + public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") Board board, + @ModelAttribute("bdMstr") BoardMaster bdMstr, ModelMap model) throws Exception { Boolean isAuthenticated = true; @@ -1227,8 +1216,8 @@ public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/forUpdateBoardArticle.do") - public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, - @ModelAttribute("board") BoardVO vo, ModelMap model) throws Exception { + public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("board") BoardVO vo, ModelMap model) + throws Exception { Boolean isAuthenticated = true; @@ -1300,10 +1289,9 @@ public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") Boa * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/updateBoardArticle.do") - public String updateAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String updateAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { Boolean isAuthenticated = true; @@ -1381,8 +1369,7 @@ public String updateAnonymousBoardArticle(final MultipartHttpServletRequest mult * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/addReplyBoardArticle.do") - public String addAnonymousReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) - throws Exception { + public String addAnonymousReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model) throws Exception { BoardMasterVO master = new BoardMasterVO(); BoardMasterVO vo = new BoardMasterVO(); @@ -1429,10 +1416,9 @@ public String addAnonymousReplyBoardArticle(@ModelAttribute("searchVO") BoardVO * @throws Exception */ @RequestMapping("/cop/bbs/anonymous/replyBoardArticle.do") - public String replyAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, - @ModelAttribute("searchVO") BoardVO boardVO, @ModelAttribute("bdMstr") BoardMaster bdMstr, - @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, SessionStatus status) - throws Exception { + public String replyAnonymousBoardArticle(final MultipartHttpServletRequest multiRequest, @ModelAttribute("searchVO") BoardVO boardVO, + @ModelAttribute("bdMstr") BoardMaster bdMstr, @ModelAttribute("board") Board board, BindingResult bindingResult, ModelMap model, + SessionStatus status) throws Exception { Boolean isAuthenticated = true; From 3d6f85c404fb80bd3f9477a8f2804dc8c0b407e9 Mon Sep 17 00:00:00 2001 From: Jurepi Date: Tue, 8 Oct 2024 10:36:15 +0900 Subject: [PATCH 2/3] Source > Format --- .../let/main/web/EgovMainController.java | 323 +++++++++--------- 1 file changed, 159 insertions(+), 164 deletions(-) diff --git a/src/main/java/egovframework/let/main/web/EgovMainController.java b/src/main/java/egovframework/let/main/web/EgovMainController.java index 9b14a02..f732aa1 100644 --- a/src/main/java/egovframework/let/main/web/EgovMainController.java +++ b/src/main/java/egovframework/let/main/web/EgovMainController.java @@ -2,6 +2,18 @@ import java.util.Map; +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; +import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.SessionAttributes; + import egovframework.com.cmm.ComDefaultVO; import egovframework.com.cmm.LoginVO; import egovframework.let.cop.bbs.service.BoardVO; @@ -12,52 +24,41 @@ import egovframework.let.uss.olh.faq.service.FaqManageDefaultVO; import egovframework.let.uss.olp.qri.service.EgovQustnrRespondInfoService; -import org.egovframe.rte.fdl.security.userdetails.util.EgovUserDetailsHelper; -import org.egovframe.rte.ptl.mvc.tags.ui.pagination.PaginationInfo; - -import javax.annotation.Resource; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.stereotype.Controller; -import org.springframework.ui.ModelMap; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestParam; -import org.springframework.web.bind.annotation.SessionAttributes; - /** * 템플릿 메인 페이지 컨트롤러 클래스(Sample 소스) + * * @author 실행환경 개발팀 JJY * @since 2011.08.31 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *  수정일              수정자           수정내용
  *  ----------  --------   ---------------------------
- *  2011.08.31  JJY        최초 생성
- *  2021.08.12  신용호            추가 URL 생성 
+ *  2011.08.31  JJY           최초 생성
+ *  2021.08.12  신용호           추가 URL 생성
  *
- * 
+ *
*/ -@Controller@SessionAttributes(types = ComDefaultVO.class) +@Controller +@SessionAttributes(types = ComDefaultVO.class) public class EgovMainController { /** * EgovBBSManageService */ @Resource(name = "EgovBBSManageService") - private EgovBBSManageService bbsMngService; + private EgovBBSManageService bbsMngService; /** EgovMenuManageService */ @Resource(name = "meunManageService") - private EgovMenuManageService menuManageService; + private EgovMenuManageService menuManageService; /** FaqManageService */ @Resource(name = "FaqManageService") - private EgovFaqManageService faqManageService; + private EgovFaqManageService faqManageService; /** egovQustnrRespondInfoService */ @Resource(name = "egovQustnrRespondInfoService") @@ -71,13 +72,13 @@ public class EgovMainController { * @exception Exception Exception */ @RequestMapping(value = "/cmm/forwardPage.do") - public String forwardPageWithMenuNo(HttpServletRequest request, @RequestParam Map commandMap) - throws Exception{ + public String forwardPageWithMenuNo(HttpServletRequest request, @RequestParam Map commandMap) throws Exception { return ""; } /** * 템플릿 메인 페이지 조회 + * * @return 메인페이지 정보 Map [key : 항목명] * * @param request @@ -85,9 +86,8 @@ public String forwardPageWithMenuNo(HttpServletRequest request, @RequestParam Ma * @exception Exception Exception */ @RequestMapping(value = "/cmm/main/mainPage.do") - public String getMgtMainPage(HttpServletRequest request, ModelMap model) - throws Exception{ - + public String getMgtMainPage(HttpServletRequest request, ModelMap model) throws Exception { + // 공지사항 메인 컨텐츠 조회 시작 --------------------------------- BoardVO boardVO = new BoardVO(); boardVO.setUseAt("Y"); @@ -108,7 +108,6 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) Map map = bbsMngService.selectBoardArticles(boardVO, "BBSA02"); model.addAttribute("notiList", map.get("resultList")); - // 공지사항 메인컨텐츠 조회 끝 ----------------------------------- // 자유게시판 메인 컨텐츠 조회 시작 --------------------------------- @@ -132,10 +131,10 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) /** EgovPropertyService.SiteList */ FaqManageDefaultVO searchVO = new FaqManageDefaultVO(); searchVO.setPageUnit(3); - searchVO.setPageSize(10); + searchVO.setPageSize(10); - /** pageing */ - paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); + /** pageing */ + paginationInfo.setCurrentPageNo(searchVO.getPageIndex()); paginationInfo.setRecordCountPerPage(searchVO.getPageUnit()); paginationInfo.setPageSize(searchVO.getPageSize()); @@ -143,16 +142,16 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) searchVO.setLastIndex(paginationInfo.getLastRecordIndex()); searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - model.addAttribute("faqList", faqManageService.selectFaqList(searchVO)); + model.addAttribute("faqList", faqManageService.selectFaqList(searchVO)); // FAQ 메인 컨텐츠 조회 끝 ----------------------------------- - // 설문참여 메인 컨텐츠 조회 시작 ----------------------------------- - ComDefaultVO qVO = new ComDefaultVO(); - qVO.setPageUnit(1); - qVO.setPageSize(10); + // 설문참여 메인 컨텐츠 조회 시작 ----------------------------------- + ComDefaultVO qVO = new ComDefaultVO(); + qVO.setPageUnit(1); + qVO.setPageSize(10); - /** pageing */ + /** pageing */ paginationInfo.setCurrentPageNo(qVO.getPageIndex()); paginationInfo.setRecordCountPerPage(qVO.getPageUnit()); paginationInfo.setPageSize(qVO.getPageSize()); @@ -161,143 +160,139 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) qVO.setLastIndex(paginationInfo.getLastRecordIndex()); qVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - model.addAttribute("qriList", egovQustnrRespondInfoService.selectQustnrRespondInfoManageList(qVO)); + model.addAttribute("qriList", egovQustnrRespondInfoService.selectQustnrRespondInfoManageList(qVO)); - // 설문참여 메인 컨텐츠 조회 끝 ----------------------------------- + // 설문참여 메인 컨텐츠 조회 끝 ----------------------------------- return "main/EgovMainView"; } /** - * Header Page를 조회한다. - * @param menuManageVO MenuManageVO - * @return 출력페이지정보 "EgovIncHeader" - * @exception Exception - */ - @RequestMapping(value="/sym/mms/EgovHeader.do") - public String selectHeader( - @ModelAttribute("menuManageVO") MenuManageVO menuManageVO, - @RequestParam(value="flag", required=false) String flag, - ModelMap model) - throws Exception { - - LoginVO user = - EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; - if(EgovUserDetailsHelper.isAuthenticated() && user!=null){ - menuManageVO.setTmp_Id(user.getId()); - menuManageVO.setTmp_Password(user.getPassword()); - menuManageVO.setTmp_UserSe(user.getUserSe()); - menuManageVO.setTmp_Name(user.getName()); - menuManageVO.setTmp_Email(user.getEmail()); - menuManageVO.setTmp_OrgnztId(user.getOrgnztId()); - menuManageVO.setTmp_UniqId(user.getUniqId()); - model.addAttribute("list_headmenu", menuManageService.selectMainMenuHead(menuManageVO)); - model.addAttribute("list_menulist", menuManageService.selectMainMenuLeft(menuManageVO)); - }else{ - menuManageVO.setAuthorCode("ROLE_ANONYMOUS"); - model.addAttribute("list_headmenu", menuManageService.selectMainMenuHeadByAuthor(menuManageVO)); - model.addAttribute("list_menulist", menuManageService.selectMainMenuLeftByAuthor(menuManageVO)); - } - - return "main/inc/EgovIncHeader"; // 업무화면의 상단메뉴 화면 - - } + * Header Page를 조회한다. + * + * @param menuManageVO MenuManageVO + * @return 출력페이지정보 "EgovIncHeader" + * @exception Exception + */ + @RequestMapping(value = "/sym/mms/EgovHeader.do") + public String selectHeader(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, @RequestParam(value = "flag", required = false) String flag, + ModelMap model) throws Exception { + + LoginVO user = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null; + if (EgovUserDetailsHelper.isAuthenticated() && user != null) { + menuManageVO.setTmp_Id(user.getId()); + menuManageVO.setTmp_Password(user.getPassword()); + menuManageVO.setTmp_UserSe(user.getUserSe()); + menuManageVO.setTmp_Name(user.getName()); + menuManageVO.setTmp_Email(user.getEmail()); + menuManageVO.setTmp_OrgnztId(user.getOrgnztId()); + menuManageVO.setTmp_UniqId(user.getUniqId()); + model.addAttribute("list_headmenu", menuManageService.selectMainMenuHead(menuManageVO)); + model.addAttribute("list_menulist", menuManageService.selectMainMenuLeft(menuManageVO)); + } else { + menuManageVO.setAuthorCode("ROLE_ANONYMOUS"); + model.addAttribute("list_headmenu", menuManageService.selectMainMenuHeadByAuthor(menuManageVO)); + model.addAttribute("list_menulist", menuManageService.selectMainMenuLeftByAuthor(menuManageVO)); + } + + return "main/inc/EgovIncHeader"; // 업무화면의 상단메뉴 화면 + + } /** - * Footer Page를 조회한다. - * @param - * @return 출력페이지정보 "EgovIncFooter" - * @exception Exception - */ - @RequestMapping(value="/sym/mms/EgovFooter.do") - public String selectFooter(ModelMap model) throws Exception { - return "main/inc/EgovIncFooter"; - } - - /** - * 좌측메뉴를 조회한다. - * @param - * @return 출력페이지정보 "EgovIncLeftmenu" - * @exception Exception - */ - @RequestMapping(value="/sym/mms/EgovMenuLeft.do") - public String selectMenuLeft(ModelMap model) throws Exception { - - //LoginVO user = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; - - //LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - if(EgovUserDetailsHelper.isAuthenticated()){ - //인증된 경우 처리할 사항 추가 ... - model.addAttribute("lastLogoutDateTime", "로그아웃 타임: 2021-08-12 11:30"); - //최근 로그아웃 시간 등에 대한 확보 후 메인 컨텐츠로 활용 - } - - return "main/inc/EgovIncLeftmenu"; - } + * Footer Page를 조회한다. + * + * @param + * @return 출력페이지정보 "EgovIncFooter" + * @exception Exception + */ + @RequestMapping(value = "/sym/mms/EgovFooter.do") + public String selectFooter(ModelMap model) throws Exception { + return "main/inc/EgovIncFooter"; + } /** - * Head메뉴를 조회한다. - * @param menuManageVO MenuManageVO - * @return 출력페이지정보 "main_headG", "main_head" - * @exception Exception - */ - @RequestMapping(value="/sym/mms/EgovMainMenuHead.do") - public String selectMainMenuHead( - @ModelAttribute("menuManageVO") MenuManageVO menuManageVO, - @RequestParam(value="flag", required=false) String flag, - ModelMap model) - throws Exception { - - LoginVO user = - EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; - if(EgovUserDetailsHelper.isAuthenticated() && user!=null){ - menuManageVO.setTmp_Id(user.getId()); - menuManageVO.setTmp_Password(user.getPassword()); - menuManageVO.setTmp_UserSe(user.getUserSe()); - menuManageVO.setTmp_Name(user.getName()); - menuManageVO.setTmp_Email(user.getEmail()); - menuManageVO.setTmp_OrgnztId(user.getOrgnztId()); - menuManageVO.setTmp_UniqId(user.getUniqId()); - model.addAttribute("list_headmenu", menuManageService.selectMainMenuHead(menuManageVO)); - model.addAttribute("list_menulist", menuManageService.selectMainMenuLeft(menuManageVO)); - }else{ - menuManageVO.setAuthorCode("ROLE_ANONYMOUS"); - model.addAttribute("list_headmenu", menuManageService.selectMainMenuHeadByAuthor(menuManageVO)); - model.addAttribute("list_menulist", menuManageService.selectMainMenuLeftByAuthor(menuManageVO)); - } - - if(flag==null){ - return "main/inc/EgovIncSubHeaderOld"; // 업무화면의 상단메뉴 화면 - }else if(flag.equals("MAIN")){ - return "main/inc/EgovIncHeaderOld"; // 메인화면의 상단메뉴 화면 - }else{ - return "main/inc/EgovIncSubHeaderOld"; // 업무화면의 상단메뉴 화면 - } - } - - - /** - * 좌측메뉴를 조회한다. - * @param menuManageVO MenuManageVO - * @param vStartP String - * @return 출력페이지정보 "main_left" - * @exception Exception - */ - @RequestMapping(value="/sym/mms/EgovMainMenuLeft.do") - public String selectMainMenuLeft( - ModelMap model) - throws Exception { - - //LoginVO user = EgovUserDetailsHelper.isAuthenticated()? (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; - - //LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); - if(EgovUserDetailsHelper.isAuthenticated()){ - //인증된 경우 처리할 사항 추가 ... - model.addAttribute("lastLogoutDateTime", "로그아웃 타임: 2011-11-10 11:30"); - //최근 로그아웃 시간 등에 대한 확보 후 메인 컨텐츠로 활용 - } - - return "main/inc/EgovIncLeftmenuOld"; - } + * 좌측메뉴를 조회한다. + * + * @param + * @return 출력페이지정보 "EgovIncLeftmenu" + * @exception Exception + */ + @RequestMapping(value = "/sym/mms/EgovMenuLeft.do") + public String selectMenuLeft(ModelMap model) throws Exception { + + // LoginVO user = EgovUserDetailsHelper.isAuthenticated()? + // (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; + + // LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); + if (EgovUserDetailsHelper.isAuthenticated()) { + // 인증된 경우 처리할 사항 추가 ... + model.addAttribute("lastLogoutDateTime", "로그아웃 타임: 2021-08-12 11:30"); + // 최근 로그아웃 시간 등에 대한 확보 후 메인 컨텐츠로 활용 + } + + return "main/inc/EgovIncLeftmenu"; + } + + /** + * Head메뉴를 조회한다. + * + * @param menuManageVO MenuManageVO + * @return 출력페이지정보 "main_headG", "main_head" + * @exception Exception + */ + @RequestMapping(value = "/sym/mms/EgovMainMenuHead.do") + public String selectMainMenuHead(@ModelAttribute("menuManageVO") MenuManageVO menuManageVO, @RequestParam(value = "flag", required = false) String flag, + ModelMap model) throws Exception { + + LoginVO user = EgovUserDetailsHelper.isAuthenticated() ? (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser() : null; + if (EgovUserDetailsHelper.isAuthenticated() && user != null) { + menuManageVO.setTmp_Id(user.getId()); + menuManageVO.setTmp_Password(user.getPassword()); + menuManageVO.setTmp_UserSe(user.getUserSe()); + menuManageVO.setTmp_Name(user.getName()); + menuManageVO.setTmp_Email(user.getEmail()); + menuManageVO.setTmp_OrgnztId(user.getOrgnztId()); + menuManageVO.setTmp_UniqId(user.getUniqId()); + model.addAttribute("list_headmenu", menuManageService.selectMainMenuHead(menuManageVO)); + model.addAttribute("list_menulist", menuManageService.selectMainMenuLeft(menuManageVO)); + } else { + menuManageVO.setAuthorCode("ROLE_ANONYMOUS"); + model.addAttribute("list_headmenu", menuManageService.selectMainMenuHeadByAuthor(menuManageVO)); + model.addAttribute("list_menulist", menuManageService.selectMainMenuLeftByAuthor(menuManageVO)); + } + + if (flag == null) { + return "main/inc/EgovIncSubHeaderOld"; // 업무화면의 상단메뉴 화면 + } else if (flag.equals("MAIN")) { + return "main/inc/EgovIncHeaderOld"; // 메인화면의 상단메뉴 화면 + } else { + return "main/inc/EgovIncSubHeaderOld"; // 업무화면의 상단메뉴 화면 + } + } + + /** + * 좌측메뉴를 조회한다. + * + * @param menuManageVO MenuManageVO + * @param vStartP String + * @return 출력페이지정보 "main_left" + * @exception Exception + */ + @RequestMapping(value = "/sym/mms/EgovMainMenuLeft.do") + public String selectMainMenuLeft(ModelMap model) throws Exception { + + // LoginVO user = EgovUserDetailsHelper.isAuthenticated()? + // (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser():null; + + // LoginVO user = (LoginVO)EgovUserDetailsHelper.getAuthenticatedUser(); + if (EgovUserDetailsHelper.isAuthenticated()) { + // 인증된 경우 처리할 사항 추가 ... + model.addAttribute("lastLogoutDateTime", "로그아웃 타임: 2011-11-10 11:30"); + // 최근 로그아웃 시간 등에 대한 확보 후 메인 컨텐츠로 활용 + } + + return "main/inc/EgovIncLeftmenuOld"; + } } \ No newline at end of file From f6b34f855600567a1785ad7524c1790c0aa9b6e1 Mon Sep 17 00:00:00 2001 From: Jurepi Date: Tue, 8 Oct 2024 11:25:31 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=EB=A1=AC=EB=B3=B5=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=EC=9E=90=20=EA=B8=B0=EB=B0=98=20=EC=A2=85=EC=86=8D=EC=84=B1=20?= =?UTF-8?q?=EC=A3=BC=EC=9E=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bbs/service/impl/BBSAddedOptionsDAO.java | 13 ++- .../service/impl/BBSAttributeManageDAO.java | 3 +- .../bbs/service/impl/BBSLoneMasterDAO.java | 3 +- .../cop/bbs/service/impl/BBSManageDAO.java | 3 +- .../EgovBBSAttributeManageServiceImpl.java | 48 ++++---- .../impl/EgovBBSLoneMasterServiceImpl.java | 29 ++--- .../impl/EgovBBSManageServiceImpl.java | 54 ++++----- .../bbs/web/EgovBBSAdminManageController.java | 51 ++++---- .../web/EgovBBSAttributeManageController.java | 34 +++--- .../bbs/web/EgovBBSLoneMasterController.java | 18 +-- .../cop/bbs/web/EgovBBSManageController.java | 110 +++++++++--------- .../let/main/web/EgovMainController.java | 10 +- 12 files changed, 195 insertions(+), 181 deletions(-) diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java index 430403a..d36b814 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAddedOptionsDAO.java @@ -13,7 +13,7 @@ * @since 2009.06.26 * @version 1.0 * @see - * + * *
  * << 개정이력(Modification Information) >>
  *
@@ -21,15 +21,16 @@
  *  -------    --------    ---------------------------
  *  2009.06.26  한성곤           최초 생성
  *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
- * 
+ *  2024.10.08  안단희           롬복 생성자 기반 종속성 주입
+ *  
  *      
*/ -@Repository("BBSAddedOptionsDAO") +@Repository public class BBSAddedOptionsDAO extends EgovAbstractMapper { /** * 신규 게시판 추가기능 정보를 등록한다. - * + * * @param BoardMaster */ public int insertAddedOptionsInf(BoardMaster boardMaster) throws Exception { @@ -38,7 +39,7 @@ public int insertAddedOptionsInf(BoardMaster boardMaster) throws Exception { /** * 게시판 추가기능 정보 한 건을 상세조회 한다. - * + * * @param BoardMasterVO */ public BoardMasterVO selectAddedOptionsInf(BoardMaster vo) throws Exception { @@ -47,7 +48,7 @@ public BoardMasterVO selectAddedOptionsInf(BoardMaster vo) throws Exception { /** * 게시판 추가기능 정보를 수정한다. - * + * * @param BoardMaster */ public void updateAddedOptionsInf(BoardMaster boardMaster) throws Exception { diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java index 8d86b27..8d87fba 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSAttributeManageDAO.java @@ -24,10 +24,11 @@ * 2009.03.12 이삼섭 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ -@Repository("BBSAttributeManageDAO") +@Repository public class BBSAttributeManageDAO extends EgovAbstractMapper { /** diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java index 1855d0f..02612af 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSLoneMasterDAO.java @@ -24,10 +24,11 @@ * 2009.08.25 한성곤 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ -@Repository("BBSLoneMasterDAO") +@Repository public class BBSLoneMasterDAO extends EgovAbstractMapper { /** diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java index dc9f06a..b2dce67 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/BBSManageDAO.java @@ -25,10 +25,11 @@ * 2009.03.19 이삼섭 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ -@Repository("BBSManageDAO") +@Repository public class BBSManageDAO extends EgovAbstractMapper { /** diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java index 8169d5e..6a1f55b 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSAttributeManageServiceImpl.java @@ -21,6 +21,7 @@ import egovframework.let.cop.com.service.EgovUserInfManageService; import egovframework.let.cop.com.service.UserInfVO; import egovframework.let.cop.com.service.impl.BBSUseInfoManageDAO; +import lombok.RequiredArgsConstructor; /** * 게시판 속성관리를 위한 서비스 구현 클래스 @@ -38,16 +39,17 @@ * 2009.03.24 이삼섭 최초 생성 * 2009.06.26 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ -@Service("EgovBBSAttributeManageService") +@Service +@RequiredArgsConstructor public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl implements EgovBBSAttributeManageService { private static final Logger LOGGER = LoggerFactory.getLogger(EgovBBSAttributeManageServiceImpl.class); - @Resource(name = "BBSAttributeManageDAO") - private BBSAttributeManageDAO attrbMngDAO; + private final BBSAttributeManageDAO bBSAttributeManageDAO; @Resource(name = "BBSUseInfoManageDAO") private BBSUseInfoManageDAO bbsUseDAO; @@ -55,8 +57,7 @@ public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl i @Resource(name = "EgovUserInfManageService") private EgovUserInfManageService userService; - @Resource(name = "egovBBSMstrIdGnrService") - private EgovIdGnrService idgenService; + private final EgovIdGnrService egovBBSMstrIdGnrService; @Resource(name = "propertiesService") protected EgovPropertyService propertyService; @@ -64,8 +65,7 @@ public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl i // --------------------------------- // 2009.06.26 : 2단계 기능 추가 // --------------------------------- - @Resource(name = "BBSAddedOptionsDAO") - private BBSAddedOptionsDAO addedOptionsDAO; + private final BBSAddedOptionsDAO bBSAddedOptionsDAO; //// ------------------------------- /** @@ -75,7 +75,7 @@ public class EgovBBSAttributeManageServiceImpl extends EgovAbstractServiceImpl i */ @Override public void deleteBBSMasterInf(BoardMaster boardMaster) throws Exception { - attrbMngDAO.deleteBBSMasterInf(boardMaster); + bBSAttributeManageDAO.deleteBBSMasterInf(boardMaster); BoardUseInf bdUseInf = new BoardUseInf(); @@ -92,17 +92,17 @@ public void deleteBBSMasterInf(BoardMaster boardMaster) throws Exception { */ @Override public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { - String bbsId = idgenService.getNextStringId(); + String bbsId = egovBBSMstrIdGnrService.getNextStringId(); boardMaster.setBbsId(bbsId); - attrbMngDAO.insertBBSMasterInf(boardMaster); + bBSAttributeManageDAO.insertBBSMasterInf(boardMaster); // --------------------------------- // 2009.06.26 : 2단계 기능 추가 // --------------------------------- if (boardMaster.getOption().equals("comment") || boardMaster.getOption().equals("stsfdg")) { - addedOptionsDAO.insertAddedOptionsInf(boardMaster); + bBSAddedOptionsDAO.insertAddedOptionsInf(boardMaster); } //// ------------------------------- @@ -163,7 +163,7 @@ public String insertBBSMastetInf(BoardMaster boardMaster) throws Exception { */ @Override public List selectAllBBSMasteInf(BoardMasterVO vo) throws Exception { - return attrbMngDAO.selectAllBBSMasteInf(vo); + return bBSAttributeManageDAO.selectAllBBSMasteInf(vo); } /** @@ -178,11 +178,11 @@ public BoardMasterVO selectBBSMasterInf(BoardMaster searchVO) throws Exception { // --------------------------------- // return attrbMngDAO.selectBBSMasterInf(searchVO); - BoardMasterVO result = attrbMngDAO.selectBBSMasterInf(searchVO); + BoardMasterVO result = bBSAttributeManageDAO.selectBBSMasterInf(searchVO); String flag = propertyService.getString("Globals.addedOptions"); if (flag != null && flag.trim().equalsIgnoreCase("true")) { - BoardMasterVO options = addedOptionsDAO.selectAddedOptionsInf(searchVO); + BoardMasterVO options = bBSAddedOptionsDAO.selectAddedOptionsInf(searchVO); if (options != null) { if (options.getCommentAt().equals("Y")) { @@ -209,8 +209,8 @@ public BoardMasterVO selectBBSMasterInf(BoardMaster searchVO) throws Exception { */ @Override public Map selectBBSMasterInfs(BoardMasterVO searchVO) throws Exception { - List result = attrbMngDAO.selectBBSMasterInfs(searchVO); - int cnt = attrbMngDAO.selectBBSMasterInfsCnt(searchVO); + List result = bBSAttributeManageDAO.selectBBSMasterInfs(searchVO); + int cnt = bBSAttributeManageDAO.selectBBSMasterInfsCnt(searchVO); Map map = new HashMap(); @@ -227,7 +227,7 @@ public Map selectBBSMasterInfs(BoardMasterVO searchVO) throws Ex */ @Override public void updateBBSMasterInf(BoardMaster boardMaster) throws Exception { - attrbMngDAO.updateBBSMasterInf(boardMaster); + bBSAttributeManageDAO.updateBBSMasterInf(boardMaster); // --------------------------------- // 2009.06.26 : 2단계 기능 추가 @@ -237,11 +237,11 @@ public void updateBBSMasterInf(BoardMaster boardMaster) throws Exception { if (boardMaster.getOption().equals("na")) { return; } - BoardMasterVO options = addedOptionsDAO.selectAddedOptionsInf(boardMaster); + BoardMasterVO options = bBSAddedOptionsDAO.selectAddedOptionsInf(boardMaster); if (options == null) { boardMaster.setFrstRegisterId(boardMaster.getLastUpdusrId()); - addedOptionsDAO.insertAddedOptionsInf(boardMaster); + bBSAddedOptionsDAO.insertAddedOptionsInf(boardMaster); } else { // 수정 기능 제외 (새롭게 선택사항을 지정한 insert만 처리함) // addedOptionsDAO.updateAddedOptionsInf(boardMaster); @@ -266,8 +266,8 @@ public void validateTemplate(BoardMasterVO searchVO) throws Exception { */ @Override public Map selectBdMstrListByTrget(BoardMasterVO vo) throws Exception { - List result = attrbMngDAO.selectBdMstrListByTrget(vo); - int cnt = attrbMngDAO.selectBdMstrListCntByTrget(vo); + List result = bBSAttributeManageDAO.selectBdMstrListByTrget(vo); + int cnt = bBSAttributeManageDAO.selectBdMstrListCntByTrget(vo); Map map = new HashMap(); @@ -282,7 +282,7 @@ public Map selectBdMstrListByTrget(BoardMasterVO vo) throws Exce */ @Override public List selectAllBdMstrByTrget(BoardMasterVO vo) throws Exception { - return attrbMngDAO.selectAllBdMstrByTrget(vo); + return bBSAttributeManageDAO.selectAllBdMstrByTrget(vo); } /** @@ -290,8 +290,8 @@ public List selectAllBdMstrByTrget(BoardMasterVO vo) throws Excep */ @Override public Map selectNotUsedBdMstrList(BoardMasterVO searchVO) throws Exception { - List result = attrbMngDAO.selectNotUsedBdMstrList(searchVO); - int cnt = attrbMngDAO.selectNotUsedBdMstrListCnt(searchVO); + List result = bBSAttributeManageDAO.selectNotUsedBdMstrList(searchVO); + int cnt = bBSAttributeManageDAO.selectNotUsedBdMstrListCnt(searchVO); Map map = new HashMap(); diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java index c17fb1d..72ebed2 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSLoneMasterServiceImpl.java @@ -15,6 +15,7 @@ import egovframework.let.cop.bbs.service.EgovBBSLoneMasterService; import egovframework.let.cop.com.service.BoardUseInf; import egovframework.let.cop.com.service.impl.BBSUseInfoManageDAO; +import lombok.RequiredArgsConstructor; /** * 게시판 속성관리를 위한 서비스 구현 클래스 @@ -23,7 +24,7 @@ * @since 2009.08.25 * @version 1.0 * @see - * + * *
  * << 개정이력(Modification Information) >>
  *
@@ -31,27 +32,27 @@
  *  -------    --------    ---------------------------
  *  2009.08.25  한성곤           최초 생성
  *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
- * 
+ *  2024.10.08  안단희           롬복 생성자 기반 종속성 주입
+ *
  *      
*/ -@Service("EgovBBSLoneMasterService") +@Service +@RequiredArgsConstructor public class EgovBBSLoneMasterServiceImpl extends EgovAbstractServiceImpl implements EgovBBSLoneMasterService { - @Resource(name = "BBSLoneMasterDAO") - private BBSLoneMasterDAO masterDAO; + private final BBSLoneMasterDAO bBSLoneMasterDAO; @Resource(name = "BBSUseInfoManageDAO") private BBSUseInfoManageDAO bbsUseDAO; - @Resource(name = "egovBBSMstrIdGnrService") - private EgovIdGnrService idgenService; + private final EgovIdGnrService egovBBSMstrIdGnrService; /** * 등록된 게시판 속성정보를 삭제한다. */ @Override public void deleteMaster(BoardMaster boardMaster) throws Exception { - masterDAO.deleteMaster(boardMaster); + bBSLoneMasterDAO.deleteMaster(boardMaster); BoardUseInf bdUseInf = new BoardUseInf(); @@ -66,11 +67,11 @@ public void deleteMaster(BoardMaster boardMaster) throws Exception { */ @Override public String insertMaster(BoardMaster boardMaster) throws Exception { - String bbsId = idgenService.getNextStringId(); + String bbsId = egovBBSMstrIdGnrService.getNextStringId(); boardMaster.setBbsId(bbsId); - masterDAO.insertMaster(boardMaster); + bBSLoneMasterDAO.insertMaster(boardMaster); // ---------------------------------------------- // 게시판 사용 등록 (시스템) @@ -93,7 +94,7 @@ public String insertMaster(BoardMaster boardMaster) throws Exception { */ @Override public BoardMasterVO selectMaster(BoardMaster searchVO) throws Exception { - return masterDAO.selectMaster(searchVO); + return bBSLoneMasterDAO.selectMaster(searchVO); } /** @@ -101,8 +102,8 @@ public BoardMasterVO selectMaster(BoardMaster searchVO) throws Exception { */ @Override public Map selectMasterList(BoardMasterVO searchVO) throws Exception { - List result = masterDAO.selectMasterList(searchVO); - int cnt = masterDAO.selectMasterListCnt(searchVO); + List result = bBSLoneMasterDAO.selectMasterList(searchVO); + int cnt = bBSLoneMasterDAO.selectMasterListCnt(searchVO); Map map = new HashMap(); @@ -117,6 +118,6 @@ public Map selectMasterList(BoardMasterVO searchVO) throws Excep */ @Override public void updateMaster(BoardMaster boardMaster) throws Exception { - masterDAO.updateMaster(boardMaster); + bBSLoneMasterDAO.updateMaster(boardMaster); } } diff --git a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java index 4fd26b6..34e9a1e 100644 --- a/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java +++ b/src/main/java/egovframework/let/cop/bbs/service/impl/EgovBBSManageServiceImpl.java @@ -18,6 +18,7 @@ import egovframework.let.cop.bbs.service.BoardVO; import egovframework.let.cop.bbs.service.EgovBBSManageService; import egovframework.let.utl.fcc.service.EgovDateUtil; +import lombok.RequiredArgsConstructor; /** * 게시물 관리를 위한 서비스 구현 클래스 @@ -26,7 +27,7 @@ * @since 2009.03.19 * @version 1.0 * @see - * + * *
  * << 개정이력(Modification Information) >>
  *
@@ -34,14 +35,15 @@
  *  -------    --------    ---------------------------
  *  2009.03.19  이삼섭           최초 생성
  *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
- * 
+ *  2024.10.08  안단희           롬복 생성자 기반 종속성 주입
+ *
  *      
*/ -@Service("EgovBBSManageService") +@Service +@RequiredArgsConstructor public class EgovBBSManageServiceImpl extends EgovAbstractServiceImpl implements EgovBBSManageService { - @Resource(name = "BBSManageDAO") - private BBSManageDAO bbsMngDAO; + private final BBSManageDAO bBSManageDAO; @Resource(name = "EgovFileMngService") private EgovFileMngService fileService; @@ -51,7 +53,7 @@ public class EgovBBSManageServiceImpl extends EgovAbstractServiceImpl implements /** * 게시물 한 건을 삭제 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteBoardArticle(egovframework.let.cop.bbs.brd.service.Board) */ @Override @@ -62,7 +64,7 @@ public void deleteBoardArticle(Board board) throws Exception { board.setNttSj("이 글은 작성자에 의해서 삭제되었습니다."); - bbsMngDAO.deleteBoardArticle(board); + bBSManageDAO.deleteBoardArticle(board); if (!"".equals(fvo.getAtchFileId()) || fvo.getAtchFileId() != null) { fileService.deleteAllFileInf(fvo); @@ -71,7 +73,7 @@ public void deleteBoardArticle(Board board) throws Exception { /** * 게시판에 게시물 또는 답변 게시물을 등록 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#insertBoardArticle(egovframework.let.cop.bbs.brd.service.Board) */ @Override @@ -86,7 +88,7 @@ public void insertBoardArticle(Board board) throws Exception { @SuppressWarnings("unused") long tmpNttId = 0L; // 답글 게시물 ID - tmpNttId = bbsMngDAO.replyBoardArticle(board); + tmpNttId = bBSManageDAO.replyBoardArticle(board); } else { // 답글이 아닌경우 Parnts = 0, replyLc는 = 0, sortOrdr = nttNo(Query에서 처리) @@ -94,35 +96,35 @@ public void insertBoardArticle(Board board) throws Exception { board.setReplyLc("0"); board.setReplyAt("N"); - bbsMngDAO.insertBoardArticle(board); + bBSManageDAO.insertBoardArticle(board); } } /** * 게시물 대하여 상세 내용을 조회 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticle(egovframework.let.cop.bbs.brd.service.BoardVO) */ @Override public BoardVO selectBoardArticle(BoardVO boardVO) throws Exception { if (boardVO.isPlusCount()) { - int iniqireCo = bbsMngDAO.selectMaxInqireCo(boardVO); + int iniqireCo = bBSManageDAO.selectMaxInqireCo(boardVO); boardVO.setInqireCo(iniqireCo); - bbsMngDAO.updateInqireCo(boardVO); + bBSManageDAO.updateInqireCo(boardVO); } - return bbsMngDAO.selectBoardArticle(boardVO); + return bBSManageDAO.selectBoardArticle(boardVO); } /** * 조건에 맞는 게시물 목록을 조회 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectBoardArticles(egovframework.let.cop.bbs.brd.service.BoardVO) */ @Override public Map selectBoardArticles(BoardVO boardVO, String attrbFlag) throws Exception { - List list = bbsMngDAO.selectBoardArticleList(boardVO); + List list = bBSManageDAO.selectBoardArticleList(boardVO); List result = new ArrayList(); if ("BBSA01".equals(attrbFlag)) { @@ -146,7 +148,7 @@ public Map selectBoardArticles(BoardVO boardVO, String attrbFlag result = list; } - int cnt = bbsMngDAO.selectBoardArticleListCnt(boardVO); + int cnt = bBSManageDAO.selectBoardArticleListCnt(boardVO); Map map = new HashMap(); @@ -158,33 +160,33 @@ public Map selectBoardArticles(BoardVO boardVO, String attrbFlag /** * 게시물 한 건의 내용을 수정 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#updateBoardArticle(egovframework.let.cop.bbs.brd.service.Board) */ @Override public void updateBoardArticle(Board board) throws Exception { - bbsMngDAO.updateBoardArticle(board); + bBSManageDAO.updateBoardArticle(board); } /** * 방명록 내용을 삭제 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#deleteGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) */ @Override public void deleteGuestList(BoardVO boardVO) throws Exception { - bbsMngDAO.deleteGuestList(boardVO); + bBSManageDAO.deleteGuestList(boardVO); } /** * 방명록에 대한 목록을 조회 한다. - * + * * @see egovframework.let.cop.bbs.brd.service.EgovBBSManageService#selectGuestList(egovframework.let.cop.bbs.brd.service.BoardVO) */ @Override public Map selectGuestList(BoardVO boardVO) throws Exception { - List result = bbsMngDAO.selectGuestList(boardVO); - int cnt = bbsMngDAO.selectGuestListCnt(boardVO); + List result = bBSManageDAO.selectGuestList(boardVO); + int cnt = bBSManageDAO.selectGuestListCnt(boardVO); Map map = new HashMap(); @@ -196,13 +198,13 @@ public Map selectGuestList(BoardVO boardVO) throws Exception { /** * 방명록에 대한 패스워드를 조회 한다. - * + * * @param board * @return * @throws Exception */ @Override public String getPasswordInf(Board board) throws Exception { - return bbsMngDAO.getPasswordInf(board); + return bBSManageDAO.getPasswordInf(board); } } diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java index cf6350c..696c8bf 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAdminManageController.java @@ -32,6 +32,7 @@ import egovframework.let.cop.bbs.service.BoardVO; import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; import egovframework.let.cop.bbs.service.EgovBBSManageService; +import lombok.RequiredArgsConstructor; /** * 게시물 관리를 위한 컨트롤러 클래스 @@ -46,22 +47,22 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.03.19 이삼섭 최초 생성 - * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.10 이백행 이클립스 문제(Problems) 제거 - * 2024.09.02 이백행 요청 메서드 정리 + * 2009.03.19 이삼섭 최초 생성 + * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2024.09.02 이백행 요청 메서드 정리 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ @Controller +@RequiredArgsConstructor public class EgovBBSAdminManageController { - @Resource(name = "EgovBBSManageService") - private EgovBBSManageService bbsMngService; + private final EgovBBSManageService egovBBSManageService; - @Resource(name = "EgovBBSAttributeManageService") - private EgovBBSAttributeManageService bbsAttrbService; + private final EgovBBSAttributeManageService egovBBSAttributeManageService; @Resource(name = "EgovFileMngService") private EgovFileMngService fileMngService; @@ -140,7 +141,7 @@ public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, M vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - BoardMasterVO master = bbsAttrbService.selectBBSMasterInf(vo); + BoardMasterVO master = egovBBSAttributeManageService.selectBBSMasterInf(vo); // ------------------------------- // 방명록이면 방명록 URL로 forward @@ -163,7 +164,7 @@ public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, M boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); + Map map = egovBBSManageService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -208,7 +209,7 @@ public String selectBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Mo } boardVO.setLastUpdusrId(user.getUniqId()); - BoardVO vo = bbsMngService.selectBoardArticle(boardVO); + BoardVO vo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", vo); @@ -221,7 +222,7 @@ public String selectBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Mo master.setBbsId(boardVO.getBbsId()); master.setUniqId(user.getUniqId()); - BoardMasterVO masterVo = bbsAttrbService.selectBBSMasterInf(master); + BoardMasterVO masterVo = egovBBSAttributeManageService.selectBBSMasterInf(master); if (masterVo.getTmplatCours() == null || masterVo.getTmplatCours().equals("")) { masterVo.setTmplatCours("/css/egovframework/cop/bbs/egovBaseTemplate.css"); @@ -256,7 +257,7 @@ public String addBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Model BoardMasterVO vo = new BoardMasterVO(); vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - bdMstr = bbsAttrbService.selectBBSMasterInf(vo); + bdMstr = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", bdMstr); } @@ -300,7 +301,7 @@ public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); @@ -335,7 +336,7 @@ public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -370,7 +371,7 @@ public String addReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); model.addAttribute("result", boardVO); @@ -414,7 +415,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); model.addAttribute("result", boardVO); @@ -454,7 +455,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -493,8 +494,8 @@ public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boar master.setUniqId(user.getUniqId()); if (isAuthenticated) { - bmvo = bbsAttrbService.selectBBSMasterInf(master); - bdvo = bbsMngService.selectBoardArticle(boardVO); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); } model.addAttribute("result", bdvo); @@ -545,8 +546,8 @@ public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, master.setBbsId(boardVO.getBbsId()); master.setUniqId(user.getUniqId()); - bmvo = bbsAttrbService.selectBBSMasterInf(master); - bdvo = bbsMngService.selectBoardArticle(boardVO); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", bdvo); model.addAttribute("bdMstr", bmvo); @@ -577,7 +578,7 @@ public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.updateBoardArticle(board); + egovBBSManageService.updateBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -608,7 +609,7 @@ public String deleteBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, @M if (isAuthenticated) { board.setLastUpdusrId(user.getUniqId()); - bbsMngService.deleteBoardArticle(board); + egovBBSManageService.deleteBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java index 39dd59d..c099498 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSAttributeManageController.java @@ -26,6 +26,7 @@ import egovframework.let.cop.bbs.service.BoardMasterVO; import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; import egovframework.let.utl.fcc.service.EgovStringUtil; +import lombok.RequiredArgsConstructor; /** * 게시판 속성관리를 위한 컨트롤러 클래스 @@ -43,14 +44,15 @@ * 2009.03.12 이삼섭 최초 생성 * 2009.06.26 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ @Controller +@RequiredArgsConstructor public class EgovBBSAttributeManageController { - @Resource(name = "EgovBBSAttributeManageService") - private EgovBBSAttributeManageService bbsAttrbService; + private final EgovBBSAttributeManageService egovBBSAttributeManageService; @Resource(name = "EgovCmmUseService") private EgovCmmUseService cmmUseService; @@ -152,7 +154,7 @@ public String insertBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO board boardMaster.setTrgetId("SYSTEMDEFAULT_REGIST"); boardMaster.setPosblAtchFileSize(propertyService.getString("posblAtchFileSize")); - bbsAttrbService.insertBBSMastetInf(boardMaster); + egovBBSAttributeManageService.insertBBSMastetInf(boardMaster); } return "forward:/cop/bbs/SelectBBSMasterInfs.do"; @@ -181,7 +183,7 @@ public String selectBBSMasterInfs(@ModelAttribute("searchVO") BoardMasterVO boar boardMasterVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardMasterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsAttrbService.selectBBSMasterInfs(boardMasterVO); + Map map = egovBBSAttributeManageService.selectBBSMasterInfs(boardMasterVO); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -203,7 +205,7 @@ public String selectBBSMasterInfs(@ModelAttribute("searchVO") BoardMasterVO boar */ @RequestMapping("/cop/bbs/SelectBBSMasterInf.do") public String selectBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO searchVO, ModelMap model) throws Exception { - BoardMasterVO vo = bbsAttrbService.selectBBSMasterInf(searchVO); + BoardMasterVO vo = egovBBSAttributeManageService.selectBBSMasterInf(searchVO); model.addAttribute("result", vo); @@ -234,7 +236,7 @@ public String updateBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO board beanValidator.validate(boardMaster, bindingResult); if (bindingResult.hasErrors()) { - BoardMasterVO vo = bbsAttrbService.selectBBSMasterInf(boardMasterVO); + BoardMasterVO vo = egovBBSAttributeManageService.selectBBSMasterInf(boardMasterVO); model.addAttribute("result", vo); @@ -244,7 +246,7 @@ public String updateBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO board if (isAuthenticated) { boardMaster.setLastUpdusrId(user.getUniqId()); boardMaster.setPosblAtchFileSize(propertyService.getString("posblAtchFileSize")); - bbsAttrbService.updateBBSMasterInf(boardMaster); + egovBBSAttributeManageService.updateBBSMasterInf(boardMaster); } return "forward:/cop/bbs/SelectBBSMasterInfs.do"; @@ -268,7 +270,7 @@ public String deleteBBSMasterInf(@ModelAttribute("searchVO") BoardMasterVO board if (isAuthenticated) { boardMaster.setLastUpdusrId(user.getUniqId()); - bbsAttrbService.deleteBBSMasterInf(boardMaster); + egovBBSAttributeManageService.deleteBBSMasterInf(boardMaster); } return "forward:/cop/bbs/SelectBBSMasterInfs.do"; } @@ -298,7 +300,7 @@ public String selectBBSMasterInfsPop(@ModelAttribute("searchVO") BoardMasterVO b boardMasterVO.setUseAt("Y"); - Map map = bbsAttrbService.selectNotUsedBdMstrList(boardMasterVO); + Map map = egovBBSAttributeManageService.selectNotUsedBdMstrList(boardMasterVO); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -362,7 +364,7 @@ public String insertBdMstrByTrget(@ModelAttribute("searchVO") BoardMasterVO boar boardMaster.setRegistSeCode(registSeCode); if (isAuthenticated) { - bbsAttrbService.insertBBSMastetInf(boardMaster); + egovBBSAttributeManageService.insertBBSMastetInf(boardMaster); model.addAttribute("S_FLAG", "S"); } @@ -394,7 +396,7 @@ public String selectBdMstrListByTrget(@ModelAttribute("searchVO") BoardMasterVO boardMasterVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardMasterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsAttrbService.selectBdMstrListByTrget(boardMasterVO); + Map map = egovBBSAttributeManageService.selectBdMstrListByTrget(boardMasterVO); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -420,7 +422,7 @@ public String selectBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterV checkAuthority(boardMasterVO); // server-side 권한 확인 - BoardMasterVO vo = bbsAttrbService.selectBBSMasterInf(boardMasterVO); + BoardMasterVO vo = egovBBSAttributeManageService.selectBBSMasterInf(boardMasterVO); vo.setTrgetId(boardMasterVO.getTrgetId()); @@ -456,7 +458,7 @@ public String updateBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterV if (bindingResult.hasErrors()) { BoardMasterVO vo = new BoardMasterVO(); - vo = bbsAttrbService.selectBBSMasterInf(boardMasterVO); + vo = egovBBSAttributeManageService.selectBBSMasterInf(boardMasterVO); model.addAttribute("result", vo); @@ -467,7 +469,7 @@ public String updateBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterV boardMaster.setUseAt("Y"); if (isAuthenticated) { - bbsAttrbService.updateBBSMasterInf(boardMaster); + egovBBSAttributeManageService.updateBBSMasterInf(boardMaster); } return "forward:/cop/bbs/selectBdMstrListByTrget.do"; @@ -534,7 +536,7 @@ public String deleteBBSMasterInfByTrget(@ModelAttribute("searchVO") BoardMasterV boardMaster.setLastUpdusrId(user.getUniqId()); if (isAuthenticated) { - bbsAttrbService.deleteBBSMasterInf(boardMaster); + egovBBSAttributeManageService.deleteBBSMasterInf(boardMaster); } return "forward:/cop/bbs/selectBdMstrListByTrget.do"; @@ -556,7 +558,7 @@ public String selectAllBdMstrByTrget(@RequestParam Map commandMa vo.setTrgetId(trgetId); - List result = bbsAttrbService.selectAllBdMstrByTrget(vo); + List result = egovBBSAttributeManageService.selectAllBdMstrByTrget(vo); model.addAttribute("resultList", result); diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java index 3dc05b4..459decf 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSLoneMasterController.java @@ -23,6 +23,7 @@ import egovframework.let.cop.bbs.service.BoardMaster; import egovframework.let.cop.bbs.service.BoardMasterVO; import egovframework.let.cop.bbs.service.EgovBBSLoneMasterService; +import lombok.RequiredArgsConstructor; /** * 게시판 속성관리를 위한 컨트롤러 클래스 @@ -39,14 +40,15 @@ * ------- -------- --------------------------- * 2009.08.25 한성곤 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ @Controller +@RequiredArgsConstructor public class EgovBBSLoneMasterController { - @Resource(name = "EgovBBSLoneMasterService") - private EgovBBSLoneMasterService bbsLoneService; + private final EgovBBSLoneMasterService egovBBSLoneMasterService; @Resource(name = "EgovCmmUseService") private EgovCmmUseService cmmUseService; @@ -128,7 +130,7 @@ public String insertBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardM boardMaster.setUseAt("Y"); boardMaster.setTrgetId("SYSTEMDEFAULT_REGIST"); - bbsLoneService.insertMaster(boardMaster); + egovBBSLoneMasterService.insertMaster(boardMaster); } return "forward:/cop/bbs/selectBoardMasterList.do"; @@ -157,7 +159,7 @@ public String selectBoardMasterList(@ModelAttribute("searchVO") BoardMasterVO bo boardMasterVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardMasterVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsLoneService.selectMasterList(boardMasterVO); + Map map = egovBBSLoneMasterService.selectMasterList(boardMasterVO); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -179,7 +181,7 @@ public String selectBoardMasterList(@ModelAttribute("searchVO") BoardMasterVO bo */ @RequestMapping("/cop/bbs/selectBoardMaster.do") public String selectBoardMaster(@ModelAttribute("searchVO") BoardMasterVO searchVO, ModelMap model) throws Exception { - BoardMasterVO vo = bbsLoneService.selectMaster(searchVO); + BoardMasterVO vo = egovBBSLoneMasterService.selectMaster(searchVO); model.addAttribute("result", vo); @@ -206,7 +208,7 @@ public String updateBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardM beanValidator.validate(boardMaster, bindingResult); if (bindingResult.hasErrors()) { - BoardMasterVO vo = bbsLoneService.selectMaster(boardMasterVO); + BoardMasterVO vo = egovBBSLoneMasterService.selectMaster(boardMasterVO); model.addAttribute("result", vo); @@ -215,7 +217,7 @@ public String updateBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardM if (isAuthenticated) { boardMaster.setLastUpdusrId(user.getUniqId()); - bbsLoneService.updateMaster(boardMaster); + egovBBSLoneMasterService.updateMaster(boardMaster); } return "forward:/cop/bbs/selectBoardMasterList.do"; @@ -239,7 +241,7 @@ public String deleteBoardMaster(@ModelAttribute("searchVO") BoardMasterVO boardM if (isAuthenticated) { boardMaster.setLastUpdusrId(user.getUniqId()); - bbsLoneService.deleteMaster(boardMaster); + egovBBSLoneMasterService.deleteMaster(boardMaster); } return "forward:/cop/bbs/selectBoardMasterList.do"; } diff --git a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java index 05011b0..77f5ca8 100644 --- a/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java +++ b/src/main/java/egovframework/let/cop/bbs/web/EgovBBSManageController.java @@ -35,6 +35,7 @@ import egovframework.let.cop.bbs.service.EgovBBSAttributeManageService; import egovframework.let.cop.bbs.service.EgovBBSManageService; import egovframework.let.utl.sim.service.EgovFileScrty; +import lombok.RequiredArgsConstructor; /** * 게시물 관리를 위한 컨트롤러 클래스 @@ -49,21 +50,21 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.03.19 이삼섭 최초 생성 - * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.24 이백행 요청 메서드 정리 + * 2009.03.19 이삼섭 최초 생성 + * 2009.06.29 한성곤 2단계 기능 추가 (댓글관리, 만족도조사) + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.24 이백행 요청 메서드 정리 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ @Controller +@RequiredArgsConstructor public class EgovBBSManageController { - @Resource(name = "EgovBBSManageService") - private EgovBBSManageService bbsMngService; + private final EgovBBSManageService egovBBSManageService; - @Resource(name = "EgovBBSAttributeManageService") - private EgovBBSAttributeManageService bbsAttrbService; + private final EgovBBSAttributeManageService egovBBSAttributeManageService; @Resource(name = "EgovFileMngService") private EgovFileMngService fileMngService; @@ -122,7 +123,6 @@ protected String unscript(String data) { */ @GetMapping("/cop/bbs/selectBoardList.do") public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, ModelMap model, HttpServletRequest request) throws Exception { - System.out.println(boardVO.getBbsId()); // 메인화면에서 넘어온 경우 메뉴 갱신을 위해 추가 request.getSession().setAttribute("menuNo", "3000000"); @@ -142,7 +142,7 @@ public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, M vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - BoardMasterVO master = bbsAttrbService.selectBBSMasterInf(vo); + BoardMasterVO master = egovBBSAttributeManageService.selectBBSMasterInf(vo); // ------------------------------- // 방명록이면 방명록 URL로 forward @@ -165,7 +165,7 @@ public String selectBoardArticles(@ModelAttribute("searchVO") BoardVO boardVO, M boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); + Map map = egovBBSManageService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -210,7 +210,7 @@ public String selectBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Mo } boardVO.setLastUpdusrId(user.getUniqId()); - BoardVO vo = bbsMngService.selectBoardArticle(boardVO); + BoardVO vo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", vo); @@ -223,7 +223,7 @@ public String selectBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Mo master.setBbsId(boardVO.getBbsId()); master.setUniqId(user.getUniqId()); - BoardMasterVO masterVo = bbsAttrbService.selectBBSMasterInf(master); + BoardMasterVO masterVo = egovBBSAttributeManageService.selectBBSMasterInf(master); if (masterVo.getTmplatCours() == null || masterVo.getTmplatCours().equals("")) { masterVo.setTmplatCours("/css/egovframework/cop/bbs/egovBaseTemplate.css"); @@ -258,7 +258,7 @@ public String addBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, Model BoardMasterVO vo = new BoardMasterVO(); vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - bdMstr = bbsAttrbService.selectBBSMasterInf(vo); + bdMstr = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", bdMstr); } @@ -302,7 +302,7 @@ public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); @@ -337,7 +337,7 @@ public String insertBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -372,7 +372,7 @@ public String addReplyBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); model.addAttribute("result", boardVO); @@ -416,7 +416,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, vo.setBbsId(boardVO.getBbsId()); vo.setUniqId(user.getUniqId()); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); model.addAttribute("result", boardVO); @@ -456,7 +456,7 @@ public String replyBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -495,8 +495,8 @@ public String selectBoardArticleForUpdt(@ModelAttribute("searchVO") BoardVO boar master.setUniqId(user.getUniqId()); if (isAuthenticated) { - bmvo = bbsAttrbService.selectBBSMasterInf(master); - bdvo = bbsMngService.selectBoardArticle(boardVO); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); } model.addAttribute("result", bdvo); @@ -547,8 +547,8 @@ public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, master.setBbsId(boardVO.getBbsId()); master.setUniqId(user.getUniqId()); - bmvo = bbsAttrbService.selectBBSMasterInf(master); - bdvo = bbsMngService.selectBoardArticle(boardVO); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", bdvo); model.addAttribute("bdMstr", bmvo); @@ -579,7 +579,7 @@ public String updateBoardArticle(final MultipartHttpServletRequest multiRequest, board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.updateBoardArticle(board); + egovBBSManageService.updateBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -610,7 +610,7 @@ public String deleteBoardArticle(@ModelAttribute("searchVO") BoardVO boardVO, @M if (isAuthenticated) { board.setLastUpdusrId(user.getUniqId()); - bbsMngService.deleteBoardArticle(board); + egovBBSManageService.deleteBoardArticle(board); } model.addAttribute("bbsId", boardVO.getBbsId()); @@ -652,7 +652,7 @@ public String selectGuestList(@ModelAttribute("searchVO") BoardVO boardVO, Model masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId(user.getUniqId()); - BoardMasterVO mstrVO = bbsAttrbService.selectBBSMasterInf(masterVo); + BoardMasterVO mstrVO = egovBBSAttributeManageService.selectBBSMasterInf(masterVo); vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); @@ -666,7 +666,7 @@ public String selectGuestList(@ModelAttribute("searchVO") BoardVO boardVO, Model vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectGuestList(vo); + Map map = egovBBSManageService.selectGuestList(vo); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -697,7 +697,7 @@ public String selectSingleGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @SuppressWarnings("unused") Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); - BoardVO vo = bbsMngService.selectBoardArticle(boardVO); + BoardVO vo = egovBBSManageService.selectBoardArticle(boardVO); boardVO.setBbsId(boardVO.getBbsId()); boardVO.setBbsNm(boardVO.getBbsNm()); @@ -715,7 +715,7 @@ public String selectSingleGuestList(@ModelAttribute("searchVO") BoardVO boardVO, boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectGuestList(boardVO); + Map map = egovBBSManageService.selectGuestList(boardVO); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -745,7 +745,7 @@ public String deleteGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); if (isAuthenticated) { - bbsMngService.deleteGuestList(boardVO); + egovBBSManageService.deleteGuestList(boardVO); } return "forward:/cop/bbs/selectGuestList.do"; @@ -783,7 +783,7 @@ public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId(user.getUniqId()); - BoardMasterVO mstrVO = bbsAttrbService.selectBBSMasterInf(masterVo); + BoardMasterVO mstrVO = egovBBSAttributeManageService.selectBBSMasterInf(masterVo); vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); @@ -797,7 +797,7 @@ public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectGuestList(vo); + Map map = egovBBSManageService.selectGuestList(vo); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -812,7 +812,7 @@ public String updateGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode } if (isAuthenticated) { - bbsMngService.updateBoardArticle(board); + egovBBSManageService.updateBoardArticle(board); boardVO.setNttCn(""); boardVO.setPassword(""); boardVO.setNtcrId(""); @@ -857,7 +857,7 @@ public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode masterVo.setBbsId(vo.getBbsId()); masterVo.setUniqId(user.getUniqId()); - BoardMasterVO mstrVO = bbsAttrbService.selectBBSMasterInf(masterVo); + BoardMasterVO mstrVO = egovBBSAttributeManageService.selectBBSMasterInf(masterVo); vo.setPageUnit(propertyService.getInt("pageUnit")); vo.setPageSize(propertyService.getInt("pageSize")); @@ -871,7 +871,7 @@ public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode vo.setLastIndex(paginationInfo.getLastRecordIndex()); vo.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectGuestList(vo); + Map map = egovBBSManageService.selectGuestList(vo); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -889,7 +889,7 @@ public String insertGuestList(@ModelAttribute("searchVO") BoardVO boardVO, @Mode if (isAuthenticated) { board.setFrstRegisterId(user.getUniqId()); - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); boardVO.setNttCn(""); boardVO.setPassword(""); @@ -920,7 +920,7 @@ public String selectAnonymousBoardArticles(@ModelAttribute("searchVO") BoardVO b vo.setBbsId(boardVO.getBbsId()); vo.setUniqId("ANONYMOUS"); // 익명 - BoardMasterVO master = bbsAttrbService.selectBBSMasterInf(vo); + BoardMasterVO master = egovBBSAttributeManageService.selectBBSMasterInf(vo); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -943,7 +943,7 @@ public String selectAnonymousBoardArticles(@ModelAttribute("searchVO") BoardVO b boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); + Map map = egovBBSManageService.selectBoardArticles(boardVO, vo.getBbsAttrbCode()); int totCnt = Integer.parseInt((String) map.get("resultCnt")); paginationInfo.setTotalRecordCount(totCnt); @@ -988,7 +988,7 @@ public String addAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO board vo.setBbsId(boardVO.getBbsId()); vo.setUniqId("ANONYMOUS"); - bdMstr = bbsAttrbService.selectBBSMasterInf(vo); + bdMstr = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", bdMstr); } @@ -1041,7 +1041,7 @@ public String insertAnonymousBoardArticle(final MultipartHttpServletRequest mult vo.setBbsId(boardVO.getBbsId()); vo.setUniqId("ANONYMOUS"); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); model.addAttribute("bdMstr", master); @@ -1087,7 +1087,7 @@ public String insertAnonymousBoardArticle(final MultipartHttpServletRequest mult board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } return "forward:/cop/bbs/anonymous/selectBoardList.do"; @@ -1113,7 +1113,7 @@ public String selectAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo } boardVO.setLastUpdusrId("ANONYMOUS"); - BoardVO vo = bbsMngService.selectBoardArticle(boardVO); + BoardVO vo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", vo); model.addAttribute("sessionUniqId", "ANONYMOUS"); @@ -1126,7 +1126,7 @@ public String selectAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo master.setBbsId(boardVO.getBbsId()); master.setUniqId("ANONYMOUS"); - BoardMasterVO masterVo = bbsAttrbService.selectBBSMasterInf(master); + BoardMasterVO masterVo = egovBBSAttributeManageService.selectBBSMasterInf(master); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1172,7 +1172,7 @@ public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo master.setBbsId(boardVO.getBbsId()); master.setUniqId("ANONYMOUS"); - BoardMasterVO masterVo = bbsAttrbService.selectBBSMasterInf(master); + BoardMasterVO masterVo = egovBBSAttributeManageService.selectBBSMasterInf(master); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1185,7 +1185,7 @@ public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo // ------------------------------- // 패스워드 비교 // ------------------------------- - String dbpassword = bbsMngService.getPasswordInf(board); + String dbpassword = egovBBSManageService.getPasswordInf(board); String enpassword = EgovFileScrty.encryptPassword(board.getPassword(), board.getBbsId()); if (!dbpassword.equals(enpassword)) { @@ -1199,7 +1199,7 @@ public String deleteAnonymousBoardArticle(@ModelAttribute("searchVO") BoardVO bo if (isAuthenticated) { board.setLastUpdusrId("ANONYMOUS"); - bbsMngService.deleteBoardArticle(board); + egovBBSManageService.deleteBoardArticle(board); } return "forward:/cop/bbs/anonymous/selectBoardList.do"; @@ -1233,7 +1233,7 @@ public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") Boa master.setUniqId("ANONYMOUS"); if (isAuthenticated) { - bmvo = bbsAttrbService.selectBBSMasterInf(master); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1246,7 +1246,7 @@ public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") Boa // ------------------------------- // 패스워드 비교 // ------------------------------- - String dbpassword = bbsMngService.getPasswordInf(boardVO); + String dbpassword = egovBBSManageService.getPasswordInf(boardVO); String enpassword = EgovFileScrty.encryptPassword(boardVO.getPassword(), boardVO.getBbsId()); if (!dbpassword.equals(enpassword)) { @@ -1257,7 +1257,7 @@ public String selectAnonymousBoardArticleForUpdt(@ModelAttribute("searchVO") Boa } //// ----------------------------- - bdvo = bbsMngService.selectBoardArticle(boardVO); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); } model.addAttribute("result", bdvo); @@ -1309,7 +1309,7 @@ public String updateAnonymousBoardArticle(final MultipartHttpServletRequest mult master.setBbsId(boardVO.getBbsId()); master.setUniqId("ANONYMOUS"); - bmvo = bbsAttrbService.selectBBSMasterInf(master); + bmvo = egovBBSAttributeManageService.selectBBSMasterInf(master); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1319,7 +1319,7 @@ public String updateAnonymousBoardArticle(final MultipartHttpServletRequest mult } //// ----------------------------- - bdvo = bbsMngService.selectBoardArticle(boardVO); + bdvo = egovBBSManageService.selectBoardArticle(boardVO); model.addAttribute("result", bdvo); model.addAttribute("bdMstr", bmvo); @@ -1353,7 +1353,7 @@ public String updateAnonymousBoardArticle(final MultipartHttpServletRequest mult board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.updateBoardArticle(board); + egovBBSManageService.updateBoardArticle(board); } return "forward:/cop/bbs/anonymous/selectBoardList.do"; @@ -1377,7 +1377,7 @@ public String addAnonymousReplyBoardArticle(@ModelAttribute("searchVO") BoardVO vo.setBbsId(boardVO.getBbsId()); vo.setUniqId("ANONYMOUS"); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1430,7 +1430,7 @@ public String replyAnonymousBoardArticle(final MultipartHttpServletRequest multi vo.setBbsId(boardVO.getBbsId()); vo.setUniqId("ANONYMOUS"); - master = bbsAttrbService.selectBBSMasterInf(vo); + master = egovBBSAttributeManageService.selectBBSMasterInf(vo); // ------------------------------- // 익명게시판이 아니면.. 원래 게시판 URL로 forward @@ -1481,7 +1481,7 @@ public String replyAnonymousBoardArticle(final MultipartHttpServletRequest multi board.setNttCn(unscript(board.getNttCn())); // XSS 방지 - bbsMngService.insertBoardArticle(board); + egovBBSManageService.insertBoardArticle(board); } return "forward:/cop/bbs/anonymous/selectBoardList.do"; diff --git a/src/main/java/egovframework/let/main/web/EgovMainController.java b/src/main/java/egovframework/let/main/web/EgovMainController.java index f732aa1..12a93ef 100644 --- a/src/main/java/egovframework/let/main/web/EgovMainController.java +++ b/src/main/java/egovframework/let/main/web/EgovMainController.java @@ -23,6 +23,7 @@ import egovframework.let.uss.olh.faq.service.EgovFaqManageService; import egovframework.let.uss.olh.faq.service.FaqManageDefaultVO; import egovframework.let.uss.olp.qri.service.EgovQustnrRespondInfoService; +import lombok.RequiredArgsConstructor; /** * 템플릿 메인 페이지 컨트롤러 클래스(Sample 소스) @@ -39,18 +40,19 @@ * ---------- -------- --------------------------- * 2011.08.31 JJY 최초 생성 * 2021.08.12 신용호 추가 URL 생성 + * 2024.10.08 안단희 롬복 생성자 기반 종속성 주입 * * */ @Controller @SessionAttributes(types = ComDefaultVO.class) +@RequiredArgsConstructor public class EgovMainController { /** * EgovBBSManageService */ - @Resource(name = "EgovBBSManageService") - private EgovBBSManageService bbsMngService; + private final EgovBBSManageService egovBBSManageService; /** EgovMenuManageService */ @Resource(name = "meunManageService") @@ -105,7 +107,7 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) throws boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - Map map = bbsMngService.selectBoardArticles(boardVO, "BBSA02"); + Map map = egovBBSManageService.selectBoardArticles(boardVO, "BBSA02"); model.addAttribute("notiList", map.get("resultList")); // 공지사항 메인컨텐츠 조회 끝 ----------------------------------- @@ -123,7 +125,7 @@ public String getMgtMainPage(HttpServletRequest request, ModelMap model) throws boardVO.setLastIndex(paginationInfo.getLastRecordIndex()); boardVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); - model.addAttribute("bbsList", bbsMngService.selectBoardArticles(boardVO, "BBSA02").get("resultList")); + model.addAttribute("bbsList", egovBBSManageService.selectBoardArticles(boardVO, "BBSA02").get("resultList")); // 자유게시판 메인컨텐츠 조회 끝 -----------------------------------