Skip to content

Commit e84325d

Browse files
committed
Merge branch 'feature/enterprise' into develop
2 parents d0ac1da + de67b77 commit e84325d

189 files changed

Lines changed: 6559 additions & 1306 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ target
1616
.project
1717
.classpath
1818

19-
src/test/resources/test-config.xml
2019
sw-pom.xml
2120
*.iml
21+
test-config.xml

‎README.md‎

Lines changed: 17 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,34 @@
1-
weixin-java-tools
1+
weixin-java-cp
22
===========
33

4-
微信java开发工具集,本项目主要分为两大块:微信消息路由器、微信Java API
4+
微信公众号、企业号Java SDK。
55

6-
特性列表:
7-
8-
1. 不基于Servlet、和其他MVC框架,仅作为工具使用,提供更多的灵活性
9-
2. 详尽的单元测试代码,可以拿来当example用
10-
3. 详尽的javadoc
11-
4. access token过期自动刷新的功能
12-
5. 微信服务端繁忙自动重试的功能
13-
6. 提供微信错误信息的异常处理机制
6+
从``1.0.3``开始,本项目拆分成3个部分:
147

8+
1. weixin-java-common,公共lib
9+
2. weixin-java-cp,企业号SDK
10+
3. weixin-java-mp,公众号(订阅号、服务号)SDK
1511

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

18-
# Quickstart
14+
# Quick Start
15+
16+
如果要开发公众号(订阅号、服务号)应用,在你的maven项目中添加:
1917

20-
在你的maven项目中添加:
2118
```xml
2219
<dependency>
2320
<groupId>me.chanjar</groupId>
24-
<artifactId>weixin-java-tools</artifactId>
25-
<version>1.0.2</version>
21+
<artifactId>weixin-java-mp</artifactId>
22+
<version>1.0.3</version>
2623
</dependency>
2724
```
2825

29-
如果要使用``*-SNAPSHOT``版,则需要在你的``pom.xml``中添加这段:
26+
如果要开发企业号应用,在你的maven项目中添加:
3027

3128
```xml
32-
<repositories>
33-
<repository>
34-
<snapshots />
35-
<id>sonatype snapshots</id>
36-
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
37-
</repository>
38-
</repositories>
39-
```
40-
41-
## Hello World
42-
```java
43-
WxConfigStorage config = new WxInMemoryConfigStorage();
44-
config.setAppId(...); // 设置微信公众号的appid
45-
config.setSecret(...); // 设置微信公众号的app secret
46-
config.setToken(...); // 设置微信公众号的token
47-
48-
WxServiceImpl wxService = new WxServiceImpl();
49-
wxService.setWxConfigStorage(config);
50-
51-
// 用户的openid在下面地址获得
52-
// https://mp.weixin.qq.com/debug/cgi-bin/apiinfo?t=index&type=用户管理&form=获取关注者列表接口%20/user/get
53-
String openId = ...;
54-
WxCustomMessage message = WxCustomMessage.TEXT().toUser(openId).content("Hello World").build();
55-
wxService.customMessageSend(message);
29+
<dependency>
30+
<groupId>me.chanjar</groupId>
31+
<artifactId>weixin-java-cp</artifactId>
32+
<version>1.0.3</version>
33+
</dependency>
5634
```

‎pom.xml‎

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@
44
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
55
<modelVersion>4.0.0</modelVersion>
66
<groupId>me.chanjar</groupId>
7-
<artifactId>weixin-java-tools</artifactId>
7+
<artifactId>weixin-java-parent</artifactId>
88
<version>1.0.3-SNAPSHOT</version>
9-
<name>WeiXin Java Tools</name>
10-
<description>用于开发微信公众号的Java工具</description>
9+
<packaging>pom</packaging>
10+
<name>WeiXin Java Tools - Parent</name>
11+
<description>微信公众号、企业号上级POM</description>
1112
<url>https://github.com/chanjarster/weixin-java-tools</url>
1213

1314
<licenses>
@@ -30,19 +31,20 @@
3031
<url>https://github.com/chanjarster/weixin-java-tools</url>
3132
</scm>
3233

