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>
|
Loading…
Reference in New Issue