Skip to content

Commit

Permalink
Merge branch 'master' of github.com:Wechat-Group/weixin-java-tools in…
Browse files Browse the repository at this point in the history
…to wechat-master

* 'master' of github.com:Wechat-Group/weixin-java-tools: (91 commits)
  Update contribution.md
  Update readme.md
  Update readme.md
  update contributor list
  Update demo.md
  Update readme.md
  Upgrade org.dom4j:dom4j to version 2.1.1
  Update readme.md
  更改版本号,准备发布最新正式版
  项目更名
  Update readme.md
  Update readme.md
  Update readme.md
  Wechat-Group#888 修复微信支付部分接口请求中签名方法不统一的问题
  增加些注释
  优化代码
  发布3.2.10.B测试版本
  Wechat-Group#889 修复一些潜在的XXE漏洞代码
  Wechat-Group#783 企业微信模块增加群聊相关接口
  Wechat-Group#884 微信公众号模块增加主体变更迁移用户openid的接口
  ...
  • Loading branch information
comeonc committed Jan 2, 2019
2 parents 9b49cc7 + 47b3891 commit 622952c
Show file tree
Hide file tree
Showing 288 changed files with 5,610 additions and 2,164 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,6 @@ sonar-project.properties

!/.mvn/wrapper/maven-wrapper.jar
*.versionsBackup

# STS
.factorypath
8 changes: 4 additions & 4 deletions contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
-***暂停此种方式,请使用第一种***)另外一种贡献代码的方式就是加入SDK Developers开发组,前提是对自己的代码足够自信就可以申请加入,加入之后可以随时直接提交代码,但要注意对所做的修改或新增的代码进行单元测试,保证提交代码没有明显问题。

### PR方式贡献代码步骤
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/weixin-java-tools`,然后 `clone` 到本地,并设置用户信息。
* 在 GitHub 上 `fork` 到自己的仓库,如 `my_user/WxJava`,然后 `clone` 到本地,并设置用户信息。

```bash
$ git clone git@github.com:my_user/weixin-java-tools.git
$ cd weixin-java-tools
$ git clone git@github.com:my_user/WxJava.git
$ cd WxJava
$ git config user.name "yourname"
$ git config user.email "your email"
```
Expand All @@ -27,7 +27,7 @@ $ git push
* 定期使用项目仓库内容更新自己仓库内容。

```bash
$ git remote add upstream https://github.com/wechat-group/weixin-java-tools
$ git remote add upstream https://github.com/Wechat-Group/WxJava
$ git fetch upstream
$ git checkout develop
$ git rebase upstream/develop
Expand Down
2 changes: 1 addition & 1 deletion demo.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
1. 公众号Demo:
- 使用Spring MVC实现的公众号Demo:[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springmvc)、[码云](https://gitee.com/binary/weixin-java-mp-demo)
- 使用Spring Boot实现的公众号Demo(支持多公众号):[GitHub](http://github.com/binarywang/weixin-java-mp-demo-springboot)、[码云](http://gitee.com/binary/weixin-java-mp-demo-springboot)
- 含公众号和部分微信支付代码的Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-tools-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc)
- 含公众号和部分微信支付代码的Demo:[GitHub](http://github.com/Wechat-Group/weixin-java-springmvc)、[码云](http://gitee.com/binary/weixin-java-tools-springmvc)
15 changes: 10 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
xmlns="http://maven.apache.org/POM/4.0.0">
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>3.2.0</version>
<artifactId>wx-java</artifactId>
<version>3.3.0</version>
<packaging>pom</packaging>
<name>Weixin Java Tools - Parent</name>
<name>WxJava - Weixin/Wechat Java SDK</name>
<description>微信开发Java SDK</description>
<url>https://github.com/wechat-group/weixin-java-tools</url>
<url>https://github.com/Wechat-Group/WxJava</url>

<licenses>
<license>
Expand Down Expand Up @@ -85,6 +85,11 @@
<email>007gzs@gmail.com</email>
<url>https://github.com/007gzs</url>
</developer>
<developer>
<name>Howard Liu</name>
<email>liuxinghao1988@gmail.com</email>
<url>https://github.com/howardliu-cn</url>
</developer>
</developers>

<scm>
Expand Down Expand Up @@ -166,7 +171,7 @@
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.4.9</version>
<version>1.4.10</version>
</dependency>
<!-- 由于guava较新的21.0版本需要jdk8,故而此处采用较低版本 -->
<dependency>
Expand Down
Binary file modified qrcodes/alipay_qrcode.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed qrcodes/wechat_qrcode.jpg
Binary file not shown.
8 changes: 0 additions & 8 deletions quality-checks/google_checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,14 +140,6 @@
</module>
<module name="OverloadMethodsDeclarationOrder"/>
<module name="VariableDeclarationUsageDistance"/>
<module name="CustomImportOrder">
<property name="customImportOrderRules"
value="SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###THIRD_PARTY_PACKAGE###STATIC"/>
<property name="specialImportsRegExp" value="^javax\."/>
<property name="standardPackageRegExp" value="^java\."/>
<property name="sortImportsInGroupAlphabetically" value="true"/>
<property name="separateLineBetweenGroups" value="false"/>
</module>
<module name="MethodParamPad"/>
<module name="ParenPad"/>
<module name="OperatorWrap">
Expand Down
129 changes: 71 additions & 58 deletions readme.md

Large diffs are not rendered by default.

11 changes: 8 additions & 3 deletions weixin-java-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>3.2.0</version>
<artifactId>wx-java</artifactId>
<version>3.3.0</version>
</parent>

<artifactId>weixin-java-common</artifactId>
<name>Weixin Java Tools - Common</name>
<name>WxJava - Common</name>
<description>微信开发Java SDK公共模块</description>

<dependencies>
Expand Down Expand Up @@ -114,6 +114,11 @@
<artifactId>assertj-guava</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.dom4j</groupId>
<artifactId>dom4j</artifactId>
<version>2.1.1</version>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,15 @@ public static class EventType {
*/
public static final String CARD_PAY_ORDER = "card_pay_order";

/**
* 小程序审核事件:审核通过
*/
public static final String WEAPP_AUDIT_SUCCESS = "weapp_audit_success";

/**
* 小程序审核事件:审核不通过
*/
public static final String WEAPP_AUDIT_FAIL = "weapp_audit_fail";

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public void run() {
}
}
} catch (InterruptedException e) {
e.printStackTrace();
Thread.currentThread().interrupt();
}
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

import java.io.Serializable;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

/**
* 卡券Api签名.
Expand Down Expand Up @@ -37,6 +35,6 @@ public class WxCardApiSignature implements Serializable {

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
return WxGsonBuilder.create().toJson(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

Expand Down Expand Up @@ -49,7 +46,7 @@ public String toJson() {

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
return this.toJson();
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@
import java.util.ArrayList;
import java.util.List;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

/**
* menu button.
Expand Down Expand Up @@ -83,7 +81,7 @@ public class WxMenuButton implements Serializable {

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
return WxGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@

import java.io.Serializable;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import com.google.gson.annotations.SerializedName;
import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

/**
* menu rule.
Expand All @@ -31,6 +29,6 @@ public class WxMenuRule implements Serializable {

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
return WxGsonBuilder.create().toJson(this);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@

import java.io.Serializable;

import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import lombok.Data;
import me.chanjar.weixin.common.util.json.WxGsonBuilder;

Expand All @@ -28,7 +25,7 @@ public static WxMediaUploadResult fromJson(String json) {

@Override
public String toString() {
return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
return WxGsonBuilder.create().toJson(this);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -794,8 +794,7 @@ public enum WxCpErrorMsgEnum {
* 通过错误代码查找其中文含义.
*/
public static String findMsgByCode(int code) {
WxCpErrorMsgEnum[] values = WxCpErrorMsgEnum.values();
for (WxCpErrorMsgEnum value : values) {
for (WxCpErrorMsgEnum value : WxCpErrorMsgEnum.values()) {
if (value.code == code) {
return value.msg;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public static WxError fromJson(String json, WxType type) {
if (msg != null) {
wxError.setErrorMsg(msg);
}
} else if (type == WxType.MiniApp) {
final String msg = WxMaErrorMsgEnum.findMsgByCode(wxError.getErrorCode());
if (msg != null) {
wxError.setErrorMsg(msg);
}
}

return wxError;
Expand Down
Loading

0 comments on commit 622952c

Please sign in to comment.