34+
<modules>
35+
<module>weixin-java-common</module>
36+
<module>weixin-java-cp</module>
37+
<module>weixin-java-mp</module>
38+
</modules>
39+
3340
<properties>
3441
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
3542
<downloadJavadocs>true</downloadJavadocs>
3643
<downloadSources>true</downloadSources>
3744
<httpclient.version>4.3.5</httpclient.version>
3845
</properties>
46+
3947
<dependencies>
40-
<dependency>
41-
<groupId>junit</groupId>
42-
<artifactId>junit</artifactId>
43-
<version>4.11</version>
44-
<scope>test</scope>
45-
</dependency>
4648
<dependency>
4749
<groupId>org.apache.httpcomponents</groupId>
4850
<artifactId>fluent-hc</artifactId>
@@ -63,34 +65,11 @@
6365
<artifactId>jaxb-impl</artifactId>
6466
<version>2.2.7</version>
6567
</dependency>
66-
<dependency>
67-
<groupId>org.apache.oltu.oauth2</groupId>
68-
<artifactId>org.apache.oltu.oauth2.client</artifactId>
69-
<version>1.0.0</version>
70-
</dependency>
7168
<dependency>
7269
<groupId>com.google.code.gson</groupId>
7370
<artifactId>gson</artifactId>
7471
<version>2.2.2</version>
7572
</dependency>
76-
<dependency>
77-
<groupId>org.testng</groupId>
78-
<artifactId>testng</artifactId>
79-
<version>6.8.7</version>
80-
<scope>test</scope>
81-
</dependency>
82-
<dependency>
83-
<groupId>org.mockito</groupId>
84-
<artifactId>mockito-all</artifactId>
85-
<version>1.9.5</version>
86-
<scope>test</scope>
87-
</dependency>
88-
<dependency>
89-
<groupId>com.google.inject</groupId>
90-
<artifactId>guice</artifactId>
91-
<version>3.0</version>
92-
<scope>test</scope>
93-
</dependency>
9473
<dependency>
9574
<groupId>org.apache.commons</groupId>
9675
<artifactId>commons-lang3</artifactId>
@@ -106,20 +85,49 @@
10685
<artifactId>commons-io</artifactId>
10786
<version>2.4</version>
10887
</dependency>
109-
<dependency>
110-
<groupId>org.eclipse.jetty</groupId>
111-
<artifactId>jetty-server</artifactId>
112-
<version>9.3.0.M0</version>
113-
<scope>test</scope>
114-
</dependency>
115-
<dependency>
116-
<groupId>org.eclipse.jetty</groupId>
117-
<artifactId>jetty-servlet</artifactId>
118-
<version>9.3.0.M0</version>
119-
<scope>test</scope>
120-
</dependency>
12188
</dependencies>
12289

90+
<dependencyManagement>
91+
<dependencies>
92+
<dependency>
93+
<groupId>junit</groupId>
94+
<artifactId>junit</artifactId>
95+
<version>4.11</version>
96+
<scope>test</scope>
97+
</dependency>
98+
<dependency>
99+
<groupId>com.google.inject</groupId>
100+
<artifactId>guice</artifactId>
101+
<version>3.0</version>
102+
<scope>test</scope>
103+
</dependency>
104+
<dependency>
105+
<groupId>org.testng</groupId>
106+
<artifactId>testng</artifactId>
107+
<version>6.8.7</version>
108+
<scope>test</scope>
109+
</dependency>
110+
<dependency>
111+
<groupId>org.mockito</groupId>
112+
<artifactId>mockito-all</artifactId>
113+
<version>1.9.5</version>
114+
<scope>test</scope>
115+
</dependency>
116+
<dependency>
117+
<groupId>org.eclipse.jetty</groupId>
118+
<artifactId>jetty-server</artifactId>
119+
<version>9.3.0.M0</version>
120+
<scope>test</scope>
121+
</dependency>
122+
<dependency>
123+
<groupId>org.eclipse.jetty</groupId>
124+
<artifactId>jetty-servlet</artifactId>
125+
<version>9.3.0.M0</version>
126+
<scope>test</scope>
127+
</dependency>
128+
</dependencies>
129+
</dependencyManagement>
130+
123131
<distributionManagement>
124132
<snapshotRepository>
125133
<id>ossrh</id>
@@ -186,17 +194,17 @@
186194
</profiles>
187195

188196
<build>
197+
<pluginManagement>
198+
<plugins>
199+
<plugin>
200+
<groupId>org.apache.maven.plugins</groupId>
201+
<artifactId>maven-surefire-plugin</artifactId>
202+
<version>2.17</version>
203+
</plugin>
204+
</plugins>
205+
</pluginManagement>
206+
189207
<plugins>
190-
<plugin>
191-
<groupId>org.apache.maven.plugins</groupId>
192-
<artifactId>maven-surefire-plugin</artifactId>
193-
<version>2.17</version>
194-
<configuration>
195-
<suiteXmlFiles>
196-
<suiteXmlFile>src/test/resources/testng.xml</suiteXmlFile>
197-
</suiteXmlFiles>
198-
</configuration>
199-
</plugin>
200208
<plugin>
201209
<groupId>org.sonatype.plugins</groupId>
202210
<artifactId>nexus-staging-maven-plugin</artifactId>

‎src/main/java/me/chanjar/weixin/bean/result/WxError.java‎

Lines changed: 0 additions & 136 deletions
This file was deleted.

0 commit comments

Comments
 (0)