Skip to content

Commit 39e79a2

Browse files
committed
minor change
1 parent 0546e00 commit 39e79a2

File tree

2 files changed

+15
-28
lines changed

2 files changed

+15
-28
lines changed

weixin-java-common/src/main/java/me/chanjar/weixin/common/bean/result/WxMediaUploadResult.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package me.chanjar.weixin.common.bean.result;
22

33
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
4+
import org.apache.commons.lang3.builder.ToStringBuilder;
5+
import org.apache.commons.lang3.builder.ToStringStyle;
46

57
import java.io.Serializable;
68

@@ -50,8 +52,7 @@ public void setThumbMediaId(String thumbMediaId) {
5052

5153
@Override
5254
public String toString() {
53-
return "WxUploadResult [type=" + this.type + ", media_id=" + this.mediaId + ", thumb_media_id=" + this.thumbMediaId
54-
+ ", created_at=" + this.createdAt + "]";
55+
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
5556
}
5657

5758
}

weixin-java-common/src/main/java/me/chanjar/weixin/common/util/crypto/WxCryptUtil.java

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
/**
2-
* 对公众平台发送给公众账号的消息加解密示例代码.
3-
*
4-
* @copyright Copyright (c) 1998-2014 Tencent Inc.
5-
* <p>
6-
* 针对org.apache.commons.codec.binary.Base64,
7-
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
8-
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
9-
* <p>
10-
* 针对org.apache.commons.codec.binary.Base64,
11-
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
12-
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
13-
*/
14-
15-
// ------------------------------------------------------------------------
16-
17-
/**
18-
* 针对org.apache.commons.codec.binary.Base64,
19-
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
20-
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
21-
*/
221
package me.chanjar.weixin.common.util.crypto;
232

243
import org.apache.commons.codec.binary.Base64;
@@ -37,6 +16,14 @@
3716
import java.util.Arrays;
3817
import java.util.Random;
3918

19+
/**
20+
* 对公众平台发送给公众账号的消息加解密示例代码.
21+
*
22+
* @copyright Copyright (c) 1998-2014 Tencent Inc.
23+
* 针对org.apache.commons.codec.binary.Base64,
24+
* 需要导入架包commons-codec-1.9(或commons-codec-1.8等其他版本)
25+
* 官方下载地址:http://commons.apache.org/proper/commons-codec/download_codec.cgi
26+
*/
4027
public class WxCryptUtil {
4128

4229
private static final Base64 base64 = new Base64();
@@ -64,9 +51,9 @@ public WxCryptUtil() {
6451
/**
6552
* 构造函数
6653
*
67-
* @param token 公众平台上,开发者设置的token
68-
* @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey
69-
* @param appidOrCorpid 公众平台appid/corpid
54+
* @param token 公众平台上,开发者设置的token
55+
* @param encodingAesKey 公众平台上,开发者设置的EncodingAESKey
56+
* @param appidOrCorpid 公众平台appid/corpid
7057
*/
7158
public WxCryptUtil(String token, String encodingAesKey,
7259
String appidOrCorpid) {
@@ -231,8 +218,7 @@ protected String encrypt(String randomStr, String plainText) {
231218
* @param encryptedXml 密文,对应POST请求的数据
232219
* @return 解密后的原文
233220
*/
234-
public String decrypt(String msgSignature, String timeStamp, String nonce,
235-
String encryptedXml) {
221+
public String decrypt(String msgSignature, String timeStamp, String nonce, String encryptedXml) {
236222
// 密钥,公众账号的app corpSecret
237223
// 提取密文
238224
String cipherText = extractEncryptPart(encryptedXml);

0 commit comments

Comments
 (0)