Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
binarywang committed Dec 23, 2018
2 parents d696537 + 765b5d1 commit cc8359b
Show file tree
Hide file tree
Showing 285 changed files with 5,541 additions and 2,108 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
6 changes: 3 additions & 3 deletions contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
-***暂停此种方式,请使用第一种***)另外一种贡献代码的方式就是加入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
$ git clone git@github.com:my_user/WxJava.git
$ cd weixin-java-tools
$ 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
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
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
8 changes: 4 additions & 4 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
[![码云Gitee](https://gitee.com/binary/weixin-java-tools/badge/star.svg?theme=blue)](https://gitee.com/binary/weixin-java-tools)
[![Github](http://github-svg-buttons.herokuapp.com/star.svg?user=Wechat-Group&repo=WxJava&style=flat&background=1081C1)](https://github.com/Wechat-Group/WxJava)
[![GitHub release](https://img.shields.io/github/release/Wechat-Group/WxJava.svg)](https://github.com/Wechat-Group/WxJava/releases)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/weixin-java-parent.svg)](http://mvnrepository.com/artifact/com.github.binarywang/weixin-java-parent)
[![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/wx-java.svg)](http://mvnrepository.com/artifact/com.github.binarywang/wx-java)
[![Build Status](https://travis-ci.org/Wechat-Group/WxJava.svg?branch=develop)](https://travis-ci.org/Wechat-Group/WxJava)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=weixin-java-tools)
[![使用IntelliJ IDEA开发维护](https://img.shields.io/badge/IntelliJ%20IDEA-提供支持-blue.svg)](https://www.jetbrains.com/?from=WxJava-weixin-java-tools)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)

---------------------------------
#### 支持包括微信支付、开放平台、公众号(包括订阅号和服务号)、企业微信/企业号、小程序等微信功能的后端开发。
---------------------------------

### 重要信息

1. **2018-09-24 发布 [【3.2.0正式版】](https://github.com/Wechat-Group/WxJava/releases)**
1. **2018-12-23 项目更名为WxJava,并发布 [【3.3.0正式版】](https://github.com/Wechat-Group/WxJava/releases)**
1. 新手重要提示:本项目仅是一个SDK开发工具包,未提供Web实现,建议使用maven或gradle引用本项目即可使用本SDK提供的各种功能,详情可参考 **[【Demo项目】](demo.md)** 或本项目中的部分单元测试代码;另外微信开发新手请务必阅读[【开发文档 Wiki 首页】](https://github.com/Wechat-Group/WxJava/wiki)的常见问题部分,可以少走很多弯路,节省不少时间。

---------------------------------
Expand Down Expand Up @@ -152,3 +151,4 @@
1. [qsjia (QSJia)](http://github.com/qsjia)
1. [webcreazy (webcreazy)](http://github.com/webcreazy)
1. [cwivan (鱼丸Cwivan)](http://github.com/cwivan)
1. [howardliu-cn (看山)](https://github.com/howardliu-cn)
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.0.0</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 cc8359b

Please sign in to comment.