Merge branch 'release/1.10.0'
This commit is contained in:
commit
47da1be839
23
maven-version-rules.xml
Normal file
23
maven-version-rules.xml
Normal file
@ -0,0 +1,23 @@
|
||||
<ruleset comparisonMethod="maven"
|
||||
xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="
|
||||
http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0
|
||||
http://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">
|
||||
<ignoreVersions>
|
||||
<ignoreVersion type="regex">.*(-|\.)(alpha|Alpha|ALPHA|beta|Beta|BETA|rc|RC).*</ignoreVersion>
|
||||
</ignoreVersions>
|
||||
<rules>
|
||||
<rule groupId="javax.servlet" comparisonMethod="maven">
|
||||
<ignoreVersions>
|
||||
<ignoreVersion type="regex">.*-alpha[\.\-].*</ignoreVersion>
|
||||
<ignoreVersion type="regex">.*-b[0-9]+</ignoreVersion>
|
||||
</ignoreVersions>
|
||||
</rule>
|
||||
<rule groupId="javax.xml" comparisonMethod="maven">
|
||||
<ignoreVersions>
|
||||
<ignoreVersion type="regex">.*-b.*</ignoreVersion>
|
||||
</ignoreVersions>
|
||||
</rule>
|
||||
</rules>
|
||||
</ruleset>
|
||||
157
pom.xml
157
pom.xml
@ -2,9 +2,14 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.oxerr</groupId>
|
||||
<artifactId>oxerr-parent</artifactId>
|
||||
<version>1.1.0</version>
|
||||
</parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>weixin4j</name>
|
||||
<url>https://github.com/foxinmy/weixin4j</url>
|
||||
@ -19,7 +24,7 @@
|
||||
</license>
|
||||
</licenses>
|
||||
<scm>
|
||||
<url>https://github.com/foxinmy/weixin4j</url>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master</url>
|
||||
<connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection>
|
||||
<developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection>
|
||||
<tag>HEAD</tag>
|
||||
@ -48,29 +53,18 @@
|
||||
<module>weixin4j-serverX</module>
|
||||
<module>weixin4j-pay</module>
|
||||
<module>weixin4j-example</module>
|
||||
<module>weixin4j-coverage</module>
|
||||
</modules>
|
||||
<properties>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
<maven.compiler.source>1.6</maven.compiler.source>
|
||||
<maven.compiler.target>1.6</maven.compiler.target>
|
||||
<fastjson.version>1.2.31</fastjson.version>
|
||||
<locales>zh_CN</locales>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.0</version>
|
||||
<configuration>
|
||||
<source>1.6</source>
|
||||
<target>1.6</target>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>2.6</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<!-- 过滤证书文件 -->
|
||||
@ -83,35 +77,29 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes</classesDirectory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.txt</exclude>
|
||||
<exclude>**/*.md</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>true</addMavenDescriptor>
|
||||
</archive>
|
||||
<useDefaultManifestFile>true</useDefaultManifestFile>
|
||||
<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.amashchenko.maven.plugin</groupId>
|
||||
<artifactId>gitflow-maven-plugin</artifactId>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
@ -149,19 +137,11 @@
|
||||
</executions>
|
||||
<configuration>
|
||||
<show>public</show>
|
||||
<charset>${project.build.sourceEncoding}</charset>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<docencoding>${project.build.sourceEncoding}</docencoding>
|
||||
<links>
|
||||
<link>http://docs.oracle.com/javase/7/docs/api</link>
|
||||
</links>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
@ -175,19 +155,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.9.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.18</version>
|
||||
<configuration>
|
||||
<skipTests>true</skipTests>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
@ -208,9 +175,14 @@
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>com.amashchenko.maven.plugin</groupId>
|
||||
<artifactId>gitflow-maven-plugin</artifactId>
|
||||
<version>1.15.0</version>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
<version>3.0.5</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.7</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
@ -307,17 +279,72 @@
|
||||
</profiles>
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.3.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.5.13</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk16</artifactId>
|
||||
<version>1.46</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>5.3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>5.3.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>1.2.78</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>4.9.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.2.5</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.67.Final</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.15</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>4.13.1</version>
|
||||
<version>4.13.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>3.6.3</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
<distributionManagement>
|
||||
|
||||
@ -5,13 +5,43 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-base</artifactId>
|
||||
<name>weixin4j-base</name>
|
||||
<description>微信开发基础工程</description>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-base</url>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes</classesDirectory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.txt</exclude>
|
||||
<exclude>**/*.md</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>true</addMavenDescriptor>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
@ -23,7 +53,6 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@ -32,25 +61,22 @@
|
||||
<dependency>
|
||||
<groupId>commons-httpclient</groupId>
|
||||
<artifactId>commons-httpclient</artifactId>
|
||||
<version>3.0</version>
|
||||
<version>3.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.6</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.1.42.Final</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>3.4.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -62,7 +88,6 @@
|
||||
<dependency>
|
||||
<groupId>redis.clients</groupId>
|
||||
<artifactId>jedis</artifactId>
|
||||
<version>2.8.1</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -79,7 +104,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.2.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -8,7 +8,7 @@ import com.foxinmy.weixin4j.util.SerializationUtils;
|
||||
import redis.clients.jedis.Jedis;
|
||||
import redis.clients.jedis.JedisPool;
|
||||
import redis.clients.jedis.JedisPoolConfig;
|
||||
import redis.clients.util.Pool;
|
||||
import redis.clients.jedis.util.Pool;
|
||||
|
||||
/**
|
||||
* 用Redis保存缓存对象(推荐使用)
|
||||
|
||||
77
weixin4j-coverage/pom.xml
Normal file
77
weixin4j-coverage/pom.xml
Normal file
@ -0,0 +1,77 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>weixin4j-coverage</artifactId>
|
||||
<name>weixin4j-coverage</name>
|
||||
<packaging>pom</packaging>
|
||||
<description>Compute aggregated test code coverage.</description>
|
||||
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-base</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-qy</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-wxa</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-server</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-serverX</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-pay</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<reporting>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<reportSets>
|
||||
<reportSet>
|
||||
<reports>
|
||||
<report>report-aggregate</report>
|
||||
</reports>
|
||||
</reportSet>
|
||||
</reportSets>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
|
||||
</project>
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<packaging>war</packaging>
|
||||
<artifactId>weixin4j-example</artifactId>
|
||||
@ -76,7 +76,6 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>4.1.3.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>javax.servlet</groupId>
|
||||
@ -87,7 +86,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<version>2.1</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -103,7 +101,6 @@
|
||||
<dependency>
|
||||
<groupId>com.squareup.okhttp3</groupId>
|
||||
<artifactId>okhttp</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
||||
@ -5,18 +5,46 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<name>weixin4j-mp</name>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-mp</url>
|
||||
<description>微信公众平台API</description>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes</classesDirectory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.txt</exclude>
|
||||
<exclude>**/*.md</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>true</addMavenDescriptor>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
@ -29,7 +57,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.2.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@ -1,17 +1,23 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
<project
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
xsi:schemaLocation="
|
||||
http://maven.apache.org/POM/4.0.0
|
||||
http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<name>weixin4j-pay</name>
|
||||
<artifactId>weixin4j-pay</artifactId>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-pay</url>
|
||||
<description>微信支付商户平台API</description>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
<developers>
|
||||
<developer>
|
||||
<id>kit-lee</id>
|
||||
@ -30,6 +36,31 @@
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes</classesDirectory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.txt</exclude>
|
||||
<exclude>**/*.md</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>true</addMavenDescriptor>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
@ -42,7 +73,6 @@
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.2.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
|
||||
@ -5,18 +5,46 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-qy</artifactId>
|
||||
<name>weixin4j-qy</name>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-qy</url>
|
||||
<description>微信企业号API</description>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<classesDirectory>target/classes</classesDirectory>
|
||||
<excludes>
|
||||
<exclude>*.properties</exclude>
|
||||
<exclude>*.xml</exclude>
|
||||
<exclude>*.txt</exclude>
|
||||
<exclude>**/*.md</exclude>
|
||||
</excludes>
|
||||
<archive>
|
||||
<addMavenDescriptor>true</addMavenDescriptor>
|
||||
</archive>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<dependencies>
|
||||
|
||||
@ -6,12 +6,15 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-server</artifactId>
|
||||
<name>weixin4j-server</name>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-server</url>
|
||||
<description>微信消息netty服务器</description>
|
||||
<properties>
|
||||
<maven.test.skip>true</maven.test.skip>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
@ -27,13 +30,11 @@
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
</dependency>
|
||||
<!-- 兼容 JDK 9+ 后的maven环境编译 -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.2.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -43,13 +44,11 @@
|
||||
<dependency>
|
||||
<groupId>org.apache.httpcomponents</groupId>
|
||||
<artifactId>httpclient</artifactId>
|
||||
<version>4.3.6</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.2.0.RELEASE</version>
|
||||
<optional>true</optional>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
|
||||
@ -6,15 +6,12 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-serverX</artifactId>
|
||||
<name>weixin4j-serverX</name>
|
||||
<url>https://github.com/foxinmy/weixin4j/tree/master/weixin4j-serverX</url>
|
||||
<description>微信消息接入服务(spring mvc实现)</description>
|
||||
<properties>
|
||||
<spring.version>4.2.0.RELEASE</spring.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@ -23,13 +20,11 @@
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-webmvc</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<!-- 兼容 JDK 9+ 后的maven环境编译 -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<version>2.2.11</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -47,7 +42,6 @@
|
||||
<groupId>javax.servlet.jsp</groupId>
|
||||
<artifactId>jsp-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
<version>2.1</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<developers>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.1</version>
|
||||
<version>1.10.0</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-wxa</artifactId>
|
||||
<name>weixin4j-wxa</name>
|
||||
@ -21,19 +21,18 @@
|
||||
</build>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-base</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<groupId>${project.groupId}</groupId>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
<version>1.10</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
@ -42,7 +41,6 @@
|
||||
<dependency>
|
||||
<groupId>ch.qos.logback</groupId>
|
||||
<artifactId>logback-core</artifactId>
|
||||
<version>1.1.8</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@ -15,12 +15,12 @@ import com.alibaba.fastjson.JSONObject;
|
||||
*/
|
||||
public class WXBizDataCrypt {
|
||||
|
||||
private final String appid;
|
||||
private final String appId;
|
||||
|
||||
private final String sessionKey;
|
||||
|
||||
public WXBizDataCrypt(String appid, String sessionKey) {
|
||||
this.appid = appid;
|
||||
public WXBizDataCrypt(String appId, String sessionKey) {
|
||||
this.appId = appId;
|
||||
this.sessionKey = sessionKey;
|
||||
}
|
||||
|
||||
@ -40,8 +40,8 @@ public class WXBizDataCrypt {
|
||||
final String decryptedText = new String(decryptedBytes, Charset.forName("UTF-8"));
|
||||
final JSONObject decrypted = JSON.parseObject(decryptedText);
|
||||
|
||||
final String appId = decrypted.getJSONObject("watermark").getString("appid");
|
||||
if (!appId.equals(this.appid)) {
|
||||
final String watermarkAppId = decrypted.getJSONObject("watermark").getString("appid");
|
||||
if (!watermarkAppId.equals(this.appId)) {
|
||||
throw new IllegalArgumentException("Invalid Buffer");
|
||||
}
|
||||
|
||||
|
||||
33
weixin4j-wxa/src/site/markdown/index.md
Normal file
33
weixin4j-wxa/src/site/markdown/index.md
Normal file
@ -0,0 +1,33 @@
|
||||
## 欢迎来到 weixin4j-wxa
|
||||
微信小程序 API 支持
|
||||
|
||||
### 如何使用
|
||||
|
||||
```java
|
||||
var appId = "YOUR APP ID";
|
||||
var appSecret = "YOUR APP SECRET";
|
||||
var wxAccount = new WeixinAccount(appId, appSecret);
|
||||
var wxa = new WeixinAppFacade(wxAccount);
|
||||
var jsCode = request.getParameter("jsCode");
|
||||
var session = wxa.getLoginApi().jscode2session(jsCode);
|
||||
```
|
||||
|
||||
*更多 API 见 [WeixinAppFacade JavaDoc](apidocs/index.html?com/foxinmy/weixin4j/wxa/WeixinAppFacade.html)。*
|
||||
|
||||
### 解密数据
|
||||
客户端 API
|
||||
[`wx.getUserInfo(Object object)`](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserInfo.html)
|
||||
[`wx.getUserProfile(Object object)`](https://developers.weixin.qq.com/miniprogram/dev/api/open-api/user-info/wx.getUserProfile.html)
|
||||
等请求后得到的加密数据,可以通过下面的方法来解密。
|
||||
|
||||
客户端将获得的加密数据发往业务服务器,业务服务器收到加密数据后,
|
||||
使用[登录凭证校验 API](apidocs/index.html?com/foxinmy/weixin4j/wxa/api/LoginApi.html)
|
||||
获得的 `sessionKey` 解密并进行后续操作:
|
||||
|
||||
```java
|
||||
var encryptedData = request.getParameter("encryptedData");
|
||||
var iv = request.getParameter("iv");
|
||||
var sessionKey = session.getSessionKey();
|
||||
var wxBizDataCrypt = new WXBizDataCrypt(appId, sessionKey);
|
||||
var decryptedData = wxBizDataCrypt.decryptData(encryptedData, iv);
|
||||
```
|
||||
21
weixin4j-wxa/src/site/site.xml
Normal file
21
weixin4j-wxa/src/site/site.xml
Normal file
@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/DECORATION/1.8.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/DECORATION/1.8.0 https://maven.apache.org/xsd/decoration-1.8.0.xsd"
|
||||
name="Maven">
|
||||
<bannerLeft>
|
||||
<name>微信小程序</name>
|
||||
</bannerLeft>
|
||||
<bannerRight>
|
||||
<name>微信小程序</name>
|
||||
<title>微信小程序</title>
|
||||
<src>data:image/svg+xml;charset=UTF-8,%3csvg width='36' height='36' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M27.4362985 16.6454925c-.7072239 1.1607165-1.8835821 2.0505075-3.2927761 2.4601791-.0354627.0102687-.0705672.0212538-.1062687.0309254-.2176716.0618508-.4409552.0997015-.6622089.0997015-.9763582 0-1.5276418-.6594627-1.2315224-1.4730746.216597-.5949851.785194-1.097194 1.4791642-1.3296717 1.0755821-.3922388 1.8271044-1.2868059 1.8271044-2.3277612 0-1.4026268-1.3645373-2.5397014-3.0476417-2.5397014-1.6832239 0-3.0476418 1.1370746-3.0476418 2.5397014v7.788418c0 1.8730746-1.0852538 3.515582-2.709015 4.4445373-.8851343.506388-1.9277612.8040597-3.0475224.8040597-3.1743283 0-5.75665667-2.3545075-5.75665667-5.248597 0-.9211941.26340299-1.7863881.72238806-2.5397015.71032836-1.1658508 1.89397011-2.0586269 3.31164181-2.4656717.001194-.0003582.0022686-.0007164.0034627-.0010746.2390447-.0743881.4869253-.1157015.7313433-.1157015.9806567 0 1.5345671.6625672 1.2371343 1.4797612-.2015523.553791-.7443582 1.0306866-1.377194 1.2844179-.0755821.025194-.1491344.0534925-.2217314.0833433-1.0052537.4150448-1.6980298 1.2762985-1.6980298 2.2746269 0 1.4026268 1.3644179 2.539582 3.0476417 2.539582 1.6831045 0 3.0475224-1.1369552 3.0475224-2.539582v-7.788418c0-1.873194 1.0851344-3.515582 2.709015-4.44465667.8851343-.50638806 1.9277612-.8040597 3.0476418-.8040597 3.1742089 0 5.7566567 2.35450747 5.7566567 5.24871637 0 .9210747-.2635224 1.7863881-.7225075 2.5397015M18 2C9.16346269 2 2 9.16346269 2 18c0 8.8365373 7.16346269 16 16 16 8.8365373 0 16-7.1634627 16-16 0-8.83653731-7.1634627-16-16-16' fill='%2307C160' fill-rule='evenodd'/%3e%3c/svg%3e</src>
|
||||
<href>https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/backend-api.html</href>
|
||||
</bannerRight>
|
||||
<body>
|
||||
<links>
|
||||
<item name="微信官方文档 - 小程序 - 服务端 API"
|
||||
href="https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/backend-api.html" />
|
||||
</links>
|
||||
</body>
|
||||
</project>
|
||||
Loading…
x
Reference in New Issue
Block a user