package io.jboot.components.cache.support;

import com.jfinal.weixin.sdk.cache.IAccessTokenCache;
import io.jboot.Jboot;

public class JbootAccessTokenCache implements IAccessTokenCache {

    static final String CACHE_NAME = "__jboot_wechat_access_tokens";

    @Override
    public String get(String key) {
        return Jboot.getCache().get(CACHE_NAME, key);
    }

    @Override
    public void set(String key, String value) {
        Jboot.getCache().put(CACHE_NAME, key, value);
    }

    @Override
    public void remove(String key) {
        Jboot.getCache().remove(CACHE_NAME, key);
    }
}

@@ -113,16 +113,60 @@
 t.Jboot;
+%0Aimport io.jboot.components.cache.CacheTime;
 %0A%0Apublic
@@ -465,24 +465,59 @@
 ng value) %7B%0A
+        // %E5%BE%AE%E4%BF%A1%E7%9B%B8%E5%85%B3 token %E7%9A%84%E6%9C%89%E6%95%88%E6%9C%9F%E4%B9%8B%E5%A4%9A 2 %E4%B8%AA%E5%B0%8F%E6%97%B6%0A
         Jboo
@@ -555,16 +555,35 @@
 y, value
+,2 * CacheTime.HOUR
 );%0A    %7D

add cache time for JbootAccessTokenCache