Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #4

Closed
wants to merge 11 commits into from
40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
weixin-java-tools
# Weixin-java-tools
## 微信公众号、企业号Java SDK。

[![Build Status](https://travis-ci.org/chanjarster/weixin-java-tools.svg?branch=develop)](https://travis-ci.org/chanjarster/weixin-java-tools)
![Maven Central](https://img.shields.io/maven-central/v/me.chanjar/weixin-java-parent.svg)
[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/chanjarster/weixin-java-tools?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Build Status](https://travis-ci.org/binarywang/weixin-java-tools.svg?branch=develop)](https://travis-ci.org/binarywang/weixin-java-tools)
![Maven Central](https://img.shields.io/maven-central/v/com.github.binarywang/weixin-java-parent.svg)

### 详细文档请看 [wiki](https://github.com/chanjarster/weixin-java-tools/wiki)。

#### 1.3.4版发布!!! By Binary Wang 2016-06-01

===========

* 群/聊天室:请点击上方的GITTER按钮
* 本项目的发布周期:本人子2015年6月开始进入到了一个非常忙碌的状态,且公司目前也没有开发微信相关的项目,因此本项目的维护基本靠“等”。所以靠人不如靠自己,提交pull request吧。
===========

* QQ群:343954419
* 微信群:
![Alt text](https://raw.githubusercontent.com/binarywang/weixin-java-tools/master/weixinqun.jpg "微信群")

===========

微信公众号、企业号Java SDK。
## 发布周期
暂定为一月一次发布,月初或月底发布新版本,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request。

详细文档请看 [wiki](https://github.com/chanjarster/weixin-java-tools/wiki)。

## Quick Start

如果要开发公众号(订阅号、服务号)应用,在你的maven项目中添加:

```xml
<dependency>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-mp</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
</dependency>
```

如果要开发企业号应用,在你的maven项目中添加:

```xml
<dependency>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-cp</artifactId>
<version>1.3.3</version>
<version>1.3.4</version>
</dependency>
```

Expand All @@ -51,14 +57,8 @@ weixin-java-tools
</repositories>
```

## 升级指南

* [1.0.3升级指南](https://github.com/chanjarster/weixin-java-tools/wiki/1_0_3升级指南)
* [1.1.0升级指南](https://github.com/chanjarster/weixin-java-tools/wiki/1_1_0升级指南)
* [1.1.1升级指南](https://github.com/chanjarster/weixin-java-tools/wiki/1_1_1升级指南)

## 关于Pull Request

非常欢迎和感谢对本项目发起Pull Request的同学,不过本项目基于[git flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow)开发流程,因此在发起Pull Request的时候请选择develop分支。

且本项目代码风格是用2个空格代表一个tab,因此在发起PR时注意一下,否则很容易发生在IDE格式化代码后与原代码产生大量diff,这样我在阅读PR的时候就很困难。
且本项目代码风格是用2个空格代表一个tab,因此在发起PR时注意一下,否则很容易发生在IDE格式化代码后与原代码产生大量diff,这样我在阅读PR的时候就很困难。
27 changes: 21 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.3.4-SNAPSHOT</version>
<version>1.3.5-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WeiXin Java Tools - Parent</name>
<description>微信公众号、企业号上级POM</description>
<url>https://github.com/chanjarster/weixin-java-tools</url>
<url>https://github.com/binarywang/weixin-java-tools</url>

<licenses>
<license>
Expand All @@ -23,12 +23,16 @@
<name>Daniel Qian</name>
<email>chanjarster@gmail.com</email>
</developer>
<developer>
<name>Binary Wang</name>
<email>binarywang@gmail.com</email>
</developer>
</developers>

<scm>
<connection>scm:git:https://github.com/chanjarster/weixin-java-tools.git</connection>
<developerConnection>scm:git:git@github.com:chanjarster/weixin-java-tools.git</developerConnection>
<url>https://github.com/chanjarster/weixin-java-tools</url>
<connection>scm:git:https://github.com/binarywang/weixin-java-tools.git</connection>
<developerConnection>scm:git:git@github.com:binarywang/weixin-java-tools.git</developerConnection>
<url>https://github.com/binarywang/weixin-java-tools</url>
</scm>

<modules>
Expand Down Expand Up @@ -144,6 +148,16 @@
</distributionManagement>

<profiles>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<properties>
<javadoc.opts>-Xdoclint:none</javadoc.opts>
</properties>
</profile>

<profile>
<id>release</id>
<build>
Expand Down Expand Up @@ -174,6 +188,7 @@
</execution>
</executions>
<configuration>
<additionalparam>${javadoc.opts}</additionalparam>
<charset>UTF-8</charset>
<locale>zh_CN</locale>
</configuration>
Expand Down
9 changes: 2 additions & 7 deletions weixin-java-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.3.4-SNAPSHOT</version>
<version>1.3.5-SNAPSHOT</version>
</parent>

<artifactId>weixin-java-common</artifactId>
Expand All @@ -27,31 +27,26 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.io.Serializable;

public class WxAccessToken implements Serializable {
private static final long serialVersionUID = 8709719312922168909L;

private String accessToken;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
*/
public class WxCardApiSignature implements Serializable {

private static final long serialVersionUID = 158176707226975979L;

private String appId;

private String cardId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
* jspai signature
*/
public class WxJsapiSignature implements Serializable {
private static final long serialVersionUID = -1116808193154384804L;

private String appid;

private String noncestr;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
*/
public class WxMenu implements Serializable {

private static final long serialVersionUID = -7083914585539687746L;

private List<WxMenuButton> buttons = new ArrayList<WxMenuButton>();

private WxMenuRule matchRule;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
*/
public class WxError implements Serializable {

private static final long serialVersionUID = 7869786563361406291L;

private int errorCode;

private String errorMsg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
import java.io.Serializable;

public class WxMediaUploadResult implements Serializable {

private static final long serialVersionUID = 330834334738622341L;

private String type;
private String mediaId;
private String thumbMediaId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
package me.chanjar.weixin.common.util.crypto;

import org.apache.commons.codec.digest.DigestUtils;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.Arrays;

import org.apache.commons.codec.digest.DigestUtils;

/**
* Created by Daniel Qian on 14/10/19.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public String encrypt(String plainText) {
String encryptedXml = encrypt(genRandomStr(), plainText);

// 生成安全签名
String timeStamp = timeStamp = Long.toString(System.currentTimeMillis() / 1000l);
String timeStamp = Long.toString(System.currentTimeMillis() / 1000l);
String nonce = genRandomStr();

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import org.apache.http.HttpHost;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;

import me.chanjar.weixin.common.exception.WxErrorException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
package me.chanjar.weixin.common.util.xml;

import java.io.Writer;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.converters.basic.DoubleConverter;
import com.thoughtworks.xstream.converters.basic.FloatConverter;
import com.thoughtworks.xstream.converters.basic.IntConverter;
import com.thoughtworks.xstream.core.util.QuickWriter;
import com.thoughtworks.xstream.io.HierarchicalStreamWriter;
import com.thoughtworks.xstream.io.xml.PrettyPrintWriter;
import com.thoughtworks.xstream.io.xml.XppDriver;
import com.thoughtworks.xstream.security.NoTypePermission;
import com.thoughtworks.xstream.security.NullPermission;
import com.thoughtworks.xstream.security.PrimitiveTypePermission;

import java.io.Writer;

public class XStreamInitializer {

public static XStream getInstance() {
Expand Down
11 changes: 3 additions & 8 deletions weixin-java-cp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.3.4-SNAPSHOT</version>
<version>1.3.5-SNAPSHOT</version>
</parent>

<artifactId>weixin-java-cp</artifactId>
Expand All @@ -15,7 +15,7 @@

<dependencies>
<dependency>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-common</artifactId>
<version>${project.version}</version>
</dependency>
Expand All @@ -27,31 +27,26 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
11 changes: 3 additions & 8 deletions weixin-java-mp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-parent</artifactId>
<version>1.3.4-SNAPSHOT</version>
<version>1.3.5-SNAPSHOT</version>
</parent>
<artifactId>weixin-java-mp</artifactId>
<name>WeiXin Java Tools - MP</name>
<description>微信公众号Java SDK</description>

<dependencies>
<dependency>
<groupId>me.chanjar</groupId>
<groupId>com.github.binarywang</groupId>
<artifactId>weixin-java-common</artifactId>
<version>${project.version}</version>
</dependency>
Expand All @@ -26,31 +26,26 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.8.7</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<version>1.9.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.inject</groupId>
<artifactId>guice</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-servlet</artifactId>
<version>9.3.0.M0</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand Down
Loading