重构Weixin4jSettings...
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.foxinmy.weixin4j.qy;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.util.List;
|
||||
|
||||
@@ -48,11 +47,11 @@ import com.foxinmy.weixin4j.qy.type.ChatType;
|
||||
import com.foxinmy.weixin4j.qy.type.InviteType;
|
||||
import com.foxinmy.weixin4j.qy.type.KfType;
|
||||
import com.foxinmy.weixin4j.qy.type.UserStatus;
|
||||
import com.foxinmy.weixin4j.settings.Weixin4jSettings;
|
||||
import com.foxinmy.weixin4j.token.TokenHolder;
|
||||
import com.foxinmy.weixin4j.tuple.MpArticle;
|
||||
import com.foxinmy.weixin4j.type.MediaType;
|
||||
import com.foxinmy.weixin4j.type.TicketType;
|
||||
import com.foxinmy.weixin4j.util.Weixin4jSettings;
|
||||
|
||||
/**
|
||||
* 微信企业号接口实现
|
||||
@@ -90,13 +89,13 @@ public class WeixinProxy {
|
||||
/**
|
||||
*
|
||||
* @param settings
|
||||
* 配置信息
|
||||
* @see com.foxinmy.weixin4j.settings.Weixin4jSettings
|
||||
* 微信配置信息
|
||||
* @see com.foxinmy.weixin4j.util.Weixin4jSettings
|
||||
*/
|
||||
public WeixinProxy(Weixin4jSettings settings) {
|
||||
this(new TokenHolder(new WeixinTokenCreator(settings.getAccount()
|
||||
.getId(), settings.getAccount().getSecret()),
|
||||
settings.getTokenStorager()));
|
||||
this(new TokenHolder(new WeixinTokenCreator(settings.getWeixinAccount()
|
||||
.getId(), settings.getWeixinAccount().getSecret()),
|
||||
settings.getTokenStorager0()));
|
||||
this.settings = settings;
|
||||
}
|
||||
|
||||
@@ -116,8 +115,8 @@ public class WeixinProxy {
|
||||
TokenHolder suiteTokenHolder) {
|
||||
this(new TokenHolder(new WeixinTokenSuiteCreator(perCodeHolder,
|
||||
suiteTokenHolder), suiteTokenHolder.getTokenStorager()));
|
||||
this.settings = new Weixin4jSettings(perCodeHolder.getAuthCorpId(),
|
||||
null);
|
||||
this.settings = new Weixin4jSettings(new WeixinAccount(
|
||||
perCodeHolder.getAuthCorpId(), null));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -156,7 +155,7 @@ public class WeixinProxy {
|
||||
* @return
|
||||
*/
|
||||
public WeixinAccount getWeixinAccount() {
|
||||
return this.settings.getAccount();
|
||||
return this.settings.getWeixinAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,25 +344,6 @@ public class WeixinProxy {
|
||||
return mediaApi.uploadMedia(agentid, is, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载媒体文件
|
||||
*
|
||||
* @param agentid
|
||||
* 企业应用Id(<font color="red">大于0时视为获取永久媒体文件</font>)
|
||||
* @param mediaId
|
||||
* 存储在微信服务器上的媒体标识
|
||||
* @return 写入硬盘后的文件对象
|
||||
* @throws WeixinException
|
||||
* @see com.foxinmy.weixin4j.qy.api.MediaApi
|
||||
* @see com.foxinmy.weixin4j.type.MediaType
|
||||
* @see {@link #downloadMedia(int,String)}
|
||||
*/
|
||||
public File downloadMediaFile(int agentid, String mediaId)
|
||||
throws WeixinException {
|
||||
return mediaApi.downloadMediaFile(agentid, mediaId,
|
||||
settings.getMediaPath());
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载媒体文件
|
||||
*
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.foxinmy.weixin4j.qy;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
||||
import com.foxinmy.weixin4j.qy.api.ProviderApi;
|
||||
@@ -11,14 +10,11 @@ import com.foxinmy.weixin4j.qy.api.SuiteApi;
|
||||
import com.foxinmy.weixin4j.qy.model.OUserInfo;
|
||||
import com.foxinmy.weixin4j.qy.model.WeixinQyAccount;
|
||||
import com.foxinmy.weixin4j.qy.suite.SuiteTicketHolder;
|
||||
import com.foxinmy.weixin4j.qy.suite.Weixin4jSuiteSettings;
|
||||
import com.foxinmy.weixin4j.qy.token.WeixinProviderTokenCreator;
|
||||
import com.foxinmy.weixin4j.qy.type.LoginTargetType;
|
||||
import com.foxinmy.weixin4j.settings.Weixin4jSettings;
|
||||
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
||||
import com.foxinmy.weixin4j.token.TokenHolder;
|
||||
import com.foxinmy.weixin4j.token.TokenStorager;
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
|
||||
/**
|
||||
* 微信第三方应用接口实现
|
||||
@@ -36,72 +32,52 @@ public class WeixinSuiteProxy {
|
||||
private Map<String, SuiteApi> suiteMap;
|
||||
private ProviderApi providerApi;
|
||||
|
||||
private final Weixin4jSuiteSettings suiteSettings;
|
||||
|
||||
public WeixinSuiteProxy() {
|
||||
this(Weixin4jSettings.DEFAULT_TOKEN_PATH);
|
||||
this(new Weixin4jSuiteSettings());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tokenPath
|
||||
* 使用文件存储token的保存路径
|
||||
* @param suiteSettings
|
||||
* 套件信息配置
|
||||
*/
|
||||
public WeixinSuiteProxy(String tokenPath) {
|
||||
this(new FileTokenStorager(tokenPath));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tokenStorager
|
||||
* token存储
|
||||
*/
|
||||
public WeixinSuiteProxy(TokenStorager tokenStorager) {
|
||||
this(tokenStorager, JSON.parseObject(
|
||||
Weixin4jConfigUtil.getValue("account"), WeixinQyAccount.class));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tokenStorager
|
||||
* token存储
|
||||
* @param suites
|
||||
* 套件信息 必填项
|
||||
*/
|
||||
public WeixinSuiteProxy(TokenStorager tokenStorager,
|
||||
WeixinQyAccount weixinAccount) {
|
||||
this(tokenStorager, weixinAccount.getId(), weixinAccount
|
||||
.getProviderSecret(), weixinAccount.suitesToArray());
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param tokenStorager
|
||||
* token存储
|
||||
* @param providerCorpId
|
||||
* 服务商的企业号ID <font color="red">使用服务商API时必填项</font>
|
||||
* @param providerSecret
|
||||
* 服务商secret <font color="red">使用服务商API时必填项</font>
|
||||
* @param suites
|
||||
* 套件信息 <font color="red">使用套件API时必填项</font>
|
||||
*/
|
||||
public WeixinSuiteProxy(TokenStorager tokenStorager, String providerCorpId,
|
||||
String providerSecret, WeixinAccount... suites) {
|
||||
if (suites != null) {
|
||||
public WeixinSuiteProxy(Weixin4jSuiteSettings suiteSettings) {
|
||||
this.suiteSettings = suiteSettings;
|
||||
if (suiteSettings.getWeixinAccount().getSuiteAccounts() != null) {
|
||||
this.suiteMap = new HashMap<String, SuiteApi>();
|
||||
for (WeixinAccount suite : suites) {
|
||||
for (WeixinAccount suite : suiteSettings.getWeixinAccount()
|
||||
.getSuiteAccounts()) {
|
||||
this.suiteMap.put(suite.getId(), new SuiteApi(
|
||||
new SuiteTicketHolder(suite.getId(), suite.getSecret(),
|
||||
tokenStorager)));
|
||||
this.suiteMap.put(null, suiteMap.get(suites[0].getId()));
|
||||
suiteSettings.getTokenStorager0())));
|
||||
this.suiteMap.put(
|
||||
null,
|
||||
suiteMap.get(suiteSettings.getWeixinAccount()
|
||||
.getSuiteAccounts().get(0).getId()));
|
||||
}
|
||||
}
|
||||
if (StringUtil.isNotBlank(providerCorpId)
|
||||
&& StringUtil.isNotBlank(providerSecret)) {
|
||||
if (StringUtil.isNotBlank(suiteSettings.getWeixinAccount().getId())
|
||||
&& StringUtil.isNotBlank(suiteSettings.getWeixinAccount()
|
||||
.getProviderSecret())) {
|
||||
this.providerApi = new ProviderApi(new TokenHolder(
|
||||
new WeixinProviderTokenCreator(providerCorpId,
|
||||
providerSecret), tokenStorager));
|
||||
new WeixinProviderTokenCreator(suiteSettings
|
||||
.getWeixinAccount().getId(), suiteSettings
|
||||
.getWeixinAccount().getProviderSecret()),
|
||||
suiteSettings.getTokenStorager0()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 企业号信息
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public WeixinQyAccount getWeixinAccount() {
|
||||
return this.suiteSettings.getWeixinAccount();
|
||||
}
|
||||
|
||||
/**
|
||||
* 只关注第一个套件获取API(如果只有一个套件
|
||||
*
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
package com.foxinmy.weixin4j.qy.api;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.FilenameFilter;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
@@ -190,57 +186,6 @@ public class MediaApi extends QyApi {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载媒体文件
|
||||
*
|
||||
* @param agentid
|
||||
* 企业应用Id(<font color="red">大于0时视为获取永久媒体文件</font>)
|
||||
* @param mediaId
|
||||
* 存储在微信服务器上的媒体标识
|
||||
* @param mediaPath
|
||||
* 媒体素材保存路径
|
||||
* @return 写入硬盘后的文件对象
|
||||
* @throws WeixinException
|
||||
* @see com.foxinmy.weixin4j.type.MediaType
|
||||
* @see {@link #downloadMedia(int,String)}
|
||||
*/
|
||||
public File downloadMediaFile(int agentid, String mediaId, String mediaPath)
|
||||
throws WeixinException {
|
||||
final String prefixName = String.format("%d_%s.", agentid, mediaId);
|
||||
File[] files = new File(mediaPath).listFiles(new FilenameFilter() {
|
||||
@Override
|
||||
public boolean accept(File dir, String name) {
|
||||
return name.startsWith(prefixName);
|
||||
}
|
||||
});
|
||||
if (files.length > 0) {
|
||||
return files[0];
|
||||
}
|
||||
MediaDownloadResult result = downloadMedia(agentid, mediaId);
|
||||
File file = new File(mediaPath + File.separator + result.getFileName());
|
||||
OutputStream os = null;
|
||||
try {
|
||||
if (file.createNewFile()) {
|
||||
os = new FileOutputStream(file);
|
||||
os.write(result.getContent());
|
||||
} else {
|
||||
throw new WeixinException(String.format("create file fail:%s",
|
||||
file.getAbsolutePath()));
|
||||
}
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException(e);
|
||||
} finally {
|
||||
try {
|
||||
if (os != null) {
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
;
|
||||
}
|
||||
}
|
||||
return file;
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载媒体文件
|
||||
*
|
||||
|
||||
@@ -23,7 +23,7 @@ public class WeixinQyAccount extends WeixinAccount {
|
||||
/**
|
||||
* 多个应用套件信息
|
||||
*/
|
||||
private List<WeixinAccount> suites;
|
||||
private List<WeixinAccount> suiteAccounts;
|
||||
/**
|
||||
* 第三方提供商secret(企业号登陆)
|
||||
*/
|
||||
@@ -36,32 +36,30 @@ public class WeixinQyAccount extends WeixinAccount {
|
||||
/**
|
||||
*
|
||||
* @param corpid
|
||||
* 企业ID
|
||||
* 企业ID 必填
|
||||
* @param corpsecret
|
||||
* 管理组的凭证密钥
|
||||
* @param suiteId
|
||||
* 应用套件的id
|
||||
* @param suiteSecret
|
||||
* 应用套件的secret
|
||||
* 管理组的凭证密钥 使用普通接口(WeixinProxy对象)必须填写
|
||||
* @param suites
|
||||
* 应用套件集合 使用套件接口(WeixinSuiteProxy#SuiteApi)必须填写
|
||||
* @param providerSecret
|
||||
* 第三方提供商secret(企业号登陆)
|
||||
* 第三方提供商secret(企业号登陆) 使用服务商接口(WeixinSuiteProxy#ProviderApi)必填项
|
||||
* @param chatSecret
|
||||
* 消息服务secret(企业号聊天)
|
||||
* 消息服务secret(企业号聊天) 暂无用途
|
||||
*/
|
||||
@JSONCreator
|
||||
public WeixinQyAccount(@JSONField(name = "id") String corpid,
|
||||
@JSONField(name = "secret") String corpsecret,
|
||||
@JSONField(name = "suites") List<WeixinAccount> suites,
|
||||
@JSONField(name = "suites") List<WeixinAccount> suiteAccounts,
|
||||
@JSONField(name = "providerSecret") String providerSecret,
|
||||
@JSONField(name = "chatSecret") String chatSecret) {
|
||||
super(corpid, corpsecret);
|
||||
this.suites = suites;
|
||||
this.suiteAccounts = suiteAccounts;
|
||||
this.providerSecret = providerSecret;
|
||||
this.chatSecret = chatSecret;
|
||||
}
|
||||
|
||||
public List<WeixinAccount> getSuites() {
|
||||
return suites;
|
||||
public List<WeixinAccount> getSuiteAccounts() {
|
||||
return suiteAccounts;
|
||||
}
|
||||
|
||||
public String getProviderSecret() {
|
||||
@@ -72,15 +70,15 @@ public class WeixinQyAccount extends WeixinAccount {
|
||||
return chatSecret;
|
||||
}
|
||||
|
||||
public WeixinAccount[] suitesToArray() {
|
||||
return suites != null ? suites
|
||||
.toArray(new WeixinAccount[suites.size()]) : null;
|
||||
public WeixinAccount[] suiteAccountsToArray() {
|
||||
return suiteAccounts != null ? suiteAccounts
|
||||
.toArray(new WeixinAccount[suiteAccounts.size()]) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WeixinQyAccount [" + super.toString() + ", suites=" + suites
|
||||
+ ", providerSecret=" + providerSecret + ", chatSecret="
|
||||
+ chatSecret + "]";
|
||||
return "WeixinQyAccount [" + super.toString() + ", suiteAccounts="
|
||||
+ suiteAccounts + ", providerSecret=" + providerSecret
|
||||
+ ", chatSecret=" + chatSecret + "]";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.foxinmy.weixin4j.qy.suite;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.foxinmy.weixin4j.http.HttpParams;
|
||||
import com.foxinmy.weixin4j.model.WeixinAccount;
|
||||
import com.foxinmy.weixin4j.qy.model.WeixinQyAccount;
|
||||
import com.foxinmy.weixin4j.token.FileTokenStorager;
|
||||
import com.foxinmy.weixin4j.token.TokenStorager;
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
|
||||
/**
|
||||
* 微信第三方套件配置相关
|
||||
*
|
||||
* @className Weixin4jSuiteSettings
|
||||
* @author jy
|
||||
* @date 2016年1月28日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
*/
|
||||
public class Weixin4jSuiteSettings {
|
||||
/**
|
||||
* 微信企业号信息
|
||||
*/
|
||||
private final WeixinQyAccount weixinAccount;
|
||||
/**
|
||||
* Http参数
|
||||
*/
|
||||
private HttpParams httpParams;
|
||||
/**
|
||||
* token存储方式 默认为FileTokenStorager
|
||||
*/
|
||||
private TokenStorager tokenStorager;
|
||||
/**
|
||||
* 系统临时目录
|
||||
*/
|
||||
private String tmpdir;
|
||||
|
||||
/**
|
||||
* 默认使用weixin4j.properties配置的信息
|
||||
*/
|
||||
public Weixin4jSuiteSettings() {
|
||||
this(JSON.parseObject(Weixin4jConfigUtil.getValue("account"),
|
||||
WeixinQyAccount.class));
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param providerCorpId
|
||||
* 服务商的企业号ID <font color="red">使用服务商API时必填项</font>
|
||||
* @param providerSecret
|
||||
* 服务商secret <font color="red">使用服务商API时必填项</font>
|
||||
* @param suites
|
||||
* 套件信息 <font color="red">使用套件API时必填项</font>
|
||||
*/
|
||||
public Weixin4jSuiteSettings(String providerCorpId, String providerSecret,
|
||||
WeixinAccount... suites) {
|
||||
this.weixinAccount = new WeixinQyAccount(providerCorpId, null,
|
||||
Arrays.asList(suites), providerSecret, null);
|
||||
}
|
||||
|
||||
private Weixin4jSuiteSettings(WeixinQyAccount weixinAccount) {
|
||||
this.weixinAccount = weixinAccount;
|
||||
}
|
||||
|
||||
public WeixinQyAccount getWeixinAccount() {
|
||||
return weixinAccount;
|
||||
}
|
||||
|
||||
public HttpParams getHttpParams() {
|
||||
return httpParams;
|
||||
}
|
||||
|
||||
public HttpParams getHttpParams0() {
|
||||
if (httpParams == null) {
|
||||
return new HttpParams();
|
||||
}
|
||||
return httpParams;
|
||||
}
|
||||
|
||||
public String getTmpdir() {
|
||||
return tmpdir;
|
||||
}
|
||||
|
||||
public String getTmpdir0() {
|
||||
if (StringUtil.isBlank(tmpdir)) {
|
||||
return Weixin4jConfigUtil.getClassPathValue("weixin4j.tmpdir",
|
||||
System.getProperty("java.io.tmpdir"));
|
||||
}
|
||||
return tmpdir;
|
||||
}
|
||||
|
||||
public TokenStorager getTokenStorager() {
|
||||
return tokenStorager;
|
||||
}
|
||||
|
||||
public TokenStorager getTokenStorager0() {
|
||||
if (tokenStorager == null) {
|
||||
return new FileTokenStorager(getTmpdir0());
|
||||
}
|
||||
return tokenStorager;
|
||||
}
|
||||
|
||||
public void setHttpParams(HttpParams httpParams) {
|
||||
this.httpParams = httpParams;
|
||||
}
|
||||
|
||||
public void setTmpdir(String tmpdir) {
|
||||
this.tmpdir = tmpdir;
|
||||
}
|
||||
|
||||
public void setTokenStorager(TokenStorager tokenStorager) {
|
||||
this.tokenStorager = tokenStorager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Weixin4jSuiteSettings [weixinAccount=" + weixinAccount
|
||||
+ ", httpParams=" + httpParams + ",tokenStorager="
|
||||
+ tokenStorager + ", tmpdir=" + tmpdir + "]";
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class WeixinSuitePreCodeCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_suite_precode_%s", suiteId);
|
||||
return String.format("weixin4j_qy_suite_precode_%s", suiteId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ public class WeixinSuiteTokenCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_suite_token_%s", ticketHolder.getSuiteId());
|
||||
return String.format("weixin4j_qy_suite_token_%s", ticketHolder.getSuiteId());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ public class WeixinTokenSuiteCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_token_suite_%s:%s",
|
||||
return String.format("weixin4j_qy_token_suite_%s:%s",
|
||||
perCodeHolder.getSuiteId(), perCodeHolder.getAuthCorpId()
|
||||
|
||||
);
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ public class WeixinProviderTokenCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_provider_token_%s", corpid);
|
||||
return String.format("weixin4j_qy_provider_token_%s", corpid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WeixinTicketCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_ticket_%s_%s", corpid, ticketType.name());
|
||||
return String.format("weixin4j_qy_ticket_%s_%s", corpid, ticketType.name());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,7 +40,7 @@ public class WeixinTokenCreator implements TokenCreator {
|
||||
|
||||
@Override
|
||||
public String getCacheKey() {
|
||||
return String.format("wx_qy_token_%s", corpid);
|
||||
return String.format("weixin4j_qy_token_%s", corpid);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# \u6d4b\u8bd5\u4e4b\u7528 \u6b63\u5f0f\u73af\u5883\u4e0bcopy\u4e00\u4efd\u5230classpath
|
||||
# \u4f01\u4e1a\u53f7\u4fe1\u606f
|
||||
|
||||
# \u4f01\u4e1a\u53f7\u4fe1\u606f \u8bf7\u6309\u9700\u586b\u5199
|
||||
weixin4j.account={"id":"wx5132afc5da26d661","secret":"GsnKLVDI1pWArdB60Ze4iP2cwFvcW5KCAs2vLJldipilmSYxtbkcAiBcGSHHvu_I",\
|
||||
"suites":[{"id":"\u5e94\u7528\u5957\u4ef6\u7684id","secret":"\u5e94\u7528\u5957\u4ef6\u7684secret"}],\
|
||||
"providerSecret":"\u7b2c\u4e09\u65b9\u63d0\u4f9b\u5546secret(\u4f01\u4e1a\u53f7\u767b\u9646)",\
|
||||
@@ -8,16 +9,15 @@ weixin4j.account={"id":"wx5132afc5da26d661","secret":"GsnKLVDI1pWArdB60Ze4iP2cwF
|
||||
"certificateKey":"\u52a0\u8f7d\u652f\u4ed8\u8bc1\u4e66\u6587\u4ef6\u7684\u5bc6\u7801 \u5982\u679c\u4e0d\u586b\u5199\u5219\u9ed8\u8ba4\u83b7\u53d6mchId\u4f5c\u4e3a\u5bc6\u7801",\
|
||||
"paySignKey":"\u5fae\u4fe1\u652f\u4ed8\u4e2d\u8c03\u7528API\u7684\u5bc6\u94a5 \u5fae\u4fe1\u652f\u4ed8\u65f6\u9700\u8981\u586b\u5165"}
|
||||
|
||||
# \u4f7f\u7528FileTokenStorager\u65f6token\u7684\u5b58\u653e\u8def\u5f84(\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u4e3aWeixin4jConst#DEFAULT_TOKEN_PATH)
|
||||
weixin4j.token.path=/tmp/weixin4j/token
|
||||
# \u5a92\u4f53\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84(\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u4e3aWeixin4jConst#DEFAULT_MEDIA_PATH)
|
||||
weixin4j.media.path=/tmp/weixin4j/media
|
||||
# \u5bf9\u8d26\u5355\u4fdd\u5b58\u8def\u5f84(\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u4e3aWeixin4jConst#DEFAULT_BILL_PATH)
|
||||
weixin4j.bill.path=/tmp/weixin4j/bill
|
||||
# ca\u8bc1\u4e66\u5b58\u653e\u7684\u5b8c\u6574\u8def\u5f84 (V2\u7248\u672c\u540e\u7f00\u4e3a*.pfx,V3\u7248\u672c\u540e\u7f00\u4e3a*.p12)
|
||||
# weixin4j\u7684\u4e34\u65f6\u76ee\u5f55
|
||||
# \u53ef\u80fd\u5b58\u653etoken\u6587\u4ef6\u3001\u4e8c\u7ef4\u7801\u6587\u4ef6\u3001\u5a92\u4f53\u6587\u4ef6\u3001\u5bf9\u8d26\u5355\u6587\u4ef6\u7b49
|
||||
# \u4e3a\u7a7a\u65f6\u5219\u83b7\u53d6java.io.tmpdir\u4e34\u65f6\u76ee\u5f55
|
||||
weixin4j.tmpdir=
|
||||
# \u5fae\u4fe1\u652f\u4ed8\u67d0\u4e9b\u63a5\u53e3\u9700\u8981\u7684ca\u8bc1\u4e66\u5b58\u653e\u7684\u5b8c\u6574\u8def\u5f84
|
||||
# classpath\u8def\u5f84\u4e0b\u53ef\u4ee5\u8fd9\u4e48\u5199
|
||||
# weixin4j.certificate.file=classpath:xxxxx.p12
|
||||
# \u4e3a\u7a7a\u65f6\u5219\u83b7\u53d6classpath\u6839\u76ee\u5f55\u4e0b\u7684ca.p12\u6587\u4ef6
|
||||
weixin4j.certificate.file=/tmp/weixin4j/xxxxx.p12
|
||||
# classpath\u8def\u5f84\u4e0b\u53ef\u4ee5\u8fd9\u4e48\u5199(\u5982\u679c\u4e0d\u586b\u5219\u9ed8\u8ba4\u4e3aWeixin4jConst#DEFAULT_CAFILE_PATH)
|
||||
# weixin4j.certificate.file=classpath:xxxxx.pfx
|
||||
|
||||
# \u4f01\u4e1a\u53f7\u7528\u6237\u8eab\u4efd\u6388\u6743\u540e\u91cd\u5b9a\u5411\u7684url(\u5728\u4f7f\u7528OauthApi\u65f6\u586b\u5199)
|
||||
weixin4j.user.oauth.redirect.uri=
|
||||
|
||||
Reference in New Issue
Block a user