diff --git a/src/main/java/nlib/bbs/web/AncmntController.java b/src/main/java/nlib/bbs/web/AncmntController.java new file mode 100644 index 00000000..479cdb35 --- /dev/null +++ b/src/main/java/nlib/bbs/web/AncmntController.java @@ -0,0 +1,836 @@ + +package nlib.bbs.web; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import org.springframework.web.servlet.support.RequestContextUtils; + +import nlib.bbs.service.BoardService; +import nlib.cmm.NlibCommonController; +import nlib.cmm.crypto.AriaCrypto; +import nlib.cmm.crypto.NlibPasswordEncoder; +import nlib.cmm.service.CodeService; +import nlib.cmm.service.NlibProperty; +import nlib.restful.service.DataApiReqVO; +import nlib.restful.service.DataApiResVO; +import nlib.user.service.NlibLoginVO; +import nlib.util.StringUtil; + +@Controller +public class AncmntController extends NlibCommonController +{ +// private static final Logger log = LoggerFactory.getLogger(AncmntController.class); +// +// static final String DEFUALT_PAGE_SIZE = NlibProperty.getProperty("list.paging.page.size"); +// +// @Resource(name = "boardService") +// private BoardService boardService; +// +// @Resource(name = "nlibPasswordEncoder") +// private NlibPasswordEncoder nlibPasswordEncoder; +// +// @Resource(name = "ariaCrypto") +// private AriaCrypto ariaCrypto; +// +// @Resource(name = "codeService") +// private CodeService codeService; +// +// +// @Autowired +// private AuthenticationManager authenticationManager; +// +// /** +// * 공지사항 목록 화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/listNotices.do") +// public String listNotices(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String articleType = paramMap.get("articleType"); +// String message = paramMap.get("message"); +// +// log.debug("listNotices > pageIndex = " + pageIndex); +// log.debug("listNotices > pageSize = " + pageSize); +// log.debug("listNotices > searchKeyword = " + searchKeyword); +// log.debug("listNotices > articleType = " + articleType); +// log.debug("listNotices > message = " + message); +// +// // 페이징 사이즈 코드 목록 조회 +// List> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION"); +// +// // 공지사항 유형 코드 목록 조회 +// List> articleTypeCodes = codeService.listCodes("ARTICLE_TYPE"); +// +// // 반환 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("pageSizeCodes", pageSizeCodes); +// model.addAttribute("articleTypeCodes", articleTypeCodes); +// model.addAttribute("articleType" , articleType); +// model.addAttribute("message" , message); +// +// return "nlib/board/listNotices"; +// } +// +// /** +// * 공지사항 목록 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping(value="/board/listNoticesAjax.do") +// public ResponseEntity listNoticesAjax(HttpServletRequest req, +// Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String articleType = paramMap.get("articleType"); +// +// log.debug("listNoticesAjax > pageIndex = " + pageIndex); +// log.debug("listNoticesAjax > pageSize = " + pageSize); +// log.debug("listNoticesAjax > searchKeyword = " + searchKeyword); +// log.debug("listNoticesAjax > articleType = " + articleType); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("searchKeyword", searchKeyword); +// reqVO.addInfoItem("articleType", articleType); +// +// // 요청 +// DataApiResVO resVO = boardService.listNotices(reqVO); +// +// //------------------------------- +// // JSON변환 응답 처리 +// //------------------------------- +// // JS-GRID 페이징 처리를 포함한 응답값 처리 +// // {data: [{...}], +// // itemsCount: 255 +// // } +// HashMap retMap = new HashMap(); +// retMap.put("data", resVO.getList()); +// retMap.put("itemsCount", resVO.getRecordTotCount()); +// +// return makeResponseEntityJson(retMap); +// } +// +// /** +// * 공지사항 상세 내용 조회한다. +// * @param req +// * @return +// */ +// @RequestMapping("/board/selectNotice.do") +// public String selectNotice(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// // 목록 이동시 전달할 매개변수 +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = paramMap.get("pageIndex"); +// String pageSize = paramMap.get("pageSize"); +// String articleType = paramMap.get("articleType"); +// String message = paramMap.get("message"); +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// log.debug("selectNotice > pageIndex = " + pageIndex); +// log.debug("selectNotice > pageSize = " + pageSize); +// log.debug("selectNotice > searchKeyword = " + searchKeyword); +// log.debug("selectNotice > articleNo = " + articleNo); +// log.debug("selectNotice > message = " + message); +// log.debug("selectNotice > articleType = " + articleType); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectNotice(reqVO); +// +// // 반환 정보 +// model.addAttribute("articleNo" , articleNo); +// model.addAttribute("article" , resVO.getInfo()); // 게시물 상세 +// model.addAttribute("preArticle" , resVO.getList().get(0)); // 이전글 정보 +// model.addAttribute("nextArticle" , resVO.getList().get(1)); // 다음글 정보 +// model.addAttribute("message" , message); +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("articleType" , articleType); +// +// return "nlib/board/selectNotice"; +// } +// +// /** +// * FAQ 목록 화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/listFAQs.do") +// public String listFAQs(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String message = paramMap.get("message"); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQs > pageIndex = " + pageIndex); +// log.debug("listFAQs > pageSize = " + pageSize); +// log.debug("listFAQs > searchKeyword = " + searchKeyword); +// log.debug("listFAQs > message = " + message); +// log.debug("listFAQs > faqType = " + faqType); +// +// DataApiReqVO reqVOforCode = new DataApiReqVO(); +// reqVOforCode.setAuthKey(createAuthKey(req, authentication)); +// reqVOforCode.setPageIndex(0); +// reqVOforCode.setPageSize(0); +// +// +// // 페이징 사이즈 코드 목록 조회 +// List> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION"); +// +// // 유형 코드 목록 조회 +// List> articleTypeCodes = codeService.listCodes("FAQ_TYPE"); +// +// // 반환 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("pageSizeCodes", pageSizeCodes); +// model.addAttribute("faqTypeCodes" , articleTypeCodes); +// model.addAttribute("message" , message); +// model.addAttribute("faqType" , faqType); +// model.addAttribute("faqType" , faqType); +// +// return "nlib/board/listFAQs"; +// } +// +// +// /** +// * FAQ 목록 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping(value="/board/listFAQsAjax.do") +// public ResponseEntity listFAQsAjax(HttpServletRequest req, +// Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQsAjax > pageIndex = " + pageIndex); +// log.debug("listFAQsAjax > pageSize = " + pageSize); +// log.debug("listFAQsAjax > searchKeyword = " + searchKeyword); +// log.debug("listFAQsAjax > faqType = " + faqType); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("searchKeyword", searchKeyword); +// reqVO.addInfoItem("faqType", faqType); +// +// // 요청 +// DataApiResVO resVO = boardService.listFAQs(reqVO); +// +// //------------------------------- +// // JSON변환 응답 처리 +// //------------------------------- +// // JS-GRID 페이징 처리를 포함한 응답값 처리 +// // {data: [{...}], +// // itemsCount: 255 +// // } +// HashMap retMap = new HashMap(); +// retMap.put("data", resVO.getList()); +// retMap.put("itemsCount", resVO.getRecordTotCount()); +// +// return makeResponseEntityJson(retMap); +// } +// +// +// /** +// * 묻고답하기 상세 내용 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/selectFAQAjax.do") +// public ResponseEntity selectFAQAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// log.debug("selectQnA > articleNo = " + articleNo); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.addInfoItem("boardNo", "FAQ"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectFAQ(reqVO); +// +// // 반환 정보 +// return makeResponseEntityJson(resVO.getInfo()); +// } +// +// /** +// * 묻고답하기 목록 화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/listQnAs.do") +// public String listQnAs(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String message = paramMap.get("message"); +// +// log.debug("listQnAs > pageIndex = " + pageIndex); +// log.debug("listQnAs > pageSize = " + pageSize); +// log.debug("listQnAs > searchKeyword = " + searchKeyword); +// log.debug("listQnAs > message = " + message); +// +// // 페이징 사이즈 코드 목록 조회 +// List> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION"); +// +// // 반환 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("pageSizeCodes", pageSizeCodes); +// model.addAttribute("message" , message); +// +// return "nlib/board/listQnAs"; +// } +// +// /** +// * 묻고답하기 목록 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping(value="/board/listQnAsAjax.do") +// public ResponseEntity listQnAsAjax(HttpServletRequest req, +// Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// +// log.debug("listQnAsAjax > pageIndex = " + pageIndex); +// log.debug("listQnAsAjax > pageSize = " + pageSize); +// log.debug("listQnAsAjax > searchKeyword = " + searchKeyword); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("searchKeyword", searchKeyword); +// +// // 요청 +// DataApiResVO resVO = boardService.listQnAs(reqVO); +// +// //------------------------------- +// // JSON변환 응답 처리 +// //------------------------------- +// // JS-GRID 페이징 처리를 포함한 응답값 처리 +// // {data: [{...}], +// // itemsCount: 255 +// // } +// HashMap retMap = new HashMap(); +// retMap.put("data", resVO.getList()); +// retMap.put("itemsCount", resVO.getRecordTotCount()); +// +// return makeResponseEntityJson(retMap); +// } +// +// +// /** +// * 묻고답하기 상세 내용 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/selectQnA.do") +// public String selectQnA(HttpServletRequest req +// , Authentication authentication +// , @RequestParam Map paramMap +// , ModelMap model) throws Exception { +// +// addParamFromInputFlash(paramMap, req); +// +// // 목록 이동시 전달할 매개변수 +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = paramMap.get("pageIndex"); +// String pageSize = paramMap.get("pageSize"); +// String message = paramMap.get("message"); +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// log.debug("selectQnA > pageIndex = " + pageIndex); +// log.debug("selectQnA > pageSize = " + pageSize); +// log.debug("selectQnA > searchKeyword = " + searchKeyword); +// log.debug("selectQnA > articleNo = " + articleNo); +// log.debug("selectQnA > message = " + message); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectQnA(reqVO); +// +// // 반환 정보 +// model.addAttribute("articleNo" , articleNo); +// model.addAttribute("article" , resVO.getInfo()); // 게시물 상세 +// model.addAttribute("preArticle" , resVO.getList().get(0)); // 이전글 정보 +// model.addAttribute("nextArticle" , resVO.getList().get(1)); // 다음글 정보 +// model.addAttribute("message" , message); +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// +// return "nlib/board/selectQnA"; +// } +// +// /** +// * 묻고답하기 글작성화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/insertQnAForm.do") +// public String insertQnAForm(HttpServletRequest req, Authentication authentication +// , @RequestParam Map paramMap +// , ModelMap model) throws Exception { +// +// // 입력 매개변수 출력 설정 +// addParamsToModel(paramMap, model); +// +// NlibLoginVO loginVO = getNlibLoginVO(authentication); +// if(StringUtil.isEmpty(paramMap.get("regUserName"))) model.addAttribute("regUserName", loginVO.getName()); +// if(StringUtil.isEmpty(paramMap.get("email"))) model.addAttribute("regUserName", loginVO.getEmail()); +// +// return "nlib/board/insertQnAForm"; +// } +// +// /** +// * 묻고답하기 등록 처리한다. +// * +// * @param req +// * @param authentication +// * @param paramMap +// * @param model +// * @return +// */ +// @RequestMapping("/board/insertQnA.do") +// public String insertQnA(HttpServletRequest req +// , Authentication authentication +// , @RequestParam Map paramMap +// , RedirectAttributes redirectAttrs +// , ModelMap model) throws Exception { +// +// NlibLoginVO loginVO = getNlibLoginVO(authentication); +// +// log.debug("paramMap > " + paramMap); +// +// String message = null; +// String authKey = createAuthKey(req, authentication); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(authKey); +// reqVO.addInfoItem("boardNo" , "QNA"); +// reqVO.addInfoItem("title" , paramMap.get("title")); +// reqVO.addInfoItem("regUserName" , paramMap.get("regUserName")); +// reqVO.addInfoItem("email" , paramMap.get("email")); +// reqVO.addInfoItem("contentQeust", paramMap.get("contentQeust")); +// +// String fileListJsonStr = paramMap.get("fileList"); +// if(fileListJsonStr.startsWith("\"")) fileListJsonStr = fileListJsonStr.substring(1); +// if(fileListJsonStr.endsWith("\"")) fileListJsonStr = fileListJsonStr.substring(0, fileListJsonStr.length()-1); +// fileListJsonStr = fileListJsonStr.replaceAll("\\\\", ""); +// +// log.debug("fileList : " + fileListJsonStr); +// +// /* +// ObjectMapper mapper = new ObjectMapper(); +// List> fileList = null; +// try { +// fileList = mapper.readValue(fileListJsonStr, new TypeReference>>() { +// }); +// +// for (Map map : fileList) { +// MapUtils.debugPrint(System.out, "map", map); +// } +// +// } catch (JsonMappingException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } catch (JsonProcessingException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// +// log.debug("fileMap =" + fileList); +// */ +// reqVO.addInfoItem("fileList", fileListJsonStr); +// +// // 요청 +// DataApiResVO resVO = boardService.insertQnA(reqVO); +// +// // 처리결과 확인 +// if(!resVO.isSuccess()) { +// message = resVO.getResultMessage(); +// redirectAttrs.addFlashAttribute("message", message); +// addParamsToRedirect(paramMap, redirectAttrs, null, "pageIndex,pageSize,searchKeyword"); +// addParamsToRedirect(paramMap, redirectAttrs, null, +// "title,articlePassword," +// + "regDate, regUserName, " +// + "email, contentQeust"); +// +// return "redirect:/board/insertQnAForm.do"; +// } +// +// redirectAttrs.addFlashAttribute("pageSize", paramMap.get("pageSize")); +// redirectAttrs.addFlashAttribute("message", "성공적으로 등록되었습니다."); +// +// return "redirect:/board/listQnAs.do"; +// } +// +// @RequestMapping("/board/verifyWriter.do") +// public String verifyWriter(HttpServletRequest req) throws Exception { +// return "nlib/board/verifyWriter"; +// } +// +// /** +// * 묻고답하기 수정 화면 표출한다. +// * +// * @param req +// * @param authentication +// * @param paramMap +// * @param model +// * @return +// */ +// @RequestMapping("/board/updateQnAForm.do") +// public String updateQnAForm(HttpServletRequest req +// , Authentication authentication +// , @RequestParam Map paramMap +// , ModelMap model +// , RedirectAttributes redirectAttrs +// ) throws Exception { +// +// // 목록 이동시 전달할 매개변수 +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = paramMap.get("pageIndex"); +// String pageSize = paramMap.get("pageSize"); +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// String articlePassword = paramMap.get("articlePassword"); +// +// log.debug("updateQnAForm > pageIndex = " + pageIndex); +// log.debug("updateQnAForm > pageSize = " + pageSize); +// log.debug("updateQnAForm > searchKeyword = " + searchKeyword); +// log.debug("updateQnAForm > articleNo = " + articleNo); +// log.debug("updateQnAForm > articlePassword = " + articlePassword); +// +// if(StringUtil.isEmpty(articlePassword)) { +// redirectAttrs.addFlashAttribute("message", "비밀빈호가 올바르지 않습니다.(U1)"); +// +// addParamsToRedirect(paramMap, redirectAttrs, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// return "redirect:/board/selectQnA.do"; +// } +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectQnA(reqVO); +// +// // 비밀번호 확인 +// HashMap article = resVO.getInfo(); +// String shaArticlePassword = nlibPasswordEncoder.encode(articlePassword); +// log.debug("updateQnAForm > 입력받은 비밀번호를 SHA256 암호화한 값 : " + shaArticlePassword); +// +// if(!shaArticlePassword.equals(article.get("articlePassword"))) { +// redirectAttrs.addFlashAttribute("message", "비밀번호가 올바르지 않습니다.(U2)"); +// addParamsToRedirect(paramMap, redirectAttrs, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// return "redirect:/board/selectQnA.do"; +// } +// +// // 반환 정보 +// model.addAttribute("articleNo" , articleNo); +// model.addAttribute("article" , resVO.getInfo()); +// +// //------------------------------- +// // 게시글 비밀번호 처리 +// //------------------------------- +// // 비밀번호 : SHA-256 암호화 처리되어 DB에 저장되며, +// // 웹 화면에 표출될 때는 Aria로 articleNo를 Salt값으로 하여 재암호화처리하고 BASE64로 다시 한번 인코딩하여 표출함 +// String encArticlePassword = StringUtil.encodeBase64(ariaCrypto.encode(shaArticlePassword)); +// model.addAttribute("encArticlePassword", encArticlePassword); +// +// // 검색 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// +// return "nlib/board/updateQnAForm"; +// } +// +// /** +// * 묻고답하기 수정 처리한다. +// * +// * @param req +// * @param authentication +// * @param paramMap +// * @param model +// * @return +// */ +// @RequestMapping("/board/updateQnA.do") +// public String updateQnA(HttpServletRequest req +// , Authentication authentication +// , @RequestParam Map paramMap +// , RedirectAttributes redirectAttrs +// , ModelMap model) throws Exception { +// +// log.debug("paramMap > " + paramMap); +// +// String message = null; +// String authKey = createAuthKey(req, authentication); +// +// // 목록 이동시 전달할 매개변수 +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = paramMap.get("pageIndex"); +// String pageSize = paramMap.get("pageSize"); +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// //------------------------------- +// // 게시글 비밀번호 처리 +// //------------------------------- +// // 비밀번호 : SHA-256 암호화 처리되어 DB에 저장되며, +// // 웹 화면에 표출될 때는 Aria로 articleNo를 Salt값으로 하여 재암호화처리하고 BASE64로 다시 한번 인코딩하여 표출함 +// String encArticlePassword = paramMap.get("encArticlePassword"); +// String checkArticlePassword = ariaCrypto.decode(StringUtil.decodeBase64(encArticlePassword)); +// String articlePassword = paramMap.get("articlePassword"); +// +// //------------------------------- +// // 비밀번호 유효 체크 +// //------------------------------- +// // 기존 정보 조회 +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(authKey); +// reqVO.addInfoItem("articleNo", articleNo); +// +// DataApiResVO resVO = boardService.selectQnA(reqVO); +// String oldArticlePassword = resVO.getInfoItem("articlePassword"); +// if(checkArticlePassword == null || !checkArticlePassword.equals(oldArticlePassword)) { +// redirectAttrs.addFlashAttribute("errorCode", "ERR_BRD_UPDTQNA"); +// redirectAttrs.addFlashAttribute("errorMessage", "잘못된 접근입니다."); +// return "redirect:/alert/showError.do"; +// } +// +// // 새 글비밀번호가 존재하지 않는 경우, 기존 비밀번호 설정 처리 +// if(StringUtil.isEmpty(articlePassword)) { +// articlePassword = checkArticlePassword; +// } +// // 새 글비밀번호가 입력된 경우, SHA256 암호화 처리하여 설정 +// else { +// articlePassword = nlibPasswordEncoder.encode(articlePassword); +// } +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO updateReqVO = new DataApiReqVO(); +// updateReqVO.setAuthKey(authKey); +// updateReqVO.addInfoItem("boardNo" , "QNA"); +// updateReqVO.addInfoItem("articleNo" , articleNo); +// updateReqVO.addInfoItem("title" , paramMap.get("title")); +// updateReqVO.addInfoItem("regUserName" , paramMap.get("regUserName")); +// updateReqVO.addInfoItem("email" , paramMap.get("email")); +// updateReqVO.addInfoItem("contentQeust", paramMap.get("contentQeust")); +// updateReqVO.addInfoItem("articlePassword", articlePassword); // SHA256 글비밀번호 +// +// // 요청 +// DataApiResVO updateResVO = boardService.updateQnA(updateReqVO); +// +// // 처리결과 확인 +// if(!updateResVO.isSuccess()) { +// message = updateResVO.getResultMessage(); +// model.addAttribute("message", message); +// addParamsToModel(paramMap, model, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// addParamsToModel(paramMap, model, "article" +// , "articleNo,articleType," +// + "articleTypeName,title,articlePassword,readCount," +// + "regDate, reguserName, repStats, " +// + "email, contentQeust, " +// + "contentQuestFile"); +// +// return "redirect:/board/updateQnAForm.do"; +// } +// +// // 반환 정보 +// model.addAttribute("articleNo" , updateResVO.getInfoItem("articleNo")); // 신규등록된 게시물 ID +// model.addAttribute("message" , "성공적으로 수정되었습니다."); +// +// // 검색 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// +// return "redirect:/board/selectQnA.do"; +// } +// +// /** +// * 묻고답하기 삭제한다. +// * +// * @param req +// * @param authentication +// * @param paramMap +// * @param model +// * @return +// */ +// @RequestMapping("/board/deleteQnA.do") +// public String deleteQnA(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String message = null; +// +// // 목록 이동시 전달할 매개변수 +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = paramMap.get("pageIndex"); +// String pageSize = paramMap.get("pageSize"); +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// String articlePassword = paramMap.get("articlePassword"); +// +// log.debug("deleteQnA > pageIndex = " + pageIndex); +// log.debug("deleteQnA > pageSize = " + pageSize); +// log.debug("deleteQnA > searchKeyword = " + searchKeyword); +// log.debug("deleteQnA > articleNo = " + articleNo); +// log.debug("deleteQnA > articlePassword = " + articlePassword); +// +// if(StringUtil.isEmpty(articlePassword)) { +// model.addAttribute("message", "글비밀빈호가 올바르지 않습니다.(D1)"); +// addParamsToModel(paramMap, model, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// return "redirect:/board/selectQnA.do"; +// } +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("boardNo", "QNA"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectQnA(reqVO); +// +// // 비밀번호 확인 +// HashMap article = resVO.getInfo(); +// String shaArticlePassword = nlibPasswordEncoder.encode(articlePassword); +// log.debug("updateQnAForm > 입력받은 비밀번호를 SHA256 암호화한 값 : " + shaArticlePassword); +// +// if(!shaArticlePassword.equals(article.get("articlePassword"))) { +// model.addAttribute("message", "글비밀번호가 올바르지 않습니다.(D2)"); +// addParamsToModel(paramMap, model, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// return "redirect:/board/selectQnA.do"; +// } +// +// // 삭제 처리 +// DataApiResVO delResVO = boardService.deleteQnA(reqVO); +// +// // 처리결과 확인 +// if(!delResVO.isSuccess()) { +// message = delResVO.getResultMessage(); +// model.addAttribute("message", message); +// addParamsToModel(paramMap, model, null, "pageIndex,pageSize,searchKeyword,articleNo"); +// +// return "redirect:/board/selectQnA.do"; +// } +// +// // 반환 정보 +// model.addAttribute("message" , "성공적으로 삭제되었습니다."); +// +// // 검색 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// +// return "redirect:/board/listQnAs.do"; +// } + +} \ No newline at end of file diff --git a/src/main/java/nlib/bbs/web/FaqController.java b/src/main/java/nlib/bbs/web/FaqController.java new file mode 100644 index 00000000..8a16c250 --- /dev/null +++ b/src/main/java/nlib/bbs/web/FaqController.java @@ -0,0 +1,188 @@ + +package nlib.bbs.web; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import org.springframework.web.servlet.support.RequestContextUtils; + +import nlib.bbs.service.BoardService; +import nlib.cmm.NlibCommonController; +import nlib.cmm.crypto.AriaCrypto; +import nlib.cmm.crypto.NlibPasswordEncoder; +import nlib.cmm.service.CodeService; +import nlib.cmm.service.NlibProperty; +import nlib.restful.service.DataApiReqVO; +import nlib.restful.service.DataApiResVO; +import nlib.user.service.NlibLoginVO; +import nlib.util.StringUtil; + +@Controller +public class FaqController extends NlibCommonController { + +// private static final Logger log = LoggerFactory.getLogger(FaqController.class); +// +// static final String DEFUALT_PAGE_SIZE = NlibProperty.getProperty("list.paging.page.size"); +// +// @Resource(name = "boardService") +// private BoardService boardService; +// +// @Resource(name = "nlibPasswordEncoder") +// private NlibPasswordEncoder nlibPasswordEncoder; +// +// @Resource(name = "ariaCrypto") +// private AriaCrypto ariaCrypto; +// +// @Resource(name = "codeService") +// private CodeService codeService; +// +// +// @Autowired +// private AuthenticationManager authenticationManager; +// +// /** +// * FAQ 목록 화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/listFAQs.do") +// public String listFAQs(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String message = paramMap.get("message"); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQs > pageIndex = " + pageIndex); +// log.debug("listFAQs > pageSize = " + pageSize); +// log.debug("listFAQs > searchKeyword = " + searchKeyword); +// log.debug("listFAQs > message = " + message); +// log.debug("listFAQs > faqType = " + faqType); +// +// DataApiReqVO reqVOforCode = new DataApiReqVO(); +// reqVOforCode.setAuthKey(createAuthKey(req, authentication)); +// reqVOforCode.setPageIndex(0); +// reqVOforCode.setPageSize(0); +// +// +// // 페이징 사이즈 코드 목록 조회 +// List> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION"); +// +// // 유형 코드 목록 조회 +// List> articleTypeCodes = codeService.listCodes("FAQ_TYPE"); +// +// // 반환 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("pageSizeCodes", pageSizeCodes); +// model.addAttribute("faqTypeCodes" , articleTypeCodes); +// model.addAttribute("message" , message); +// model.addAttribute("faqType" , faqType); +// model.addAttribute("faqType" , faqType); +// +// return "nlib/board/listFAQs"; +// } +// +// +// /** +// * FAQ 목록 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping(value="/board/listFAQsAjax.do") +// public ResponseEntity listFAQsAjax(HttpServletRequest req, +// Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQsAjax > pageIndex = " + pageIndex); +// log.debug("listFAQsAjax > pageSize = " + pageSize); +// log.debug("listFAQsAjax > searchKeyword = " + searchKeyword); +// log.debug("listFAQsAjax > faqType = " + faqType); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("searchKeyword", searchKeyword); +// reqVO.addInfoItem("faqType", faqType); +// +// // 요청 +// DataApiResVO resVO = boardService.listFAQs(reqVO); +// +// //------------------------------- +// // JSON변환 응답 처리 +// //------------------------------- +// // JS-GRID 페이징 처리를 포함한 응답값 처리 +// // {data: [{...}], +// // itemsCount: 255 +// // } +// HashMap retMap = new HashMap(); +// retMap.put("data", resVO.getList()); +// retMap.put("itemsCount", resVO.getRecordTotCount()); +// +// return makeResponseEntityJson(retMap); +// } +// +// +// /** +// * 묻고답하기 상세 내용 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/selectFAQAjax.do") +// public ResponseEntity selectFAQAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// log.debug("selectQnA > articleNo = " + articleNo); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.addInfoItem("boardNo", "FAQ"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectFAQ(reqVO); +// +// // 반환 정보 +// return makeResponseEntityJson(resVO.getInfo()); +// } +// +// @RequestMapping("/board/verifyWriter.do") +// public String verifyWriter(HttpServletRequest req) throws Exception { +// return "nlib/board/verifyWriter"; +// } + +} \ No newline at end of file diff --git a/src/main/java/nlib/bbs/web/QnaController.java b/src/main/java/nlib/bbs/web/QnaController.java new file mode 100644 index 00000000..da7ecb3a --- /dev/null +++ b/src/main/java/nlib/bbs/web/QnaController.java @@ -0,0 +1,188 @@ + +package nlib.bbs.web; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.ResponseEntity; +import org.springframework.security.authentication.AuthenticationManager; +import org.springframework.security.core.Authentication; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.servlet.mvc.support.RedirectAttributes; +import org.springframework.web.servlet.support.RequestContextUtils; + +import nlib.bbs.service.BoardService; +import nlib.cmm.NlibCommonController; +import nlib.cmm.crypto.AriaCrypto; +import nlib.cmm.crypto.NlibPasswordEncoder; +import nlib.cmm.service.CodeService; +import nlib.cmm.service.NlibProperty; +import nlib.restful.service.DataApiReqVO; +import nlib.restful.service.DataApiResVO; +import nlib.user.service.NlibLoginVO; +import nlib.util.StringUtil; + +@Controller +public class QnaController extends NlibCommonController +{ +// private static final Logger log = LoggerFactory.getLogger(QnaController.class); +// +// static final String DEFUALT_PAGE_SIZE = NlibProperty.getProperty("list.paging.page.size"); +// +// @Resource(name = "boardService") +// private BoardService boardService; +// +// @Resource(name = "nlibPasswordEncoder") +// private NlibPasswordEncoder nlibPasswordEncoder; +// +// @Resource(name = "ariaCrypto") +// private AriaCrypto ariaCrypto; +// +// @Resource(name = "codeService") +// private CodeService codeService; +// +// +// @Autowired +// private AuthenticationManager authenticationManager; +// +// /** +// * FAQ 목록 화면을 표출한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/listFAQs.do") +// public String listFAQs(HttpServletRequest req, Authentication authentication, @RequestParam Map paramMap, ModelMap model) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String message = paramMap.get("message"); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQs > pageIndex = " + pageIndex); +// log.debug("listFAQs > pageSize = " + pageSize); +// log.debug("listFAQs > searchKeyword = " + searchKeyword); +// log.debug("listFAQs > message = " + message); +// log.debug("listFAQs > faqType = " + faqType); +// +// DataApiReqVO reqVOforCode = new DataApiReqVO(); +// reqVOforCode.setAuthKey(createAuthKey(req, authentication)); +// reqVOforCode.setPageIndex(0); +// reqVOforCode.setPageSize(0); +// +// +// // 페이징 사이즈 코드 목록 조회 +// List> pageSizeCodes = codeService.listCodes("PAGE_SIZE_OPTION"); +// +// // 유형 코드 목록 조회 +// List> articleTypeCodes = codeService.listCodes("FAQ_TYPE"); +// +// // 반환 정보 +// model.addAttribute("pageIndex" , pageIndex); +// model.addAttribute("pageSize" , pageSize); +// model.addAttribute("searchKeyword", searchKeyword); +// model.addAttribute("pageSizeCodes", pageSizeCodes); +// model.addAttribute("faqTypeCodes" , articleTypeCodes); +// model.addAttribute("message" , message); +// model.addAttribute("faqType" , faqType); +// model.addAttribute("faqType" , faqType); +// +// return "nlib/board/listFAQs"; +// } +// +// +// /** +// * FAQ 목록 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping(value="/board/listFAQsAjax.do") +// public ResponseEntity listFAQsAjax(HttpServletRequest req, +// Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// String searchKeyword = paramMap.get("searchKeyword"); +// String pageIndex = StringUtil.getString(paramMap.get("pageIndex"), "1"); +// String pageSize = StringUtil.getString(paramMap.get("pageSize") , DEFUALT_PAGE_SIZE); +// String faqType = paramMap.get("faqType"); +// +// log.debug("listFAQsAjax > pageIndex = " + pageIndex); +// log.debug("listFAQsAjax > pageSize = " + pageSize); +// log.debug("listFAQsAjax > searchKeyword = " + searchKeyword); +// log.debug("listFAQsAjax > faqType = " + faqType); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.setPageIndex(pageIndex); +// reqVO.setPageSize(pageSize); +// reqVO.addInfoItem("searchKeyword", searchKeyword); +// reqVO.addInfoItem("faqType", faqType); +// +// // 요청 +// DataApiResVO resVO = boardService.listFAQs(reqVO); +// +// //------------------------------- +// // JSON변환 응답 처리 +// //------------------------------- +// // JS-GRID 페이징 처리를 포함한 응답값 처리 +// // {data: [{...}], +// // itemsCount: 255 +// // } +// HashMap retMap = new HashMap(); +// retMap.put("data", resVO.getList()); +// retMap.put("itemsCount", resVO.getRecordTotCount()); +// +// return makeResponseEntityJson(retMap); +// } +// +// +// /** +// * 묻고답하기 상세 내용 조회한다. +// * +// * @param req +// * @return +// */ +// @RequestMapping("/board/selectFAQAjax.do") +// public ResponseEntity selectFAQAjax(HttpServletRequest req, Authentication authentication, @RequestBody Map paramMap) throws Exception { +// +// // 게시물 번호 +// String articleNo = paramMap.get("articleNo"); +// +// log.debug("selectQnA > articleNo = " + articleNo); +// +// //------------------------------- +// // REQ VO 구성 +// //------------------------------- +// DataApiReqVO reqVO = new DataApiReqVO(); +// reqVO.setAuthKey(createAuthKey(req, authentication)); +// reqVO.addInfoItem("boardNo", "FAQ"); // 게시판ID +// reqVO.addInfoItem("articleNo", articleNo); // 게시물번호 +// +// // 요청 +// DataApiResVO resVO = boardService.selectFAQ(reqVO); +// +// // 반환 정보 +// return makeResponseEntityJson(resVO.getInfo()); +// } +// +// @RequestMapping("/board/verifyWriter.do") +// public String verifyWriter(HttpServletRequest req) throws Exception { +// return "nlib/board/verifyWriter"; +// } + +} \ No newline at end of file diff --git a/src/main/java/nlib/cmm/service/AlertService.java b/src/main/java/nlib/cmm/service/AlertService.java new file mode 100644 index 00000000..294393a7 --- /dev/null +++ b/src/main/java/nlib/cmm/service/AlertService.java @@ -0,0 +1,30 @@ + +package nlib.cmm.service; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import nlib.user.service.NlibLoginVO; + +public interface AlertService +{ + + /* + * 사용자 알림 목록을 조회한다. + */ + public List listAlerts(AlertVO alertVO) throws Exception; + + +// /* +// * 사용자 미확인 신규 알림 건수를 조회한다. +// */ +// public HashMap selectNewAlertCount(NlibLoginVO nlibLoginVO) throws Exception; +// +// /* +// * 가장 최근 알림건을 읽음 처리하고 내용을 조회한다. +// */ +// public HashMap selectAlert(NlibLoginVO nlibLoginVO, int nlibAlertId) throws Exception; + +} + diff --git a/src/main/java/nlib/cmm/service/AlertVO.java b/src/main/java/nlib/cmm/service/AlertVO.java new file mode 100644 index 00000000..b145a6c0 --- /dev/null +++ b/src/main/java/nlib/cmm/service/AlertVO.java @@ -0,0 +1,85 @@ +package nlib.cmm.service; + +public class AlertVO extends PagingVO { + + private String nlibAlertId; /* 알림ID */ + private String title; /* 알림제목 */ + private String content; /* 알림내용 */ + private String alertType; /* 알림유형 */ + private String alertDivCd; /* 알림내용구분코드 */ + private String readDd; /* 알림확인일시 */ + private String RegId; /* 등록자아이디 */ + private String regDd; /* 등록일자 */ + + private String mbInfoId; /* 알림대상자 회원아이디 */ + private String readYn; /* 알림확인여부 */ + private int totCnt = 0; + + public String getNlibAlertId() { + return nlibAlertId; + } + public void setNlibAlertId(String nlibAlertId) { + this.nlibAlertId = nlibAlertId; + } + public String getTitle() { + return title; + } + public void setTitle(String title) { + this.title = title; + } + public String getContent() { + return content; + } + public void setContent(String content) { + this.content = content; + } + public String getAlertType() { + return alertType; + } + public void setAlertType(String alertType) { + this.alertType = alertType; + } + public String getAlertDivCd() { + return alertDivCd; + } + public void setAlertDivCd(String alertDivCd) { + this.alertDivCd = alertDivCd; + } + public String getReadDd() { + return readDd; + } + public void setReadDd(String readDd) { + this.readDd = readDd; + } + public String getRegId() { + return RegId; + } + public void setRegId(String regId) { + RegId = regId; + } + public String getRegDd() { + return regDd; + } + public void setRegDd(String regDd) { + this.regDd = regDd; + } + public String getMbInfoId() { + return mbInfoId; + } + public void setMbInfoId(String mbInfoId) { + this.mbInfoId = mbInfoId; + } + public int getTotCnt() { + return totCnt; + } + public void setTotCnt(int totCnt) { + this.totCnt = totCnt; + } + public String getReadYn() { + return readYn; + } + public void setReadYn(String readYn) { + this.readYn = readYn; + } + +} diff --git a/src/main/java/nlib/cmm/service/PagingVO.java b/src/main/java/nlib/cmm/service/PagingVO.java new file mode 100644 index 00000000..3659ec46 --- /dev/null +++ b/src/main/java/nlib/cmm/service/PagingVO.java @@ -0,0 +1,29 @@ +package nlib.cmm.service; + +public class PagingVO { + + String pageIndex; /* 페이지 번호 */ + String pageSize; /* 페이지 크기 (1페이지당 보여줄 자료건수) */ + int totRecordCount; /* 총건수 */ + + public String getPageIndex() { + return pageIndex; + } + public void setPageIndex(String pageIndex) { + this.pageIndex = pageIndex; + } + public String getPageSize() { + return pageSize; + } + public void setPageSize(String pageSize) { + this.pageSize = pageSize; + } + public int getTotRecordCount() { + return totRecordCount; + } + public void setTotRecordCount(int totRecordCount) { + this.totRecordCount = totRecordCount; + } + + +} diff --git a/src/main/java/nlib/cmm/service/impl/AlertDAO.java b/src/main/java/nlib/cmm/service/impl/AlertDAO.java new file mode 100644 index 00000000..c14aae4a --- /dev/null +++ b/src/main/java/nlib/cmm/service/impl/AlertDAO.java @@ -0,0 +1,51 @@ +package nlib.cmm.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.springframework.stereotype.Repository; + +import egovframework.com.cmm.service.impl.EgovComAbstractDAO; +import egovframework.rte.psl.dataaccess.mapper.Mapper; +import nlib.cmm.service.AlertVO; +import nlib.cmm.service.NlibProperty; +import nlib.user.service.NlibLoginVO; +import nlib.util.StringUtil; + +/** + *
+ * @Class Name : InformDAO.java
+ * 
+ * @Description : 이용안내 및 약관관련 정보 제공 DAO 
+ * 
+ * 
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ * 
+ * + * @ ------------ -------- --------------------------- + * @ 수정일 수정자 수정내용 + * @ ------------ -------- --------------------------- + * @ 2021. 7. 27. KNKIM 최초 생성 + * + * + * @author 이씨플라자 * DIGITALSHIP KNKIM + * @since 2021. 7. 27. + * @version 1.0 + * + */ + + +@Repository("alertDAO") +public class AlertDAO extends EgovComAbstractDAO { + + /* + * 사용자 알림 목록을 조회한다. + */ + public List listAlerts(AlertVO searchAlertVO) throws Exception { + + return selectList("AlertDAO.listAlerts", searchAlertVO); + } + +} diff --git a/src/main/java/nlib/cmm/service/impl/AlertServiceImpl.java b/src/main/java/nlib/cmm/service/impl/AlertServiceImpl.java new file mode 100644 index 00000000..8cbf4ffa --- /dev/null +++ b/src/main/java/nlib/cmm/service/impl/AlertServiceImpl.java @@ -0,0 +1,51 @@ +package nlib.cmm.service.impl; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import javax.annotation.Resource; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Service; + +import nlib.cmm.service.AlertService; +import nlib.cmm.service.AlertVO; +import nlib.cmm.service.NlibProperty; +import nlib.user.service.NlibLoginVO; +import nlib.util.StringUtil; + +@Service("alertService") +public class AlertServiceImpl implements AlertService +{ + private static final Logger log = LoggerFactory.getLogger(AlertServiceImpl.class); + + @Resource(name="alertDAO") + private AlertDAO alertDAO; + + /* + * 사용자 알림 목록을 조회한다. + */ + public List listAlerts(AlertVO alertVO) throws Exception { + + return alertDAO.listAlerts(alertVO); + } + +// +// /* +// * 사용자 미확인 신규 알림 건수를 조회한다. +// */ +// public int selectNewAlertCount(String mbInfoId) throws Exception { +// return alertDAO.selectNewAlertCount(mbInfoId); +// } +// +// /* +// * 알림건을 읽음 처리하고 내용을 조회한다. +// * 이미 읽은 건의 경우, 내용만 조회한다. +// */ +// public HashMap selectUserAlert(AlertVO alertVO) throws Exception { +// return alertDAO.selectUserAlert(alertVO); +// } + +} \ No newline at end of file diff --git a/src/main/resources/egovframework/mapper/nlib/cmm/AlertDAO_SQL.xml b/src/main/resources/egovframework/mapper/nlib/cmm/AlertDAO_SQL.xml new file mode 100644 index 00000000..3cf7b031 --- /dev/null +++ b/src/main/resources/egovframework/mapper/nlib/cmm/AlertDAO_SQL.xml @@ -0,0 +1,26 @@ + + + + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/jsp/nlib/cmm/listAlerts.jsp b/src/main/webapp/WEB-INF/jsp/nlib/cmm/listAlerts.jsp new file mode 100644 index 00000000..d7483ea9 --- /dev/null +++ b/src/main/webapp/WEB-INF/jsp/nlib/cmm/listAlerts.jsp @@ -0,0 +1,221 @@ +<% +/** + *
+ * @Class Name : lisAlerts.jsp
+ * 
+ * @Description : 알림 목록을 조회한다.
+ * 
+ * 
+ * @프로젝트명: 지방문화원 통합자료관리시스템 구축사업 (2021)
+ *
+ * 
+ * + * @ ------------ -------- --------------------------- + * @ 수정일 수정자 수정내용 + * @ ------------ -------- --------------------------- + * @ 2021. 9. 6. KNKIM 최초 생성 + * + * + * @author 이씨플라자 * DIGITALSHIP KNKIM + * @since 2021. 9. 6. + * @version 1.0 + * + */ + %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> +<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> +<%@ taglib prefix="ui" uri="http://egovframework.gov/ctl/ui" %> +<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> +<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> +<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> +<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> +<%@ taglib prefix="validator" uri="http://www.springmodules.org/tags/commons-validator" %> + +알림 + + + + + ${pageTitle} + + + + + + + + + + + +

${pageTitle }

+ + 메시지 : ${message} + + +  
+
+ + + + + + + + +
+ +
+ + + + +
+ + + +