minor change

This commit is contained in:
Binary Wang 2017-06-16 00:00:07 +08:00
parent 0546e001f6
commit 39e79a2c00
2 changed files with 15 additions and 28 deletions

View File

@ -1,6 +1,8 @@
package me.chanjar.weixin.common.bean.result;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.io.Serializable;
@ -50,8 +52,7 @@ public class WxMediaUploadResult implements Serializable {
@Override
public String toString() {
return "WxUploadResult [type=" + this.type + ", media_id=" + this.mediaId + ", thumb_media_id=" + this.thumbMediaId
+ ", created_at=" + this.createdAt + "]";
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
}
}

View File

@ -1,24 +1,3 @@
/**
* 对公众平台发送给公众账号的消息加解密示例代码.
*
* @copyright Copyright (c) 1998-2014 Tencent Inc.
* <p>
* 针对org.apache.commons.codec.binary.Base64
* 需要导入架包commons-codec-1.9或commons-codec-1.8等其他版本
* 官方下载地址http://commons.apache.org/proper/commons-codec/download_codec.cgi
* <p>
* 针对org.apache.commons.codec.binary.Base64
* 需要导入架包commons-codec-1.9或commons-codec-1.8等其他版本
* 官方下载地址http://commons.apache.org/proper/commons-codec/download_codec.cgi
*/
// ------------------------------------------------------------------------
/**
* 针对org.apache.commons.codec.binary.Base64
* 需要导入架包commons-codec-1.9或commons-codec-1.8等其他版本
* 官方下载地址http://commons.apache.org/proper/commons-codec/download_codec.cgi
*/
package me.chanjar.weixin.common.util.crypto;
import org.apache.commons.codec.binary.Base64;
@ -37,6 +16,14 @@ import java.nio.charset.Charset;
import java.util.Arrays;
import java.util.Random;
/**
* 对公众平台发送给公众账号的消息加解密示例代码.
*
* @copyright Copyright (c) 1998-2014 Tencent Inc.
* 针对org.apache.commons.codec.binary.Base64
* 需要导入架包commons-codec-1.9或commons-codec-1.8等其他版本
* 官方下载地址http://commons.apache.org/proper/commons-codec/download_codec.cgi
*/
public class WxCryptUtil {
private static final Base64 base64 = new Base64();
@ -231,8 +218,7 @@ public class WxCryptUtil {
* @param encryptedXml 密文对应POST请求的数据
* @return 解密后的原文
*/
public String decrypt(String msgSignature, String timeStamp, String nonce,
String encryptedXml) {
public String decrypt(String msgSignature, String timeStamp, String nonce, String encryptedXml) {
// 密钥公众账号的app corpSecret
// 提取密文
String cipherText = extractEncryptPart(encryptedXml);