All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.foxinmy.weixin4j.token.PerTicketManager Maven / Gradle / Ivy

There is a newer version: 1.10.2
Show newest version
package com.foxinmy.weixin4j.token;

import com.foxinmy.weixin4j.cache.CacheStorager;
import com.foxinmy.weixin4j.model.Token;

/**
 * 第三方应用永久授权码的存取
 *
 * @className PerTicketManager
 * @author jinyu([email protected])
 * @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 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;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy