feat: cache(CaffeineCache) API 적용
parent
dccf7a2fb7
commit
cf963cd135
@ -0,0 +1,16 @@
|
||||
package kr.xit.core.spring.config;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import org.springframework.cache.interceptor.KeyGenerator;
|
||||
import org.springframework.cache.interceptor.SimpleKeyGenerator;
|
||||
|
||||
public class CacheKeyGenerator implements KeyGenerator {
|
||||
|
||||
@Override
|
||||
public Object generate(Object target, Method method, Object... params) {
|
||||
StringBuilder keyBuilder = new StringBuilder();
|
||||
keyBuilder.append(method.getName());
|
||||
keyBuilder.append(SimpleKeyGenerator.generateKey(params));
|
||||
return keyBuilder.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package kr.xit.core.spring.config;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum CacheType {
|
||||
|
||||
NICE_CRTF("niceCrtfInfo", 60 * 60 * 24, 1),
|
||||
;
|
||||
|
||||
/**
|
||||
* 캐시 이름
|
||||
*/
|
||||
private final String cacheName;
|
||||
|
||||
/**
|
||||
* 만료시간
|
||||
*/
|
||||
private final int expireAfterWrite;
|
||||
/**
|
||||
* 최대갯수
|
||||
*/
|
||||
private final int maximumSize;
|
||||
}
|
@ -0,0 +1,42 @@
|
||||
<?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.ens.support.cmm.mapper.ICmmEnsMapper">
|
||||
|
||||
<select id="selectNiceCrtfInfo" resultType="kr.xit.biz.ens.model.nice.NiceCiDTO$CrtfInfo">
|
||||
/** ens-cmm-mysql-mapper|selectNiceCrtfInfo-Nice인증정보조회|julim */
|
||||
SELECT signgu_code,
|
||||
ffnlg_code,
|
||||
client_id,
|
||||
client_secret,
|
||||
product_id,
|
||||
access_token,
|
||||
expires_in,
|
||||
token_type,
|
||||
scope,
|
||||
site_code,
|
||||
key_version,
|
||||
public_key,
|
||||
valid_dtim,
|
||||
timestampdiff(DAY, '20230911235959', now()) AS remainingDays /* 잔여일수-공용키 */
|
||||
FROM tb_cmm_nice_instn_crtf_info
|
||||
WHERE signgu_code = #{signguCode}
|
||||
AND ffnlg_code = #{ffnlgCode}
|
||||
AND client_id = #{clientId}
|
||||
</select>
|
||||
|
||||
<update id="updateNiceCrtfPublickey">
|
||||
/** ens-cmm-mysql-mapper|updateNiceCrtfPublickey-Nice publickey 인증정보 갱신|julim */
|
||||
UPDATE tb_cmm_nice_instn_crtf_info
|
||||
SET site_code = #{siteCode},
|
||||
key_version = #{keyVersion},
|
||||
public_key = #{publicKey},
|
||||
valid_dtim = #{validDtim},
|
||||
updt_dt = now(),
|
||||
updusr = #{updusr}
|
||||
WHERE signgu_code = #{signguCode}
|
||||
AND ffnlg_code = #{ffnlgCode}
|
||||
AND client_id = #{clientId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
@ -1,26 +1,26 @@
|
||||
<?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">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
|
||||
<mapper namespace="kr.xit.core.biz.mapper.IAuthApiMapper">
|
||||
<!-- 일반 로그인 -->
|
||||
<select id="actionLogin" resultType="egovframework.com.cmm.LoginVO">
|
||||
<if test="userSe = 'USR'">
|
||||
/** auth-mysql-mapper|actionLogin-로그인|julim */
|
||||
SELECT user_id AS id
|
||||
, user_nm AS name
|
||||
, password
|
||||
, ihidnum
|
||||
, email_adres AS email
|
||||
, 'USR' AS userSe
|
||||
, orgnzt_id
|
||||
, esntl_id
|
||||
FROM xit_user_info
|
||||
WHERE user_id = #{id}
|
||||
AND password = #{password}
|
||||
AND user_sttus_code = 'P'
|
||||
|
||||
</if>
|
||||
</select>
|
||||
<!-- 일반 로그인 -->
|
||||
<select id="actionLogin" resultType="egovframework.com.cmm.LoginVO">
|
||||
<if test="userSe = 'USR'">
|
||||
/** auth-mysql-mapper|actionLogin-로그인|julim */
|
||||
SELECT user_id AS id
|
||||
, user_nm AS name
|
||||
, password
|
||||
, ihidnum
|
||||
, email_adres AS email
|
||||
, 'USR' AS userSe
|
||||
, orgnzt_id
|
||||
, esntl_id
|
||||
FROM xit_user_info
|
||||
WHERE user_id = #{id}
|
||||
AND password = #{password}
|
||||
AND user_sttus_code = 'P'
|
||||
|
||||
</if>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
Loading…
Reference in New Issue