注意:weixin.properties重命名为weixin4j.properties
This commit is contained in:
parent
2721ae8477
commit
c5163e7eac
@ -322,3 +322,7 @@
|
|||||||
* 2015-06-10
|
* 2015-06-10
|
||||||
|
|
||||||
+ **weixin4j-server**: released 1.0.2
|
+ **weixin4j-server**: released 1.0.2
|
||||||
|
|
||||||
|
* 2015-06-11
|
||||||
|
|
||||||
|
+ weixin.properties重命名为weixin4j.properties
|
||||||
@ -21,7 +21,7 @@ public class ConfigUtil {
|
|||||||
private final static String CLASSPATH_VALUE;
|
private final static String CLASSPATH_VALUE;
|
||||||
private final static ResourceBundle weixinBundle;
|
private final static ResourceBundle weixinBundle;
|
||||||
static {
|
static {
|
||||||
weixinBundle = ResourceBundle.getBundle("weixin");
|
weixinBundle = ResourceBundle.getBundle("weixin4j");
|
||||||
Set<String> keySet = weixinBundle.keySet();
|
Set<String> keySet = weixinBundle.keySet();
|
||||||
File file = null;
|
File file = null;
|
||||||
CLASSPATH_VALUE = Thread.currentThread().getContextClassLoader()
|
CLASSPATH_VALUE = Thread.currentThread().getContextClassLoader()
|
||||||
|
|||||||
@ -48,9 +48,9 @@ weixin4j-mp
|
|||||||
<artifactId>weixin4j-mp</artifactId>
|
<artifactId>weixin4j-mp</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
1.需新增或拷贝`weixin.properties`文件到项目的`classpath`中
|
1.需新增或拷贝`weixin4j.properties`文件到项目的`classpath`中
|
||||||
|
|
||||||
weixin.properties说明
|
weixin4j.properties说明
|
||||||
|
|
||||||
| 属性名 | 说明 |
|
| 属性名 | 说明 |
|
||||||
| :---------- | :-------------- |
|
| :---------- | :-------------- |
|
||||||
@ -73,12 +73,12 @@ weixin.properties说明
|
|||||||
"version":"针对微信支付的版本号(2,3),如果不填则按照mchId非空与否来判断",\
|
"version":"针对微信支付的版本号(2,3),如果不填则按照mchId非空与否来判断",\
|
||||||
"paySignKey":"微信支付中调用API的密钥"}
|
"paySignKey":"微信支付中调用API的密钥"}
|
||||||
|
|
||||||
token_path=/tmp/weixin/token
|
token_path=/tmp/weixin4j/token
|
||||||
qr_path=/tmp/weixin/qr
|
qr_path=/tmp/weixin4j/qr
|
||||||
media_path=/tmp/weixin/media
|
media_path=/tmp/weixin4j/media
|
||||||
bill_path=/tmp/weixin/bill
|
bill_path=/tmp/weixin4j/bill
|
||||||
# ca证书存放的完整路径 (V2版本后缀为*.pfx,V3版本后缀为*.p12)
|
# ca证书存放的完整路径 (V2版本后缀为*.pfx,V3版本后缀为*.p12)
|
||||||
ca_file=/tmp/weixin/xxxxx.p12
|
ca_file=/tmp/weixin4j/xxxxx.p12
|
||||||
#classpath路径下:ca_file=classpath:xxxxx.p12
|
#classpath路径下:ca_file=classpath:xxxxx.p12
|
||||||
|
|
||||||
#微信登陆授权的重定向路径(使用OauthApi时需要填写)
|
#微信登陆授权的重定向路径(使用OauthApi时需要填写)
|
||||||
|
|||||||
@ -10,14 +10,14 @@ account={"id":"wx4ab8f8de58159a57","secret":"1d4eb0f4bf556aaed539f30ed05ca795",\
|
|||||||
"paySignKey":"\u5fae\u4fe1\u652f\u4ed8\u4e2d\u8c03\u7528API\u7684\u5bc6\u94a5 \u670d\u52a1\u53f7\u652f\u4ed8\u65f6\u9700\u8981\u586b\u5165"}
|
"paySignKey":"\u5fae\u4fe1\u652f\u4ed8\u4e2d\u8c03\u7528API\u7684\u5bc6\u94a5 \u670d\u52a1\u53f7\u652f\u4ed8\u65f6\u9700\u8981\u586b\u5165"}
|
||||||
|
|
||||||
# \u4f7f\u7528FileTokenHolder\u65f6token\u7684\u5b58\u653e\u8def\u5f84
|
# \u4f7f\u7528FileTokenHolder\u65f6token\u7684\u5b58\u653e\u8def\u5f84
|
||||||
token_path=/tmp/weixin/token
|
token_path=/tmp/weixin4j/token
|
||||||
# \u4e8c\u7ef4\u7801\u4fdd\u5b58\u8def\u5f84
|
# \u4e8c\u7ef4\u7801\u4fdd\u5b58\u8def\u5f84
|
||||||
qr_path=/tmp/weixin/qr
|
qr_path=/tmp/weixin4j/qrcode
|
||||||
# \u5a92\u4f53\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84
|
# \u5a92\u4f53\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84
|
||||||
media_path=/tmp/weixin/media
|
media_path=/tmp/weixin4j/media
|
||||||
# \u5bf9\u8d26\u5355\u4fdd\u5b58\u8def\u5f84
|
# \u5bf9\u8d26\u5355\u4fdd\u5b58\u8def\u5f84
|
||||||
bill_path=/tmp/weixin/bill
|
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)
|
# ca\u8bc1\u4e66\u5b58\u653e\u7684\u5b8c\u6574\u8def\u5f84 (V2\u7248\u672c\u540e\u7f00\u4e3a*.pfx,V3\u7248\u672c\u540e\u7f00\u4e3a*.p12)
|
||||||
ca_file=/tmp/weixin/xxxxx.p12
|
ca_file=/tmp/weixin4j/xxxxx.p12
|
||||||
# classpath\u8def\u5f84\u4e0b\u53ef\u4ee5\u8fd9\u4e48\u5199
|
# classpath\u8def\u5f84\u4e0b\u53ef\u4ee5\u8fd9\u4e48\u5199
|
||||||
# ca_file=classpath:xxxxx.pfx
|
# ca_file=classpath:xxxxx.pfx
|
||||||
@ -38,9 +38,9 @@ public class MediaTest extends TokenTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void upload1() throws IOException, WeixinException {
|
public void upload1() throws IOException, WeixinException {
|
||||||
File file = new File("/Users/jy/Downloads/test.jpg");
|
File file = new File("/Users/jy/Downloads/weixin4j.png");
|
||||||
String mediaId = mediaApi.uploadMedia(file, MediaType.image, false);
|
String mediaId = mediaApi.uploadMedia(file, MediaType.image, false);
|
||||||
// Sy1KOLsi4ri3kB3TYUuculVelcW2I7W6BrfGwkGvSW8beTCAarxuGQLjuNJChJr8
|
// 1Vgd1R5DdznSc3rPxd-sNZ3pLt54cejhJ5ItuNcCgrqoQArNANWy5oxso_r9KNlE
|
||||||
Assert.assertNotNull(mediaId);
|
Assert.assertNotNull(mediaId);
|
||||||
System.err.println(mediaId);
|
System.err.println(mediaId);
|
||||||
}
|
}
|
||||||
@ -49,7 +49,7 @@ public class MediaTest extends TokenTest {
|
|||||||
public void download1() throws WeixinException, IOException {
|
public void download1() throws WeixinException, IOException {
|
||||||
File file = mediaApi
|
File file = mediaApi
|
||||||
.downloadMedia(
|
.downloadMedia(
|
||||||
"Sy1KOLsi4ri3kB3TYUuculVelcW2I7W6BrfGwkGvSW8beTCAarxuGQLjuNJChJr8",
|
"1Vgd1R5DdznSc3rPxd-sNZ3pLt54cejhJ5ItuNcCgrqoQArNANWy5oxso_r9KNlE",
|
||||||
MediaType.image, false);
|
MediaType.image, false);
|
||||||
Assert.assertTrue(file.exists());
|
Assert.assertTrue(file.exists());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,9 +32,9 @@ weixin4j-qy
|
|||||||
<artifactId>weixin4j-qy</artifactId>
|
<artifactId>weixin4j-qy</artifactId>
|
||||||
<version>1.4</version>
|
<version>1.4</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
1.需新增或拷贝`weixin.properties`文件到项目的`classpath`中
|
1.需新增或拷贝`weixin4j.properties`文件到项目的`classpath`中
|
||||||
|
|
||||||
weixin.properties说明
|
weixin4j.properties说明
|
||||||
|
|
||||||
| 属性名 | 说明 |
|
| 属性名 | 说明 |
|
||||||
| :---------- | :-------------- |
|
| :---------- | :-------------- |
|
||||||
@ -48,8 +48,8 @@ weixin.properties说明
|
|||||||
"token":"企业号中应用在回调模式下的token",\
|
"token":"企业号中应用在回调模式下的token",\
|
||||||
"encodingAesKey":"企业号中应用在回调模式下AES加密密钥"}
|
"encodingAesKey":"企业号中应用在回调模式下AES加密密钥"}
|
||||||
|
|
||||||
token_path=/tmp/weixin/token
|
token_path=/tmp/weixin4j/token
|
||||||
media_path=/tmp/weixin/media
|
media_path=/tmp/weixin4j/media
|
||||||
|
|
||||||
2.实例化一个`WeixinProxy`对象,调用API
|
2.实例化一个`WeixinProxy`对象,调用API
|
||||||
|
|
||||||
|
|||||||
@ -5,6 +5,6 @@ account={"id":"wxf10bce209c91d0e2","secret":"cW0OtP7-7YJ7jHKFZaJW2skJHE9bLHadxOs
|
|||||||
"encodingAesKey":"BRYfV4zPFUJb3v3MySNBg1ERKE3vyyMRoScu76vFySv"}
|
"encodingAesKey":"BRYfV4zPFUJb3v3MySNBg1ERKE3vyyMRoScu76vFySv"}
|
||||||
|
|
||||||
# \u4f7f\u7528FileTokenHolder\u65f6token\u7684\u5b58\u653e\u8def\u5f84
|
# \u4f7f\u7528FileTokenHolder\u65f6token\u7684\u5b58\u653e\u8def\u5f84
|
||||||
token_path=/tmp/weixin/token
|
token_path=/tmp/weixin4j/token
|
||||||
# \u5a92\u4f53\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84
|
# \u5a92\u4f53\u6587\u4ef6\u4fdd\u5b58\u8def\u5f84
|
||||||
media_path=/tmp/weixin/media
|
media_path=/tmp/weixin4j/media
|
||||||
Loading…
x
Reference in New Issue
Block a user