feat: 로그인시 게시판 목록 조회 caching 처리 진행중

main
Jonguk. Lim 2 years ago
parent 8c7117f0b0
commit 2fd247860d

@ -1,8 +1,7 @@
package kr.xit.fims.biz.rt.web;
import kr.xit.fims.biz.rt.model.Rt0200SearchVO;
import kr.xit.fims.biz.rt.service.Rt0200Service;
import kr.xit.framework.biz.cmm.CacheCodeUtils;
import kr.xit.framework.biz.cache.util.CacheCodeUtils;
import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.model.ResultResponse;
import kr.xit.framework.core.validation.XitBeanValidator;
@ -11,9 +10,7 @@ import kr.xit.framework.support.mybatis.MybatisUtils;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm.mapper;
package kr.xit.framework.biz.cache.mapper;
import java.util.List;

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm.mapper;
package kr.xit.framework.biz.cache.mapper;
import java.util.List;

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm.service;
package kr.xit.framework.biz.cache.service;
import java.util.List;
import java.util.Map;

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm.service.impl;
package kr.xit.framework.biz.cache.service.impl;
import java.util.List;
import java.util.Map;
@ -7,9 +7,9 @@ import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;
import kr.xit.framework.biz.cmm.service.CacheService;
import kr.xit.framework.biz.cmm.mapper.CacheCodeMapper;
import kr.xit.framework.biz.cmm.mapper.CacheMenuMapper;
import kr.xit.framework.biz.cache.service.CacheService;
import kr.xit.framework.biz.cache.mapper.CacheCodeMapper;
import kr.xit.framework.biz.cache.mapper.CacheMenuMapper;
import lombok.AllArgsConstructor;
@AllArgsConstructor

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm;
package kr.xit.framework.biz.cache.util;
import java.util.List;
import java.util.Map;

@ -1,4 +1,4 @@
package kr.xit.framework.biz.cmm;
package kr.xit.framework.biz.cache.util;
import java.util.List;
import java.util.Map;

