新增第三方组件ComponentApi
This commit is contained in:
parent
ff349fd370
commit
73125123cb
@ -0,0 +1,38 @@
|
||||
package com.foxinmy.weixin4j.token;
|
||||
|
||||
import com.foxinmy.weixin4j.cache.CacheStorager;
|
||||
import com.foxinmy.weixin4j.model.Token;
|
||||
|
||||
/**
|
||||
* 第三方应用组件永久授权码的存取
|
||||
*
|
||||
* @className PerTicketManager
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2015年6月22日
|
||||
* @since JDK 1.6
|
||||
*/
|
||||
public class PerTicketManager extends TicketManager {
|
||||
|
||||
private final String authAppId;
|
||||
|
||||
public PerTicketManager(String authAppId, String thirdId,
|
||||
String thirdSecret, CacheStorager<Token> cacheStorager) {
|
||||
super(thirdId, thirdSecret, cacheStorager);
|
||||
this.authAppId = authAppId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取永久授权码的key
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("%sthird_party_percode_ticket_%s_%s",
|
||||
TokenCreator.CACHEKEY_PREFIX, getThirdId(), authAppId);
|
||||
}
|
||||
|
||||
public String getAuthAppId() {
|
||||
return authAppId;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user