/** * 커뮤니티, 동호회에 사용되는 게시판 사용정보를 등록한다. * * @param bdUseVO * @param boardUseInf * @param status * @param model * @return * @throws Exception */ @RequestMapping("/cop/com/insertBBSUseInfByTrget.do") public String insertBBSUseInfByTrget( @ModelAttribute("searchVO") BoardUseInfVO bdUseVO, @ModelAttribute("boardUseInf") BoardUseInf boardUseInf, @RequestParam Map<String, Object> commandMap, SessionStatus status, ModelMap model) throws Exception { checkAuthority(bdUseVO); // server-side 권한 확인 String paramTrgetId = (String) commandMap.get("param_trgetId"); String bbsId = (String) commandMap.get("bbsId"); LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); if (isAuthenticated) { boardUseInf.setUseAt("Y"); boardUseInf.setFrstRegisterId(user.getUniqId()); boardUseInf.setRegistSeCode("REGC07"); boardUseInf.setBbsId(bbsId); boardUseInf.setTrgetId(paramTrgetId); bbsUseService.insertBBSUseInf(boardUseInf); } return "forward:/cop/com/selectCmyBBSUseInfsByTrget.do"; }
/** * 게시판 사용정보를 등록한다. * * @param bdUseVO * @param bdUseInf * @param sessionVO * @param status * @param model * @return * @throws Exception */ @RequestMapping("/cop/com/insertBBSUseInf.do") public String insertBBSUseInf( @ModelAttribute("searchVO") BoardUseInfVO bdUseVO, @ModelAttribute("boardUseInf") BoardUseInf boardUseInf, BindingResult bindingResult, Map<String, Object> commandMap, SessionStatus status, ModelMap model) throws Exception { LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser(); Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated(); beanValidator.validate(boardUseInf, bindingResult); if (bindingResult.hasErrors()) { return "egovframework/com/cop/com/EgovBoardUseInfRegist"; } String trgetType = (String) commandMap.get("param_trgetType"); String registSeCode = ""; // CMMNTY 06/CLUB 05/SYSTEM(REGC01) if ("CMMNTY".equals(trgetType)) { registSeCode = "REGC06"; } else if ("CLUB".equals(trgetType)) { registSeCode = "REGC05"; } else { registSeCode = "REGC01"; } boardUseInf.setUseAt("Y"); boardUseInf.setFrstRegisterId(user.getUniqId()); boardUseInf.setRegistSeCode(registSeCode); if (isAuthenticated) { bbsUseService.insertBBSUseInf(boardUseInf); } return "forward:/cop/com/selectBBSUseInfs.do"; }