@ -1,12 +1,12 @@
package kr.xit.framework.biz.cmm.web;
package kr.xit.framework.biz.cache.web;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import kr.xit.framework.biz.cmm.CacheCodeUtils;
import kr.xit.framework.biz.cmm.CacheMenuUtils;
import kr.xit.framework.biz.cache.util.CacheCodeUtils;
import kr.xit.framework.biz.cache.util.CacheMenuUtils;
import kr.xit.framework.core.constants.FrameworkConstants;
/**

@ -1,6 +1,5 @@
package kr.xit.framework.biz.cmm.service.impl;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
@ -13,7 +12,7 @@ import org.springframework.stereotype.Service;
import egovframework.rte.fdl.cmmn.exception.FdlException;
import egovframework.rte.fdl.idgnr.EgovIdGnrService;
import egovframework.rte.fdl.security.intercept.EgovReloadableFilterInvocationSecurityMetadataSource;
import kr.xit.framework.biz.cmm.CacheMenuUtils;
import kr.xit.framework.biz.cache.util.CacheMenuUtils;
import lombok.extern.slf4j.Slf4j;
import kr.xit.framework.biz.cmm.mapper.XitFrameUnitMapper;
import kr.xit.framework.biz.cmm.model.XitAuthorGroupInfoVO;

@ -14,7 +14,7 @@ import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
import com.fasterxml.jackson.databind.JsonMappingException;
import egovframework.rte.fdl.security.userdetails.util.EgovUserDetailsHelper;
import kr.xit.framework.biz.cmm.CacheMenuUtils;
import kr.xit.framework.biz.cache.util.CacheMenuUtils;
import kr.xit.framework.core.model.XitRollingNotiVO;
import kr.xit.framework.support.exception.JSONExceptionMessageWriter;
import kr.xit.framework.support.util.Checks;

@ -10,7 +10,7 @@ import javax.servlet.jsp.tagext.TagSupport;
import org.springframework.util.StringUtils;
import kr.xit.framework.biz.cmm.CacheCodeUtils;
import kr.xit.framework.biz.cache.util.CacheCodeUtils;
import lombok.Getter;
import lombok.Setter;

@ -12,7 +12,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.util.StringUtils;
import kr.xit.framework.biz.cmm.CacheCodeUtils;
import kr.xit.framework.biz.cache.util.CacheCodeUtils;
import kr.xit.framework.support.util.JBeanRegistry;
import kr.xit.framework.support.util.constants.MessageKey;
import lombok.Getter;

@ -3,7 +3,7 @@ package kr.xit.framework.support.util;
import org.springframework.context.MessageSource;
import org.springframework.context.support.MessageSourceAccessor;
import kr.xit.framework.biz.cmm.service.CacheService;
import kr.xit.framework.biz.cache.service.CacheService;
import kr.xit.framework.core.message.XitMessageSource;
import kr.xit.framework.core.validation.XitBeanValidator;

@ -0,0 +1,141 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.cache.mapper">
<resultMap id="findListResultMap" type="kr.xit.framework.biz.mng.bbs.model.XitBasicBbsMngVO">
<result column="nttSj" property="nttSj" />
<result column="ntcrId" property="ntcrId" />
<result column="ntcrNm" property="ntcrNm" />
<result column="nttNo" property="nttNo" />
<result column="nttCn" property="nttCn" />
<result column="password" property="password" />
<result column="frstRegisterId" property="frstRegisterId" />
<result column="frstRegisterNm" property="frstRegisterNm" />
<result column="frstRegisterPnttm" property="frstRegisterPnttm" />
<result column="ntceBgnde" property="ntceBgnde" />
<result column="ntceEndde" property="ntceEndde" />
<result column="inqireCo" property="inqireCo" />
<result column="useAt" property="useAt" />
<result column="atchFileId" property="atchFileId" />
<result column="bbsId" property="bbsId" />
<result column="nttId" property="nttId" />
<result column="parnts" property="parnts" />
<result column="replyAt" property="replyAt" />
<result column="replyLc" property="replyLc" />
<result column="sortOrdr" property="sortOrdr" />
<result column="bbsTyCode" property="bbsTyCode" />
<result column="bbsAttrbCode" property="bbsAttrbCode" />
<result column="replyPosblAt" property="replyPosblAt" />
<result column="fileAtchPosblAt" property="fileAtchPosblAt" />
<result column="posblAtchFileNumber" property="posblAtchFileNumber" />
<result column="bbsNm" property="bbsNm" />
<collection column="{bbsId=bbsId, nttId=nttId}" property="_children" select="findListChildren" javaType="java.util.List" />
</resultMap>
<select id="selectLatestBbsList" resultType="kr.xit.framework.biz.cmm.model.XitBbsVO">
/* cacheboard-mysql-mapper|selectLatestBbsList-게시판 최신 게시글 목록 조회|julim */
SELECT bbs_id
, ntt_id
, ntt_no
, ntt_sj
, ntt_cn
, answer_at
, parnts_sntnc_no
, answer_lc
, sort_ordr
, rdcnt
, use_at
, ntce_begin_de
, ntce_end_de
, ntcr_id
, ntcr_nm
, password
, atch_file_id
, frst_regist_pnttm
, frst_register_id
, last_updt_pnttm
, last_updusr_id
FROM xit_bbs
<where>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(bbsId)">
AND BBS_ID = #{bbsId}
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(parntsSntncNo)">
AND PARNTS_SNTNC_NO = #{parntsSntncNo}
</if>
<if test="@kr.xit.framework.core.utils.XitCmmnUtil@notEmpty(useAt)">
AND USE_AT = #{useAt}
</if>
</where>
ORDER BY frst_regist_pnttm DESC
</select>
<select id="selectBaseBbsList" resultMap="findListResultMap">
/* cacheboard-mysql-mapper|selectBaseBbsList-기본(공용)게시판 목록 조회|julim */
<include refid="sqlBbs"/>
<choose>
<when test="'0'.toString() == searchCnd">
AND INSTR(XB.ntt_sj, #{searchWrd}) > 0
</when>
<when test="'1'.toString() == searchCnd">
AND INSTR(XB.ntt_cn, #{searchWrd}) > 0
</when>
<when test="'2'.toString() == searchCnd">
AND INSTR(XB.user_nm, #{searchWrd}) > 0
</when>
</choose>
ORDER BY XB.frst_regist_pnttm DESC limit 100000
</select>
<select id="selectBaseChildList" resultMap="findListResultMap">
/* cacheboard-mysql-mapper|selectBaseChildListt-기본(공용)게시판 자식 목록 조회|julim */
<include refid="sqlBbs"/>
ORDER BY XB.frst_regist_pnttm ASC
</select>
<sql id="sqlBbs">
SELECT XB.ntt_sj
, XB.ntcr_id
, XB.ntcr_nm
, XB.ntt_no
, XB.ntt_cn
, XB.password
, XB.frst_register_id
, IFNULL(VUM.user_nm, XB.ntcr_nm) AS frstRegisterNm
, DATE_FORMAT(XB.frst_regist_pnttm, '%Y-%m-%d') AS frstRegisterPnttm
, XB.ntce_begin_de
, XB.ntce_end_de
, XB.rdcnt AS inqireCo
, XB.use_at
, XB.atch_file_id
, XB.bbs_id
, XB.ntt_id
, XB.parnts_sntnc_no AS parnts
, XB.answer_at
, XB.answer_lc
, XB.sort_ordr
, XBM.bbs_ty_code
, XBM.bbs_attrb_code
, XBM.reply_posbl_at
, XBM.file_atch_posbl_at
, XBM.atch_posbl_file_number
, XBM.BBS_NM
FROM xit_bbs xb
LEFT OUTER JOIN xit_vw_user_mastr VUM
ON XB.frst_register_id = VUM.esntl_id
LEFT OUTER JOIN xit_bbs_mastr XBM
ON XB.bbs_id = XBM.bbs_id
WHERE XB.BBS_ID = #{bbsId}
<choose>
<when test='nttId != null and nttId != ""'>
AND XB.parnts_sntnc_no = #{nttId}
AND XB.parnts_sntnc_no != 0
</when>
<otherwise>
AND XB.parnts_sntnc_no = 0
</otherwise>
</choose>
</sql>
</mapper>

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.cmm.mapper.CacheCodeMapper">
<mapper namespace="kr.xit.framework.biz.cache.mapper.CacheCodeMapper">
<select id="selectCodes" parameterType="string" resultType="caseMap">
/* cachecode-mysql-mapper|selectCodes-공통코드 코드그룹 조회|julim */

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="kr.xit.framework.biz.cmm.mapper.CacheMenuMapper">
<mapper namespace="kr.xit.framework.biz.cache.mapper.CacheMenuMapper">
<select id="selectMenuListByUser" parameterType="string" resultType="java.util.Map">
/* cachemenu-mysql-mapper|selectMenuListByUser-사용자별 메뉴 조회|julim */
<include refid="sql_tree"/>
<include refid="sqlTree"/>
SELECT D.menu_id AS "menuSid"
, D.menu_name AS "menuName"
, (SELECT CASE SA.URL WHEN '/' THEN '#' ELSE SA.URL END
@ -35,7 +35,7 @@
<select id="selectMenuListByAuthorCode" parameterType="string" resultType="java.util.Map">
/* cachemenu-mysql-mapper|selectMenuListByAuthorCode-권한별 메뉴 조회|julim */
<include refid="sql_tree"/>
<include refid="sqlTree"/>
SELECT D.menu_id AS "menuSid"
, D.menu_name AS "menuName"
, (
@ -56,10 +56,10 @@
JOIN tree_query D
ON B.menu_no = D.menu_id
WHERE A.AUTHOR_CODE = #{authorCode}
ORDER BY D.parnt_menu_id, B.menu_ordr
ORDER BY D.parnt_menu_id, B.menu_ordr
</select>
<sql id="sql_tree">
<sql id="sqlTree">
WITH RECURSIVE tree_query(
menu_id
, PARNT_menu_id
Loading…
Cancel
Save