From 1b30afbec98766cb963caf01fb44da309f38afb4 Mon Sep 17 00:00:00 2001 From: Jurepi Date: Mon, 7 Oct 2024 11:07:08 +0900 Subject: [PATCH 1/3] Source > Format --- .../impl/EgovQnaManageServiceImpl.java | 129 +++++++------ .../olh/qna/service/impl/QnaManageDAO.java | 32 ++-- .../qna/web/EgovQnaAdminManageController.java | 180 ++++++++++-------- .../olh/qna/web/EgovQnaManageController.java | 180 ++++++++++-------- 4 files changed, 295 insertions(+), 226 deletions(-) diff --git a/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java b/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java index c91c410..be8b7ec 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java +++ b/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java @@ -2,185 +2,194 @@ import java.util.List; -import egovframework.let.uss.olh.qna.service.EgovQnaManageService; -import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; -import egovframework.let.uss.olh.qna.service.QnaManageVO; +import javax.annotation.Resource; import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; - -import javax.annotation.Resource; - import org.springframework.stereotype.Service; +import egovframework.let.uss.olh.qna.service.EgovQnaManageService; +import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; +import egovframework.let.uss.olh.qna.service.QnaManageVO; + /** * * Q&A정보를 처리하는 비즈니스 구현 클래스 + * * @author 공통서비스 개발팀 박정규 * @since 2009.04.01 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *   수정일      수정자           수정내용
  *  -------    --------    ---------------------------
- *   2009.04.01  박정규          최초 생성
- *   2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *  2009.04.01  박정규           최초 생성
+ *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
  *
- * 
+ *
*/ @Service("QnaManageService") -public class EgovQnaManageServiceImpl extends EgovAbstractServiceImpl implements - EgovQnaManageService { +public class EgovQnaManageServiceImpl extends EgovAbstractServiceImpl implements EgovQnaManageService { - @Resource(name="QnaManageDAO") - private QnaManageDAO qnaManageDAO; + @Resource(name = "QnaManageDAO") + private QnaManageDAO qnaManageDAO; - /** ID Generation */ - @Resource(name="egovQnaManageIdGnrService") + /** ID Generation */ + @Resource(name = "egovQnaManageIdGnrService") private EgovIdGnrService idgenService; - - /** + /** * Q&A 글을 조회한다. + * * @param vo * @return 조회한 글 * @exception Exception */ - @Override + @Override public QnaManageVO selectQnaListDetail(QnaManageVO vo) throws Exception { - QnaManageVO resultVO = qnaManageDAO.selectQnaListDetail(vo); - if (resultVO == null) - throw processException("info.nodata.msg"); - return resultVO; - } + QnaManageVO resultVO = qnaManageDAO.selectQnaListDetail(vo); + if (resultVO == null) + throw processException("info.nodata.msg"); + return resultVO; + } /** * Q&A 글을 수정한다.(조회수를 수정) + * * @param vo * @exception Exception */ - @Override + @Override public void updateQnaInqireCo(QnaManageVO vo) throws Exception { - qnaManageDAO.updateQnaInqireCo(vo); - } + qnaManageDAO.updateQnaInqireCo(vo); + } - /** + /** * Q&A 글 목록을 조회한다. + * * @param searchVO * @return 글 목록 * @exception Exception */ @Override public List selectQnaList(QnaManageDefaultVO searchVO) throws Exception { - return qnaManageDAO.selectQnaList(searchVO); - } + return qnaManageDAO.selectQnaList(searchVO); + } - /** + /** * Q&A 글 총 갯수를 조회한다. + * * @param searchVO * @return 글 총 갯수 */ - @Override + @Override public int selectQnaListTotCnt(QnaManageDefaultVO searchVO) { return qnaManageDAO.selectQnaListTotCnt(searchVO); } /** * Q&A 글을 등록한다. + * * @param vo * @exception Exception */ - @Override + @Override public void insertQnaCn(QnaManageVO vo) throws Exception { - String qaId = idgenService.getNextStringId(); + String qaId = idgenService.getNextStringId(); vo.setQaId(qaId); - qnaManageDAO.insertQnaCn(vo); - } + qnaManageDAO.insertQnaCn(vo); + } - /** + /** * 작성비밀번호를 확인한다. + * * @param vo * @return 글 총 갯수 */ - @Override + @Override public int selectQnaPasswordConfirmCnt(QnaManageVO vo) { return qnaManageDAO.selectQnaPasswordConfirmCnt(vo); } /** * Q&A 글을 수정한다. + * * @param vo * @exception Exception */ - @Override + @Override public void updateQnaCn(QnaManageVO vo) throws Exception { - qnaManageDAO.updateQnaCn(vo); - } + qnaManageDAO.updateQnaCn(vo); + } /** * Q&A 글을 삭제한다. + * * @param vo * @exception Exception */ - @Override + @Override public void deleteQnaCn(QnaManageVO vo) throws Exception { - qnaManageDAO.deleteQnaCn(vo); - } - + qnaManageDAO.deleteQnaCn(vo); + } - /** + /** * Q&A 답변 글을 조회한다. + * * @param vo * @return 조회한 글 * @exception Exception */ - @Override + @Override public QnaManageVO selectQnaAnswerListDetail(QnaManageVO vo) throws Exception { - QnaManageVO resultVO = qnaManageDAO.selectQnaAnswerListDetail(vo); - if (resultVO == null) - throw processException("info.nodata.msg"); - return resultVO; - } + QnaManageVO resultVO = qnaManageDAO.selectQnaAnswerListDetail(vo); + if (resultVO == null) + throw processException("info.nodata.msg"); + return resultVO; + } - /** + /** * Q&A 답변 글 목록을 조회한다. + * * @param searchVO * @return 글 목록 * @exception Exception */ @Override public List selectQnaAnswerList(QnaManageDefaultVO searchVO) throws Exception { - return qnaManageDAO.selectQnaAnswerList(searchVO); - } + return qnaManageDAO.selectQnaAnswerList(searchVO); + } - /** + /** * Q&A 답변 글 총 갯수를 조회한다. + * * @param searchVO * @return 글 총 갯수 */ - @Override + @Override public int selectQnaAnswerListTotCnt(QnaManageDefaultVO searchVO) { return qnaManageDAO.selectQnaListTotCnt(searchVO); } /** * Q&A 답변 글을 수정한다. + * * @param vo * @exception Exception */ - @Override + @Override public void updateQnaCnAnswer(QnaManageVO vo) throws Exception { - qnaManageDAO.updateQnaCnAnswer(vo); - } + qnaManageDAO.updateQnaCnAnswer(vo); + } } diff --git a/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java b/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java index c361f19..d17fef6 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java +++ b/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java @@ -11,7 +11,7 @@ /** * * Q&A정보를 처리하는 DAO 클래스 - * + * * @author 공통서비스 개발팀 박정규 * @since 2009.04.01 * @version 1.0 @@ -22,9 +22,9 @@ * * 수정일 수정자 수정내용 * ------- -------- --------------------------- - * 2009.04.01 박정규 최초 생성 - * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2009.04.01 박정규 최초 생성 + * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 + * 2024.08.10 이백행 이클립스 문제(Problems) 제거 * * */ @@ -33,7 +33,7 @@ public class QnaManageDAO extends EgovAbstractMapper { /** * Q&A 글 목록에 대한 상세내용을 조회한다. - * + * * @param vo * @return 조회한 글 * @exception Exception @@ -46,7 +46,7 @@ public QnaManageVO selectQnaListDetail(QnaManageVO vo) throws Exception { /** * Q&A 글을 수정한다.(조회수를 수정) - * + * * @param vo * @exception Exception */ @@ -58,7 +58,7 @@ public void updateQnaInqireCo(QnaManageVO vo) throws Exception { /** * Q&A 글 목록을 조회한다. - * + * * @param searchVO * @return 글 목록 * @exception Exception @@ -71,7 +71,7 @@ public List selectQnaList(QnaManageDefaultVO searchVO) throws Exception { /** * Q&A 글 총 갯수를 조회한다. - * + * * @param searchVO * @return 글 총 갯수 */ @@ -83,7 +83,7 @@ public int selectQnaListTotCnt(QnaManageDefaultVO searchVO) { /** * Q&A 글을 등록한다. - * + * * @param vo * @exception Exception */ @@ -95,7 +95,7 @@ public void insertQnaCn(QnaManageVO vo) throws Exception { /** * 작성비밀번호를 확인한다. - * + * * @param vo * @return 글 총 갯수 */ @@ -107,7 +107,7 @@ public int selectQnaPasswordConfirmCnt(QnaManageVO vo) { /** * Q&A 글을 수정한다. - * + * * @param vo * @exception Exception */ @@ -119,7 +119,7 @@ public void updateQnaCn(QnaManageVO vo) throws Exception { /** * Q&A 글을 삭제한다. - * + * * @param vo * @exception Exception */ @@ -131,7 +131,7 @@ public void deleteQnaCn(QnaManageVO vo) throws Exception { /** * Q&A 답변 글 목록에 대한 상세내용을 조회한다. - * + * * @param vo * @return 조회한 글 * @exception Exception @@ -144,7 +144,7 @@ public QnaManageVO selectQnaAnswerListDetail(QnaManageVO vo) throws Exception { /** * Q&A 답변 글 목록을 조회한다. - * + * * @param searchVO * @return 글 목록 * @exception Exception @@ -157,7 +157,7 @@ public List selectQnaAnswerList(QnaManageDefaultVO searchVO) throws Exception /** * Q&A 답변 글 총 갯수를 조회한다. - * + * * @param searchVO * @return 글 총 갯수 */ @@ -169,7 +169,7 @@ public int selectQnaAnswerListTotCnt(QnaManageDefaultVO searchVO) { /** * Q&A 답변 글을 수정한다. - * + * * @param vo * @exception Exception */ diff --git a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java index dc07a64..e470026 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java +++ b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java @@ -1,47 +1,47 @@ package egovframework.let.uss.olh.qna.web; -import egovframework.com.cmm.ComDefaultCodeVO; -import egovframework.com.cmm.EgovMessageSource; -import egovframework.com.cmm.LoginVO; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.let.uss.olh.qna.service.EgovQnaManageService; -import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; -import egovframework.let.uss.olh.qna.service.QnaManageVO; -import egovframework.let.utl.sim.service.EgovFileScrty; +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.Model; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springmodules.validation.commons.DefaultBeanValidator; +import egovframework.com.cmm.ComDefaultCodeVO; +import egovframework.com.cmm.EgovMessageSource; +import egovframework.com.cmm.LoginVO; +import egovframework.com.cmm.service.EgovCmmUseService; +import egovframework.let.uss.olh.qna.service.EgovQnaManageService; +import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; +import egovframework.let.uss.olh.qna.service.QnaManageVO; +import egovframework.let.utl.sim.service.EgovFileScrty; + /** * * Q&A를 처리하는 Controller 클래스 + * * @author 공통서비스 개발팀 박정규 * @since 2009.04.01 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *   수정일      수정자           수정내용
  *  -------    --------    ---------------------------
- *   2009.04.01  박정규          최초 생성
- *   2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *  2009.04.01  박정규           최초 생성
+ *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
  *
- * 
+ *
*/ @Controller public class EgovQnaAdminManageController { @@ -66,8 +66,9 @@ public class EgovQnaAdminManageController { /** * 개별 배포시 메인메뉴를 조회한다. + * * @param model - * @return "/uss/olh/qna/admin/" + * @return "/uss/olh/qna/admin/" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/admin/EgovMain.do") @@ -77,8 +78,9 @@ public String EgovMain(ModelMap model) throws Exception { /** * 메뉴를 조회한다. + * * @param model - * @return "/uss/olh/qna/admin/EgovLeft" + * @return "/uss/olh/qna/admin/EgovLeft" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/admin/EgovLeft.do") @@ -88,13 +90,15 @@ public String EgovLeft(ModelMap model) throws Exception { /** * Q&A정보 목록을 조회한다. (pageing) + * * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaListInqire" + * @return "/uss/olh/qna/admin/EgovQnaListInqire" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/admin/QnaListInqire.do") - public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { /** EgovPropertyService.SiteList */ searchVO.setPageUnit(propertiesService.getInt("pageUnit")); @@ -111,7 +115,7 @@ public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searc searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); model.addAttribute("resultList", qnaManageService.selectQnaList(searchVO)); - + // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -134,16 +138,18 @@ public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searc /** * Q&A정보 목록에 대한 상세정보를 조회한다. + * * @param passwordConfirmAt * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaDetailInqire" + * @return "/uss/olh/qna/admin/EgovQnaDetailInqire" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaDetailInqire.do") - public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String passwordConfirmAt, QnaManageVO qnaManageVO, - @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String passwordConfirmAt, + QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -161,14 +167,16 @@ public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String pass } /** - * Q&A 조회수를 수정처리한다. + * Q&A 조회수를 수정처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/admin/QnaDetailInqire.do" + * @return "forward:/uss/olh/qna/admin/QnaDetailInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaInqireCoUpdt.do") - public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) throws Exception { + public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) + throws Exception { qnaManageService.updateQnaInqireCo(qnaManageVO); @@ -178,14 +186,16 @@ public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("search /** * 로그인/실명확인 처리 + * * @param qnaManageVO * @param searchVO * @param model - * @return /uss/olh/qna/admin/EgovLoginRealnmChoice + * @return /uss/olh/qna/admin/EgovLoginRealnmChoice * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/LoginRealnmChoice.do") - public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { + public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { model.addAttribute("QnaManageVO", new QnaManageVO()); @@ -194,14 +204,16 @@ public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, @ModelAttribute(" /** * Q&A정보를 등록하기 위한 전 처리(인증체크) + * * @param searchVO * @param qnaManageVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaCnRegist" + * @return "/uss/olh/qna/admin/EgovQnaCnRegist" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaCnRegistView.do") - public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, QnaManageVO qnaManageVO, Model model) throws Exception { + public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, QnaManageVO qnaManageVO, + Model model) throws Exception { // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -212,7 +224,7 @@ public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO sea return "uat/uia/EgovLoginUsr"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String wrterNm = loginVO.getName(); // 사용자명 @@ -230,15 +242,17 @@ public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO sea /** * Q&A정보를 등록한다. + * * @param searchVO * @param qnaManageVO * @param bindingResult - * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" + * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaCnRegist.do") - public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult, - ModelMap model) throws Exception { + public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult, ModelMap model) + throws Exception { beanValidator.validate(qnaManageVO, bindingResult); @@ -246,7 +260,7 @@ public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV return "/uss/olh/qna/admin/EgovQnaCnRegist"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String frstRegisterId = loginVO.getUniqId(); @@ -267,30 +281,33 @@ public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV /** * 작성 비밀번호를 확인하기 위한 전 처리 + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaPasswordConfirm" + * @return "/uss/olh/qna/admin/EgovQnaPasswordConfirm" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaPasswordConfirmView.do") - public String selectPasswordConfirmView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { + public String selectPasswordConfirmView(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - model.addAttribute("QnaManageVO", new QnaManageVO()); + model.addAttribute("QnaManageVO", new QnaManageVO()); - return "/uss/olh/qna/admin/EgovQnaPasswordConfirm"; + return "/uss/olh/qna/admin/EgovQnaPasswordConfirm"; } /** * 작성 비밀번호를 확인한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/admin/QnaDetailInqire.do" + * @return "forward:/uss/olh/qna/admin/QnaDetailInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaPasswordConfirm.do") - public String selectPasswordConfirm(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - + public String selectPasswordConfirm(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -299,41 +316,43 @@ public String selectPasswordConfirm(QnaManageVO qnaManageVO, @ModelAttribute("se model.addAttribute("result", qnaManageVO); model.addAttribute("message", egovMessageSource.getMessage("fail.common.login")); return "uat/uia/EgovLoginUsr"; - }else { - // 작성비밀번호를 암호화 하기 위해서 Get - String writngPassword = qnaManageVO.getWritngPassword(); + } else { + // 작성비밀번호를 암호화 하기 위해서 Get + String writngPassword = qnaManageVO.getWritngPassword(); - // EgovFileScrty Util에 있는 암호화 모듈을 적용해서 암호화 한다. - qnaManageVO.setWritngPassword(EgovFileScrty.encode(writngPassword)); + // EgovFileScrty Util에 있는 암호화 모듈을 적용해서 암호화 한다. + qnaManageVO.setWritngPassword(EgovFileScrty.encode(writngPassword)); - int searchCnt = qnaManageService.selectQnaPasswordConfirmCnt(qnaManageVO); + int searchCnt = qnaManageService.selectQnaPasswordConfirmCnt(qnaManageVO); - if (searchCnt > 0) { // 작성 비밀번호가 일치하는 경우 + if (searchCnt > 0) { // 작성 비밀번호가 일치하는 경우 - // Q&A를 수정할 수 있는 화면으로 이동. - return "forward:/uss/olh/qna/admin/QnaCnUpdtView.do"; + // Q&A를 수정할 수 있는 화면으로 이동. + return "forward:/uss/olh/qna/admin/QnaCnUpdtView.do"; - } else { // 작성비밀번호가 틀린경우 + } else { // 작성비밀번호가 틀린경우 - String passwordConfirmAt = "N"; + String passwordConfirmAt = "N"; - // Q&A 상세조회 화면으로 이동. - return "forward:/uss/olh/qna/admin/QnaDetailInqire.do?passwordConfirmAt=" + passwordConfirmAt; + // Q&A 상세조회 화면으로 이동. + return "forward:/uss/olh/qna/admin/QnaDetailInqire.do?passwordConfirmAt=" + passwordConfirmAt; - } + } } } /** * Q&A정보를 수정하기 위한 전 처리(비밀번호 암호화) + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaCnUpdt + * @return "/uss/olh/qna/admin/EgovQnaCnUpdt * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaCnUpdtView.do") - public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + ModelMap model) throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -354,15 +373,16 @@ public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO /** * Q&A정보를 수정처리한다. + * * @param searchVO * @param qnaManageVO * @param bindingResult - * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" + * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaCnUpdt.do") - public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult) - throws Exception { + public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult) throws Exception { // Validation beanValidator.validate(qnaManageVO, bindingResult); @@ -371,7 +391,7 @@ public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV return "/uss/olh/qna/admin/EgovQnaCnUpdt"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String lastUpdusrId = loginVO.getUniqId(); @@ -392,14 +412,16 @@ public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV /** * Q&A정보를 삭제처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" + * @return "forward:/uss/olh/qna/admin/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/admin/QnaCnDelete.do") - public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - + public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + Model model) throws Exception { + // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -415,13 +437,15 @@ public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") Q /** * Q&A답변정보 목록을 조회한다. (pageing) + * * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaAnswerListInqire" + * @return "/uss/olh/qna/admin/EgovQnaAnswerListInqire" * @throws Exception */ @RequestMapping(value = "/uss/olh/qnm/admin/QnaAnswerListInqire.do") - public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { /** EgovPropertyService.SiteList */ searchVO.setPageUnit(propertiesService.getInt("pageUnit")); @@ -448,14 +472,16 @@ public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO /** * Q&A답변정보 목록에 대한 상세정보를 조회한다. + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaAnswerDetailInqire" + * @return "/uss/olh/qna/admin/EgovQnaAnswerDetailInqire" * @throws Exception */ @RequestMapping("/uss/olh/qnm/admin/QnaAnswerDetailInqire.do") - public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -466,14 +492,16 @@ public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, @ModelAttribute /** * Q&A답변정보를 수정하기 위한 전 처리(공통코드 처리) + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/admin/EgovQnaCnAnswerUpdt" + * @return "/uss/olh/qna/admin/EgovQnaCnAnswerUpdt" * @throws Exception */ @RequestMapping("/uss/olh/qnm/admin/QnaCnAnswerUpdtView.do") - public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { // 공통코드를 가져오기 위한 Vo ComDefaultCodeVO vo = new ComDefaultCodeVO(); @@ -489,15 +517,17 @@ public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, @ModelAttribute("se /** * Q&A답변정보를 수정처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qnm/admin/QnaAnswerListInqire.do" + * @return "forward:/uss/olh/qnm/admin/QnaAnswerListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qnm/admin/QnaCnAnswerUpdt.do") - public String updateQnaCnAnswer(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) throws Exception { + public String updateQnaCnAnswer(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) + throws Exception { - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String lastUpdusrId = loginVO.getUniqId(); diff --git a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java index 0e7b587..16a1d9a 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java +++ b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java @@ -1,47 +1,47 @@ package egovframework.let.uss.olh.qna.web; -import egovframework.com.cmm.ComDefaultCodeVO; -import egovframework.com.cmm.EgovMessageSource; -import egovframework.com.cmm.LoginVO; -import egovframework.com.cmm.service.EgovCmmUseService; -import egovframework.let.uss.olh.qna.service.EgovQnaManageService; -import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; -import egovframework.let.uss.olh.qna.service.QnaManageVO; -import egovframework.let.utl.sim.service.EgovFileScrty; +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.Model; import org.springframework.ui.ModelMap; import org.springframework.validation.BindingResult; -import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ModelAttribute; +import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestParam; import org.springmodules.validation.commons.DefaultBeanValidator; +import egovframework.com.cmm.ComDefaultCodeVO; +import egovframework.com.cmm.EgovMessageSource; +import egovframework.com.cmm.LoginVO; +import egovframework.com.cmm.service.EgovCmmUseService; +import egovframework.let.uss.olh.qna.service.EgovQnaManageService; +import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; +import egovframework.let.uss.olh.qna.service.QnaManageVO; +import egovframework.let.utl.sim.service.EgovFileScrty; + /** * * Q&A를 처리하는 Controller 클래스 + * * @author 공통서비스 개발팀 박정규 * @since 2009.04.01 * @version 1.0 * @see * - *
+ *      
  * << 개정이력(Modification Information) >>
  *
  *   수정일      수정자           수정내용
  *  -------    --------    ---------------------------
- *   2009.04.01  박정규          최초 생성
- *   2011.08.31  JJY            경량환경 템플릿 커스터마이징버전 생성
+ *  2009.04.01  박정규           최초 생성
+ *  2011.08.31  JJY           경량환경 템플릿 커스터마이징버전 생성
  *
- * 
+ *
*/ @Controller public class EgovQnaManageController { @@ -66,8 +66,9 @@ public class EgovQnaManageController { /** * 개별 배포시 메인메뉴를 조회한다. + * * @param model - * @return "/uss/olh/qna/" + * @return "/uss/olh/qna/" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/EgovMain.do") @@ -77,8 +78,9 @@ public String EgovMain(ModelMap model) throws Exception { /** * 메뉴를 조회한다. + * * @param model - * @return "/uss/olh/qna/EgovLeft" + * @return "/uss/olh/qna/EgovLeft" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/EgovLeft.do") @@ -88,13 +90,15 @@ public String EgovLeft(ModelMap model) throws Exception { /** * Q&A정보 목록을 조회한다. (pageing) + * * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaListInqire" + * @return "/uss/olh/qna/EgovQnaListInqire" * @throws Exception */ @RequestMapping(value = "/uss/olh/qna/QnaListInqire.do") - public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { /** EgovPropertyService.SiteList */ searchVO.setPageUnit(propertiesService.getInt("pageUnit")); @@ -111,7 +115,7 @@ public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searc searchVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage()); model.addAttribute("resultList", qnaManageService.selectQnaList(searchVO)); - + // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -134,16 +138,18 @@ public String selectQnaList(@ModelAttribute("searchVO") QnaManageDefaultVO searc /** * Q&A정보 목록에 대한 상세정보를 조회한다. + * * @param passwordConfirmAt * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaDetailInqire" + * @return "/uss/olh/qna/EgovQnaDetailInqire" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaDetailInqire.do") - public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String passwordConfirmAt, QnaManageVO qnaManageVO, - @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String passwordConfirmAt, + QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -161,14 +167,16 @@ public String selectQnaListDetail(@RequestParam("passwordConfirmAt") String pass } /** - * Q&A 조회수를 수정처리한다. + * Q&A 조회수를 수정처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/QnaDetailInqire.do" + * @return "forward:/uss/olh/qna/QnaDetailInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaInqireCoUpdt.do") - public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) throws Exception { + public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) + throws Exception { qnaManageService.updateQnaInqireCo(qnaManageVO); @@ -178,14 +186,16 @@ public String updateQnaInqireCo(QnaManageVO qnaManageVO, @ModelAttribute("search /** * 로그인/실명확인 처리 + * * @param qnaManageVO * @param searchVO * @param model - * @return /uss/olh/qna/EgovLoginRealnmChoice + * @return /uss/olh/qna/EgovLoginRealnmChoice * @throws Exception */ @RequestMapping("/uss/olh/qna/LoginRealnmChoice.do") - public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { + public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { model.addAttribute("QnaManageVO", new QnaManageVO()); @@ -194,14 +204,16 @@ public String selectLoginRealnmChoice(QnaManageVO qnaManageVO, @ModelAttribute(" /** * Q&A정보를 등록하기 위한 전 처리(인증체크) + * * @param searchVO * @param qnaManageVO * @param model - * @return "/uss/olh/qna/EgovQnaCnRegist" + * @return "/uss/olh/qna/EgovQnaCnRegist" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaCnRegistView.do") - public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, QnaManageVO qnaManageVO, Model model) throws Exception { + public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, QnaManageVO qnaManageVO, + Model model) throws Exception { // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -212,7 +224,7 @@ public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO sea return "uat/uia/EgovLoginUsr"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String wrterNm = loginVO.getName(); // 사용자명 @@ -230,15 +242,17 @@ public String insertQnaCnView(@ModelAttribute("searchVO") QnaManageDefaultVO sea /** * Q&A정보를 등록한다. + * * @param searchVO * @param qnaManageVO * @param bindingResult - * @return "forward:/uss/olh/qna/QnaListInqire.do" + * @return "forward:/uss/olh/qna/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaCnRegist.do") - public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult, - ModelMap model) throws Exception { + public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult, ModelMap model) + throws Exception { beanValidator.validate(qnaManageVO, bindingResult); @@ -246,7 +260,7 @@ public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV return "/uss/olh/qna/EgovQnaCnRegist"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String frstRegisterId = loginVO.getUniqId(); @@ -267,30 +281,33 @@ public String insertQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV /** * 작성 비밀번호를 확인하기 위한 전 처리 + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaPasswordConfirm" + * @return "/uss/olh/qna/EgovQnaPasswordConfirm" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaPasswordConfirmView.do") - public String selectPasswordConfirmView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { + public String selectPasswordConfirmView(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - model.addAttribute("QnaManageVO", new QnaManageVO()); + model.addAttribute("QnaManageVO", new QnaManageVO()); - return "/uss/olh/qna/EgovQnaPasswordConfirm"; + return "/uss/olh/qna/EgovQnaPasswordConfirm"; } /** * 작성 비밀번호를 확인한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/QnaDetailInqire.do" + * @return "forward:/uss/olh/qna/QnaDetailInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaPasswordConfirm.do") - public String selectPasswordConfirm(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - + public String selectPasswordConfirm(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -299,41 +316,43 @@ public String selectPasswordConfirm(QnaManageVO qnaManageVO, @ModelAttribute("se model.addAttribute("result", qnaManageVO); model.addAttribute("message", egovMessageSource.getMessage("fail.common.login")); return "uat/uia/EgovLoginUsr"; - }else { - // 작성비밀번호를 암호화 하기 위해서 Get - String writngPassword = qnaManageVO.getWritngPassword(); + } else { + // 작성비밀번호를 암호화 하기 위해서 Get + String writngPassword = qnaManageVO.getWritngPassword(); - // EgovFileScrty Util에 있는 암호화 모듈을 적용해서 암호화 한다. - qnaManageVO.setWritngPassword(EgovFileScrty.encode(writngPassword)); + // EgovFileScrty Util에 있는 암호화 모듈을 적용해서 암호화 한다. + qnaManageVO.setWritngPassword(EgovFileScrty.encode(writngPassword)); - int searchCnt = qnaManageService.selectQnaPasswordConfirmCnt(qnaManageVO); + int searchCnt = qnaManageService.selectQnaPasswordConfirmCnt(qnaManageVO); - if (searchCnt > 0) { // 작성 비밀번호가 일치하는 경우 + if (searchCnt > 0) { // 작성 비밀번호가 일치하는 경우 - // Q&A를 수정할 수 있는 화면으로 이동. - return "forward:/uss/olh/qna/QnaCnUpdtView.do"; + // Q&A를 수정할 수 있는 화면으로 이동. + return "forward:/uss/olh/qna/QnaCnUpdtView.do"; - } else { // 작성비밀번호가 틀린경우 + } else { // 작성비밀번호가 틀린경우 - String passwordConfirmAt = "N"; + String passwordConfirmAt = "N"; - // Q&A 상세조회 화면으로 이동. - return "forward:/uss/olh/qna/QnaDetailInqire.do?passwordConfirmAt=" + passwordConfirmAt; + // Q&A 상세조회 화면으로 이동. + return "forward:/uss/olh/qna/QnaDetailInqire.do?passwordConfirmAt=" + passwordConfirmAt; - } + } } } /** * Q&A정보를 수정하기 위한 전 처리(비밀번호 암호화) + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaCnUpdt + * @return "/uss/olh/qna/EgovQnaCnUpdt * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaCnUpdtView.do") - public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + ModelMap model) throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -354,15 +373,16 @@ public String updateQnaCnView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO /** * Q&A정보를 수정처리한다. + * * @param searchVO * @param qnaManageVO * @param bindingResult - * @return "forward:/uss/olh/qna/QnaListInqire.do" + * @return "forward:/uss/olh/qna/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaCnUpdt.do") - public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult) - throws Exception { + public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + @ModelAttribute("qnaManageVO") QnaManageVO qnaManageVO, BindingResult bindingResult) throws Exception { // Validation beanValidator.validate(qnaManageVO, bindingResult); @@ -371,7 +391,7 @@ public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV return "/uss/olh/qna/EgovQnaCnUpdt"; } - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String lastUpdusrId = loginVO.getUniqId(); @@ -392,14 +412,16 @@ public String updateQnaCn(@ModelAttribute("searchVO") QnaManageDefaultVO searchV /** * Q&A정보를 삭제처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qna/QnaListInqire.do" + * @return "forward:/uss/olh/qna/QnaListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qna/QnaCnDelete.do") - public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, Model model) throws Exception { - + public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, + Model model) throws Exception { + // 인증여부 체크 Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); @@ -415,13 +437,15 @@ public String deleteQnaCn(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") Q /** * Q&A답변정보 목록을 조회한다. (pageing) + * * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaAnswerListInqire" + * @return "/uss/olh/qna/EgovQnaAnswerListInqire" * @throws Exception */ @RequestMapping(value = "/uss/olh/qnm/QnaAnswerListInqire.do") - public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) + throws Exception { /** EgovPropertyService.SiteList */ searchVO.setPageUnit(propertiesService.getInt("pageUnit")); @@ -448,14 +472,16 @@ public String selectQnaAnswerList(@ModelAttribute("searchVO") QnaManageDefaultVO /** * Q&A답변정보 목록에 대한 상세정보를 조회한다. + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaAnswerDetailInqire" + * @return "/uss/olh/qna/EgovQnaAnswerDetailInqire" * @throws Exception */ @RequestMapping("/uss/olh/qnm/QnaAnswerDetailInqire.do") - public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { QnaManageVO vo = qnaManageService.selectQnaListDetail(qnaManageVO); @@ -466,14 +492,16 @@ public String selectQnaAnswerListDetail(QnaManageVO qnaManageVO, @ModelAttribute /** * Q&A답변정보를 수정하기 위한 전 처리(공통코드 처리) + * * @param qnaManageVO * @param searchVO * @param model - * @return "/uss/olh/qna/EgovQnaCnAnswerUpdt" + * @return "/uss/olh/qna/EgovQnaCnAnswerUpdt" * @throws Exception */ @RequestMapping("/uss/olh/qnm/QnaCnAnswerUpdtView.do") - public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { + public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, + @ModelAttribute("searchVO") QnaManageDefaultVO searchVO, ModelMap model) throws Exception { // 공통코드를 가져오기 위한 Vo ComDefaultCodeVO vo = new ComDefaultCodeVO(); @@ -489,15 +517,17 @@ public String updateQnaCnAnswerView(QnaManageVO qnaManageVO, @ModelAttribute("se /** * Q&A답변정보를 수정처리한다. + * * @param qnaManageVO * @param searchVO - * @return "forward:/uss/olh/qnm/QnaAnswerListInqire.do" + * @return "forward:/uss/olh/qnm/QnaAnswerListInqire.do" * @throws Exception */ @RequestMapping("/uss/olh/qnm/QnaCnAnswerUpdt.do") - public String updateQnaCnAnswer(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) throws Exception { + public String updateQnaCnAnswer(QnaManageVO qnaManageVO, @ModelAttribute("searchVO") QnaManageDefaultVO searchVO) + throws Exception { - // 로그인VO에서 사용자 정보 가져오기 + // 로그인VO에서 사용자 정보 가져오기 LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); String lastUpdusrId = loginVO.getUniqId(); From c2b658d57c1528da0aa472cc19df4d29b0629568 Mon Sep 17 00:00:00 2001 From: Jurepi Date: Mon, 7 Oct 2024 11:17:29 +0900 Subject: [PATCH 2/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 --- .../service/impl/EgovQnaManageServiceImpl.java | 17 ++++++++--------- .../uss/olh/qna/service/impl/QnaManageDAO.java | 3 ++- .../qna/web/EgovQnaAdminManageController.java | 6 ++++-- .../olh/qna/web/EgovQnaManageController.java | 8 +++++--- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java b/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java index be8b7ec..940d1ec 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java +++ b/src/main/java/egovframework/let/uss/olh/qna/service/impl/EgovQnaManageServiceImpl.java @@ -2,8 +2,6 @@ import java.util.List; -import javax.annotation.Resource; - import org.egovframe.rte.fdl.cmmn.EgovAbstractServiceImpl; import org.egovframe.rte.fdl.idgnr.EgovIdGnrService; import org.springframework.stereotype.Service; @@ -11,6 +9,7 @@ import egovframework.let.uss.olh.qna.service.EgovQnaManageService; import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; import egovframework.let.uss.olh.qna.service.QnaManageVO; +import lombok.RequiredArgsConstructor; /** * @@ -28,18 +27,18 @@ * ------- -------- --------------------------- * 2009.04.01 박정규 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * + * 2024.10.07 안단희 롬복 생성자 기반 종속성 주입 + * * */ -@Service("QnaManageService") +@Service +@RequiredArgsConstructor public class EgovQnaManageServiceImpl extends EgovAbstractServiceImpl implements EgovQnaManageService { - @Resource(name = "QnaManageDAO") - private QnaManageDAO qnaManageDAO; + private final QnaManageDAO qnaManageDAO; /** ID Generation */ - @Resource(name = "egovQnaManageIdGnrService") - private EgovIdGnrService idgenService; + private final EgovIdGnrService egovQnaManageIdGnrService; /** * Q&A 글을 조회한다. @@ -100,7 +99,7 @@ public int selectQnaListTotCnt(QnaManageDefaultVO searchVO) { @Override public void insertQnaCn(QnaManageVO vo) throws Exception { - String qaId = idgenService.getNextStringId(); + String qaId = egovQnaManageIdGnrService.getNextStringId(); vo.setQaId(qaId); diff --git a/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java b/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java index d17fef6..cf80bd9 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java +++ b/src/main/java/egovframework/let/uss/olh/qna/service/impl/QnaManageDAO.java @@ -25,10 +25,11 @@ * 2009.04.01 박정규 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.08.10 이백행 이클립스 문제(Problems) 제거 + * 2024.10.07 안단희 불필요한 네이밍 제거 * * */ -@Repository("QnaManageDAO") +@Repository public class QnaManageDAO extends EgovAbstractMapper { /** diff --git a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java index e470026..86bfede 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java +++ b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java @@ -23,6 +23,7 @@ import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; import egovframework.let.uss.olh.qna.service.QnaManageVO; import egovframework.let.utl.sim.service.EgovFileScrty; +import lombok.RequiredArgsConstructor; /** * @@ -40,13 +41,14 @@ * ------- -------- --------------------------- * 2009.04.01 박정규 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * + * 2024.10.07 안단희 롬복 생성자 기반 종속성 주입 + * * */ @Controller +@RequiredArgsConstructor public class EgovQnaAdminManageController { - @Resource(name = "QnaManageService") private EgovQnaManageService qnaManageService; /** EgovPropertyService */ diff --git a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java index 16a1d9a..c415ac1 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java +++ b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaManageController.java @@ -23,6 +23,7 @@ import egovframework.let.uss.olh.qna.service.QnaManageDefaultVO; import egovframework.let.uss.olh.qna.service.QnaManageVO; import egovframework.let.utl.sim.service.EgovFileScrty; +import lombok.RequiredArgsConstructor; /** * @@ -40,14 +41,15 @@ * ------- -------- --------------------------- * 2009.04.01 박정규 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 - * + * 2024.10.07 안단희 롬복 생성자 기반 종속성 주입 + * * */ @Controller +@RequiredArgsConstructor public class EgovQnaManageController { - @Resource(name = "QnaManageService") - private EgovQnaManageService qnaManageService; + private final EgovQnaManageService qnaManageService; /** EgovPropertyService */ @Resource(name = "propertiesService") From fd6d58c2730a4986c0a02f107253d5c4c7b8bffd Mon Sep 17 00:00:00 2001 From: Jurepi Date: Mon, 7 Oct 2024 11:35:52 +0900 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20final=20=ED=82=A4=EC=9B=8C=EB=93=9C?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../let/uss/olh/qna/web/EgovQnaAdminManageController.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java index 86bfede..9686b70 100644 --- a/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java +++ b/src/main/java/egovframework/let/uss/olh/qna/web/EgovQnaAdminManageController.java @@ -42,14 +42,14 @@ * 2009.04.01 박정규 최초 생성 * 2011.08.31 JJY 경량환경 템플릿 커스터마이징버전 생성 * 2024.10.07 안단희 롬복 생성자 기반 종속성 주입 - * + * * */ @Controller @RequiredArgsConstructor public class EgovQnaAdminManageController { - private EgovQnaManageService qnaManageService; + private final EgovQnaManageService qnaManageService; /** EgovPropertyService */ @Resource(name = "propertiesService")