Compare commits
125 Commits
revert-174
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 86f8654bbe | |||
| 0cb2fce609 | |||
| 09d44fdb5c | |||
| cbd66f7bb0 | |||
|
|
572048be6c | ||
|
|
b63b533b58 | ||
|
|
7f5ee2f774 | ||
|
|
256c797be8 | ||
|
|
10a346ca67 | ||
|
|
8d96e3c46f | ||
|
|
47da1be839 | ||
|
|
baec32d7e8 | ||
|
|
234ffc9319 | ||
|
|
aff957f27a | ||
|
|
17f5374096 | ||
|
|
b08c9df31d | ||
|
|
1edd1440b1 | ||
|
|
5ecd87336e | ||
|
|
8d5960980a | ||
|
|
bf8ca3a227 | ||
|
|
987dffb167 | ||
|
|
ce4019b20b | ||
|
|
754c4ebb16 | ||
|
|
72d623995d | ||
|
|
fddaceaa68 | ||
|
|
a2ab1a07c8 | ||
|
|
d489ce6ce5 | ||
|
|
ef358dd552 | ||
|
|
89f46d4a76 | ||
|
|
f1dfd57985 | ||
|
|
baa9e350ca | ||
|
|
2161f7d6e8 | ||
|
|
91f4aa7de8 | ||
|
|
0e3ad50414 | ||
|
|
dc53565ddc | ||
|
|
3939caad46 | ||
|
|
6a868e226a | ||
|
|
598b5926e9 | ||
|
|
88df988360 | ||
|
|
2c2ac96330 | ||
|
|
08ee4aba10 | ||
|
|
688aac49b0 | ||
|
|
2e5eb6c24d | ||
|
|
aaaefca14a | ||
|
|
649be79742 | ||
|
|
fa3d33bf83 | ||
|
|
68aae16984 | ||
|
|
b9afaf0ff3 | ||
|
|
7502a47e07 | ||
|
|
fd0cbab364 | ||
|
|
a40d41b0e2 | ||
|
|
04c6ac9e55 | ||
|
|
35bfd67c7e | ||
|
|
45042e8e3f | ||
|
|
e7be330b04 | ||
|
|
8409b3635c | ||
|
|
a481fb6a92 | ||
|
|
c7395e4a74 | ||
|
|
7fd6db2758 | ||
|
|
ee627cee44 | ||
|
|
2cdd2a7f4d | ||
|
|
e83c62824b | ||
|
|
9bb9918421 | ||
|
|
61b905d543 | ||
|
|
78a53b8016 | ||
|
|
1d0790ad4a | ||
|
|
431ef21964 | ||
|
|
91d880eb7f | ||
|
|
0107fd3a7c | ||
|
|
73d4642617 | ||
|
|
a2b23c237b | ||
|
|
7825a86fd1 | ||
|
|
4ababefb85 | ||
|
|
d6cb7bf87f | ||
|
|
b6acbaa0fc | ||
|
|
c530fb84ad | ||
|
|
41db5f7e53 | ||
|
|
b494c0a64f | ||
|
|
48eb468eb7 | ||
|
|
fe3e396113 | ||
|
|
8137ad4f20 | ||
|
|
d94b9acbb6 | ||
|
|
c2eebc2ad8 | ||
|
|
15819c7a43 | ||
|
|
9dcef8c596 | ||
|
|
d3044f045d | ||
|
|
e8ac8f594f | ||
|
|
9725ffe1cb | ||
|
|
57811ef3d5 | ||
|
|
3bb6250385 | ||
|
|
4bd6d6ded7 | ||
|
|
f4989813e5 | ||
|
|
f6d4900596 | ||
|
|
bf14039ead | ||
|
|
58f034d408 | ||
|
|
f539ff68d0 | ||
|
|
de87f2fe16 | ||
|
|
b9c2e548fb | ||
|
|
b57f7910ba | ||
|
|
68494712ae | ||
|
|
db698abb75 | ||
|
|
24bead1a8e | ||
|
|
f03c79a4ed | ||
|
|
40692a1948 | ||
|
|
2524f34c33 | ||
|
|
ab21a862a4 | ||
|
|
38b56fd552 | ||
|
|
d532097300 | ||
|
|
0414d54c1e | ||
|
|
fdc7f38d8c | ||
|
|
60e8efef65 | ||
|
|
cfd496d26f | ||
|
|
77b692e729 | ||
|
|
01c8bc0e03 | ||
|
|
ef3b50a19f | ||
|
|
1c62b5e665 | ||
|
|
86fc0712d0 | ||
|
|
3af2db29d9 | ||
|
|
e35dd62bc8 | ||
|
|
fadafb6302 | ||
|
|
33d02f794f | ||
|
|
7334cc925f | ||
|
|
b20e09ccf0 | ||
|
|
674ae6ffb0 | ||
|
|
9976bf7772 |
@ -1,6 +1,9 @@
|
||||
weixin4j
|
||||
========
|
||||
|
||||
[](https://maven-badges.herokuapp.com/maven-central/com.foxinmy/weixin4j/)
|
||||
[](https://www.apache.org/licenses/LICENSE-2.0.html)
|
||||
|
||||
微信开发工具包
|
||||
-------------
|
||||
> `weixin4j`是一个用Java编写针对微信开发的工具包,包含[weixin4j-mp](./weixin4j-mp)(微信公众平台API)、[weixin4j-qy](./weixin4j-qy)(微信企业号API)以及[weixin4j-server](./weixin4j-server)(微信回调消息服务器)三个工程.
|
||||
|
||||
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>
|
||||
196
pom.xml
196
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.0-SNAPSHOT</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>
|
||||
@ -45,31 +50,21 @@
|
||||
<module>weixin4j-qy</module>
|
||||
<module>weixin4j-wxa</module>
|
||||
<module>weixin4j-server</module>
|
||||
<module>weixin4j-example</module>
|
||||
<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>
|
||||
<!-- 过滤证书文件 -->
|
||||
@ -82,29 +77,27 @@
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>2.5</version>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>versions-maven-plugin</artifactId>
|
||||
<configuration>
|
||||
<rulesUri>file:///${session.executionRootDirectory}/maven-version-rules.xml</rulesUri>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-jar</id>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>jar</goal>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>verify</phase>
|
||||
<goals>
|
||||
<goal>report</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>
|
||||
<useDefaultManifestFile>true</useDefaultManifestFile>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
@ -144,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>
|
||||
@ -170,19 +155,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-site-plugin</artifactId>
|
||||
<version>3.7.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>
|
||||
@ -202,6 +174,16 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<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>
|
||||
<resources>
|
||||
@ -234,6 +216,22 @@
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jxr-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-pmd-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-report-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>findbugs-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</reporting>
|
||||
<profiles>
|
||||
@ -248,23 +246,105 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<configuration>
|
||||
<additionalparam>-Xdoclint:none</additionalparam>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<extensions>true</extensions>
|
||||
<configuration>
|
||||
<serverId>ossrh</serverId>
|
||||
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
|
||||
<autoReleaseAfterClose>true</autoReleaseAfterClose>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.sonatype.plugins</groupId>
|
||||
<artifactId>nexus-staging-maven-plugin</artifactId>
|
||||
<version>1.6.8</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
</profile>
|
||||
</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.8.2</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>
|
||||
@ -277,4 +357,4 @@
|
||||
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<skin>
|
||||
<groupId>org.apache.maven.skins</groupId>
|
||||
<artifactId>maven-fluido-skin</artifactId>
|
||||
<version>1.7</version>
|
||||
<version>1.9</version>
|
||||
</skin>
|
||||
<body>
|
||||
<menu ref="parent" inherit="top" />
|
||||
|
||||
@ -5,13 +5,43 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.9.0-SNAPSHOT</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</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.netty</groupId>
|
||||
<artifactId>netty-all</artifactId>
|
||||
<version>4.0.30.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>
|
||||
@ -71,5 +96,15 @@
|
||||
<version>3.0.2</version>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
<artifactId>bcprov-jdk16</artifactId>
|
||||
</dependency>
|
||||
<!-- 兼容 JDK 9+ 后的maven环境编译 -->
|
||||
<dependency>
|
||||
<groupId>javax.xml.bind</groupId>
|
||||
<artifactId>jaxb-api</artifactId>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
</project>
|
||||
|
||||
@ -45,7 +45,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
|
||||
* @see <a href=
|
||||
* "https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_1">
|
||||
* 企业付款</a>
|
||||
* @deprecated 商户平台API迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CashApi extends MchApi {
|
||||
|
||||
public CashApi(WeixinPayAccount weixinAccount) {
|
||||
@ -92,7 +94,7 @@ public class CashApi extends MchApi {
|
||||
/**
|
||||
* 批量发放红包 企业向微信用户个人发现金红包
|
||||
*
|
||||
* @param redpacket
|
||||
* @param redpackets
|
||||
* 多个红包信息
|
||||
* @return 发放结果
|
||||
* @see #sendRedpacks(Redpacket...)
|
||||
|
||||
@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
|
||||
* @since JDK 1.6
|
||||
* @see <a href=
|
||||
* "https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_1">代金券</a>
|
||||
* @deprecated 商户平台API迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CouponApi extends MchApi {
|
||||
|
||||
public CouponApi(WeixinPayAccount weixinAccount) {
|
||||
|
||||
@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
|
||||
* @date 2016年3月67日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 商户平台API迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CustomsApi extends MchApi {
|
||||
|
||||
public CustomsApi(WeixinPayAccount weixinAccount) {
|
||||
|
||||
@ -27,11 +27,15 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
* @date 2016年3月26日
|
||||
* @since JDK 1.6
|
||||
* @see <a href="https://pay.weixin.qq.com/wiki/doc/api/index.html">商户支付平台</a>
|
||||
* @deprecated 商户平台API迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class MchApi extends BaseApi {
|
||||
|
||||
private final static ResourceBundle WEIXIN_BUNDLE;
|
||||
|
||||
private final static String PEM_CERT_PREFIX = "-----BEGIN CERTIFICATE-----";
|
||||
|
||||
static {
|
||||
WEIXIN_BUNDLE = ResourceBundle.getBundle("com/foxinmy/weixin4j/payment/weixin");
|
||||
}
|
||||
@ -93,21 +97,28 @@ public class MchApi extends BaseApi {
|
||||
*/
|
||||
protected WeixinRequestExecutor getWeixinSSLExecutor() throws WeixinException {
|
||||
if (weixinSSLExecutor == null) {
|
||||
try {
|
||||
InputStream is = null;
|
||||
File certificate = new File(
|
||||
Weixin4jConfigUtil.replaceClassPathValue(weixinAccount.getCertificateFile()));
|
||||
if (!certificate.exists() || !certificate.isFile()) {
|
||||
is = Weixin4jConfigUtil.CLASSLOADER.getResourceAsStream(certificate.getName());
|
||||
} else {
|
||||
is = new FileInputStream(certificate);
|
||||
if(weixinAccount.getCertificateFile().startsWith(PEM_CERT_PREFIX)){
|
||||
// 证书是PEM格式,直接使用PEM内容生成请求执行类
|
||||
this.weixinSSLExecutor = weixinExecutor.createSSLRequestExecutor(weixinAccount.getMchId(),
|
||||
weixinAccount.getCertificateFile(), weixinAccount.getCertificateKey());
|
||||
}else {
|
||||
// 证书是p12格式,读取证书文件并生成请求执行类
|
||||
try {
|
||||
InputStream is = null;
|
||||
File certificate = new File(
|
||||
Weixin4jConfigUtil.replaceClassPathValue(weixinAccount.getCertificateFile()));
|
||||
if (!certificate.exists() || !certificate.isFile()) {
|
||||
is = Weixin4jConfigUtil.CLASSLOADER.getResourceAsStream(certificate.getName());
|
||||
} else {
|
||||
is = new FileInputStream(certificate);
|
||||
}
|
||||
if (is == null) {
|
||||
throw new WeixinException("Invalid certificate file : " + certificate.toString());
|
||||
}
|
||||
this.weixinSSLExecutor = weixinExecutor.createSSLRequestExecutor(weixinAccount.getCertificateKey(), is);
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException("IO Error on createSSLRequestExecutor", e);
|
||||
}
|
||||
if (is == null) {
|
||||
throw new WeixinException("Invalid certificate file : " + certificate.toString());
|
||||
}
|
||||
this.weixinSSLExecutor = weixinExecutor.createSSLRequestExecutor(weixinAccount.getCertificateKey(), is);
|
||||
} catch (IOException e) {
|
||||
throw new WeixinException("IO Error on createSSLRequestExecutor", e);
|
||||
}
|
||||
}
|
||||
return this.weixinSSLExecutor;
|
||||
|
||||
@ -60,7 +60,9 @@ import com.foxinmy.weixin4j.xml.XmlStream;
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2014年10月28日
|
||||
* @since JDK 1.6
|
||||
* @deprecated 商户平台API迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class PayApi extends MchApi {
|
||||
|
||||
public PayApi(WeixinPayAccount weixinAccount) {
|
||||
|
||||
@ -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保存缓存对象(推荐使用)
|
||||
|
||||
@ -17,11 +17,19 @@ public final class HttpParams {
|
||||
/**
|
||||
* 连接超时时间(单位毫秒)
|
||||
*/
|
||||
private int connectTimeout;
|
||||
private final int connectTimeout;
|
||||
/**
|
||||
* 读取超时时间(单位毫秒)
|
||||
*/
|
||||
private int readTimeout;
|
||||
private final int readTimeout;
|
||||
/**
|
||||
* 最大连接数
|
||||
*/
|
||||
private final int maxConnections;
|
||||
/**
|
||||
* 每个host最大连接数
|
||||
*/
|
||||
private final int maxConnectionsPerHost;
|
||||
/**
|
||||
* 代理对象
|
||||
*/
|
||||
@ -36,15 +44,17 @@ public final class HttpParams {
|
||||
private HostnameVerifier hostnameVerifier;
|
||||
|
||||
/**
|
||||
* connectTimeout = 15000,readTimeout=20000
|
||||
* connectTimeout = 15000,readTimeout=20000,maxConnection=100,maxConnectionPerHost=32
|
||||
*/
|
||||
public HttpParams() {
|
||||
this(5000, 15000);
|
||||
this(5000, 15000,100,32);
|
||||
}
|
||||
|
||||
public HttpParams(int connectTimeout, int readTimeout) {
|
||||
public HttpParams(int connectTimeout, int readTimeout,int maxConnections,int maxConnectionsPerHost) {
|
||||
this.connectTimeout = connectTimeout;
|
||||
this.readTimeout = readTimeout;
|
||||
this.maxConnections = maxConnections;
|
||||
this.maxConnectionsPerHost = maxConnectionsPerHost;
|
||||
}
|
||||
|
||||
public int getConnectTimeout() {
|
||||
@ -55,6 +65,14 @@ public final class HttpParams {
|
||||
return readTimeout;
|
||||
}
|
||||
|
||||
public int getMaxConnections() {
|
||||
return maxConnections;
|
||||
}
|
||||
|
||||
public int getMaxConnectionsPerHost() {
|
||||
return maxConnectionsPerHost;
|
||||
}
|
||||
|
||||
public Proxy getProxy() {
|
||||
return proxy;
|
||||
}
|
||||
@ -84,7 +102,7 @@ public final class HttpParams {
|
||||
|
||||
public static HttpParams copy(final HttpParams params) {
|
||||
return new HttpParams(params.getConnectTimeout(),
|
||||
params.getReadTimeout()).setProxy(params.getProxy())
|
||||
params.getReadTimeout(),params.getMaxConnections(),params.getMaxConnectionsPerHost()).setProxy(params.getProxy())
|
||||
.setHostnameVerifier(params.getHostnameVerifier())
|
||||
.setSSLContext(params.getSSLContext());
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.net.InetSocketAddress;
|
||||
import org.apache.commons.httpclient.HttpClient;
|
||||
import org.apache.commons.httpclient.HttpConnectionManager;
|
||||
import org.apache.commons.httpclient.MultiThreadedHttpConnectionManager;
|
||||
import org.apache.commons.httpclient.params.HttpConnectionManagerParams;
|
||||
import org.apache.commons.httpclient.protocol.Protocol;
|
||||
|
||||
import com.foxinmy.weixin4j.http.HttpParams;
|
||||
@ -62,8 +63,10 @@ public class HttpComponent3Factory extends HttpClientFactory {
|
||||
new SSLProtocolSocketFactory(params.getSSLContext()),
|
||||
443));
|
||||
}
|
||||
httpClient.getHttpConnectionManager().getParams()
|
||||
.setConnectionTimeout(params.getConnectTimeout());
|
||||
HttpConnectionManagerParams params_ = httpClient.getHttpConnectionManager().getParams();
|
||||
params_.setMaxTotalConnections(params.getMaxConnections());
|
||||
params_.setDefaultMaxConnectionsPerHost(params.getMaxConnectionsPerHost());
|
||||
params_.setConnectionTimeout(params.getConnectTimeout());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -40,14 +40,9 @@ public class HttpComponent4_1Factory extends HttpClientFactory {
|
||||
*
|
||||
* @see <a
|
||||
* href="https://issues.apache.org/jira/browse/HTTPCLIENT-1193">HTTPCLIENT-1193</a>
|
||||
* @param clientConnectionManager
|
||||
*/
|
||||
public HttpComponent4_1Factory() {
|
||||
PoolingClientConnectionManager clientConnectionManager = new PoolingClientConnectionManager();
|
||||
clientConnectionManager.setMaxTotal(30);
|
||||
clientConnectionManager.setDefaultMaxPerRoute(clientConnectionManager
|
||||
.getMaxTotal());
|
||||
httpClient = new DefaultHttpClient(clientConnectionManager);
|
||||
httpClient = new DefaultHttpClient(new PoolingClientConnectionManager());
|
||||
httpClient.getParams().setParameter(
|
||||
CoreProtocolPNames.HTTP_CONTENT_CHARSET, Consts.UTF_8);
|
||||
httpClient.getParams().setParameter(
|
||||
@ -110,6 +105,11 @@ public class HttpComponent4_1Factory extends HttpClientFactory {
|
||||
httpClient.getConnectionManager().getSchemeRegistry()
|
||||
.register(scheme);
|
||||
}
|
||||
ClientConnectionManager connectionManager = httpClient.getConnectionManager();
|
||||
if(connectionManager instanceof PoolingClientConnectionManager){
|
||||
((PoolingClientConnectionManager) connectionManager).setMaxTotal(params.getMaxConnections());
|
||||
((PoolingClientConnectionManager) connectionManager).setDefaultMaxPerRoute(params.getMaxConnectionsPerHost());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -99,6 +99,8 @@ public class HttpComponent4_2Factory extends HttpClientFactory {
|
||||
clientBuilder.setHostnameVerifier(new CustomHostnameVerifier(
|
||||
params.getHostnameVerifier()));
|
||||
}
|
||||
clientBuilder.setMaxConnTotal(params.getMaxConnections());
|
||||
clientBuilder.setMaxConnPerRoute(params.getMaxConnectionsPerHost());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -50,6 +50,8 @@ public class OkHttpClient2Factory extends HttpClientFactory {
|
||||
if (params.getHostnameVerifier() != null) {
|
||||
okClient.setHostnameVerifier(params.getHostnameVerifier());
|
||||
}
|
||||
okClient.getDispatcher().setMaxRequests(params.getMaxConnections());
|
||||
okClient.getDispatcher().setMaxRequestsPerHost(params.getMaxConnectionsPerHost());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -60,6 +60,10 @@ public class OkHttpClient3Factory extends HttpClientFactory {
|
||||
if (params.getHostnameVerifier() != null) {
|
||||
clientBuilder.hostnameVerifier(params.getHostnameVerifier());
|
||||
}
|
||||
Dispatcher dispatcher = new Dispatcher();
|
||||
dispatcher.setMaxRequests(params.getMaxConnections());
|
||||
dispatcher.setMaxRequestsPerHost(params.getMaxConnectionsPerHost());
|
||||
clientBuilder.dispatcher(dispatcher);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,12 +1,22 @@
|
||||
package com.foxinmy.weixin4j.http.weixin;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.security.KeyStore;
|
||||
import java.security.*;
|
||||
import java.security.cert.CertificateFactory;
|
||||
import java.security.interfaces.RSAPrivateKey;
|
||||
import java.security.spec.InvalidKeySpecException;
|
||||
import java.security.spec.PKCS8EncodedKeySpec;
|
||||
import java.util.Arrays;
|
||||
|
||||
import javax.net.ssl.KeyManagerFactory;
|
||||
import javax.net.ssl.SSLContext;
|
||||
import java.security.cert.CertificateException;
|
||||
import java.security.cert.X509Certificate;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import javax.xml.bind.DatatypeConverter;
|
||||
|
||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.http.HttpClient;
|
||||
@ -29,6 +39,9 @@ import com.foxinmy.weixin4j.logging.InternalLogLevel;
|
||||
import com.foxinmy.weixin4j.logging.InternalLogger;
|
||||
import com.foxinmy.weixin4j.logging.InternalLoggerFactory;
|
||||
import com.foxinmy.weixin4j.util.Consts;
|
||||
import com.foxinmy.weixin4j.util.StringUtil;
|
||||
import org.bouncycastle.jce.provider.BouncyCastleProvider;
|
||||
import static java.util.regex.Pattern.CASE_INSENSITIVE;
|
||||
|
||||
/**
|
||||
* 负责微信请求的执行
|
||||
@ -56,6 +69,18 @@ public class WeixinRequestExecutor {
|
||||
this.httpClient = HttpClientFactory.getInstance(params);
|
||||
}
|
||||
|
||||
private static final Pattern CERT_PATTERN = Pattern.compile(
|
||||
"-+BEGIN\\s+.*CERTIFICATE[^-]*-+(?:\\s|\\r|\\n)+" + // Header
|
||||
"([a-z0-9+/=\\r\\n]+)" + // Base64 text
|
||||
"-+END\\s+.*CERTIFICATE[^-]*-+", // Footer
|
||||
CASE_INSENSITIVE);
|
||||
|
||||
private static final Pattern KEY_PATTERN = Pattern.compile(
|
||||
"-+BEGIN\\s+.*PRIVATE\\s+KEY[^-]*-+(?:\\s|\\r|\\n)+" + // Header
|
||||
"([a-z0-9+/=\\r\\n]+)" + // Base64 text
|
||||
"-+END\\s+.*PRIVATE\\s+KEY[^-]*-+", // Footer
|
||||
CASE_INSENSITIVE);
|
||||
|
||||
/**
|
||||
* Post方法执行微信请求
|
||||
*
|
||||
@ -194,10 +219,13 @@ public class WeixinRequestExecutor {
|
||||
try {
|
||||
XmlResult xmlResult = XmlMessageConverter.GLOBAL.convert(
|
||||
XmlResult.class, response);
|
||||
if (!SUCCESS_CODE.contains(String.format(",%s,", xmlResult
|
||||
.getResultCode().toLowerCase()))) {
|
||||
throw new WeixinException(xmlResult.getErrCode(),
|
||||
xmlResult.getErrCodeDes());
|
||||
// 微信最新的刷脸支付API中已没有返回resultCode,需做非空判断,否则抛异常
|
||||
if(StringUtil.isNotBlank(xmlResult.getResultCode())) {
|
||||
if (!SUCCESS_CODE.contains(String.format(",%s,", xmlResult
|
||||
.getResultCode().toLowerCase()))) {
|
||||
throw new WeixinException(xmlResult.getErrCode(),
|
||||
xmlResult.getErrCodeDes());
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
;
|
||||
@ -250,4 +278,69 @@ public class WeixinRequestExecutor {
|
||||
params.setSSLContext(sslContext);
|
||||
return new WeixinRequestExecutor(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用PEM格式证书创建SSL微信请求对象
|
||||
*
|
||||
* @param pemCertificate
|
||||
* PEM格式证书内容
|
||||
* @param pemPrivateKey
|
||||
* PEM格式证书私钥
|
||||
* @return
|
||||
*/
|
||||
public WeixinRequestExecutor createSSLRequestExecutor(String password, String pemCertificate, String pemPrivateKey) throws WeixinException{
|
||||
Security.addProvider(new BouncyCastleProvider());
|
||||
|
||||
try {
|
||||
byte[] certBytes = parseDERFromPEM(pemCertificate);
|
||||
byte[] keyBytes = parseDERFromPEM(pemPrivateKey);
|
||||
|
||||
char[] passwordChars = password.toCharArray();
|
||||
X509Certificate cert = generateCertificateFromDER(certBytes);
|
||||
RSAPrivateKey key = generatePrivateKeyFromDER(keyBytes);
|
||||
|
||||
KeyStore keystore = KeyStore.getInstance("JKS");
|
||||
keystore.load(null);
|
||||
keystore.setCertificateEntry("cert-alias", cert);
|
||||
keystore.setKeyEntry("key-alias", key, passwordChars, new X509Certificate[] {cert});
|
||||
|
||||
KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509");
|
||||
kmf.init(keystore, passwordChars);
|
||||
|
||||
SSLContext context = SSLContext.getInstance("TLS");
|
||||
context.init(kmf.getKeyManagers(), null, new java.security.SecureRandom());
|
||||
|
||||
return createSSLRequestExecutor(context);
|
||||
} catch (Exception e) {
|
||||
throw new WeixinException("Certificate load error", e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static byte[] parseDERFromPEM(String data) throws KeyStoreException {
|
||||
Matcher matcher = CERT_PATTERN.matcher(data);
|
||||
String content = "";
|
||||
if(!matcher.find()){
|
||||
matcher = KEY_PATTERN.matcher(data);
|
||||
if(!matcher.find()){
|
||||
throw new KeyStoreException("found no private key or certificate from content:"+ data);
|
||||
}
|
||||
}
|
||||
content = matcher.group(1);
|
||||
return DatatypeConverter.parseBase64Binary(content);
|
||||
}
|
||||
|
||||
private static RSAPrivateKey generatePrivateKeyFromDER(byte[] keyBytes) throws InvalidKeySpecException, NoSuchAlgorithmException {
|
||||
PKCS8EncodedKeySpec spec = new PKCS8EncodedKeySpec(keyBytes);
|
||||
|
||||
KeyFactory factory = KeyFactory.getInstance("RSA");
|
||||
|
||||
return (RSAPrivateKey)factory.generatePrivate(spec);
|
||||
}
|
||||
|
||||
protected static X509Certificate generateCertificateFromDER(byte[] certBytes) throws CertificateException {
|
||||
CertificateFactory factory = CertificateFactory.getInstance("X.509");
|
||||
|
||||
return (X509Certificate)factory.generateCertificate(new ByteArrayInputStream(certBytes));
|
||||
}
|
||||
}
|
||||
|
||||
@ -68,6 +68,10 @@ public class XmlResult implements Serializable {
|
||||
return resultCode;
|
||||
}
|
||||
|
||||
public void setReturnCode(String returnCode) {
|
||||
this.returnCode = returnCode;
|
||||
}
|
||||
|
||||
public String getErrCode() {
|
||||
return errCode;
|
||||
}
|
||||
@ -84,6 +88,10 @@ public class XmlResult implements Serializable {
|
||||
return returnMsg;
|
||||
}
|
||||
|
||||
public void setReturnMsg(String returnMsg) {
|
||||
this.returnMsg = returnMsg;
|
||||
}
|
||||
|
||||
public void setResultCode(String resultCode) {
|
||||
this.resultCode = resultCode;
|
||||
}
|
||||
|
||||
@ -15,23 +15,41 @@ package com.foxinmy.weixin4j.jssdk;
|
||||
* 企业号JSSDK</a>
|
||||
*/
|
||||
public enum JSSDKAPI {
|
||||
/**
|
||||
* <a href=
|
||||
* "https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#111">
|
||||
* 自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)</a>
|
||||
*/
|
||||
updateAppMessageShareData,
|
||||
/**
|
||||
* <a href=
|
||||
* "https://developers.weixin.qq.com/doc/offiaccount/OA_Web_Apps/JS-SDK.html#112">
|
||||
* 自定义“分享给朋友”及“分享到QQ”按钮的分享内容(1.4.0)</a>
|
||||
*/
|
||||
updateTimelineShareData,
|
||||
/***
|
||||
* <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0.E6.9C.8B.E5.8F.8B.E5.9C.88.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
|
||||
* >分享接口-获取“分享到朋友圈”按钮点击状态及自定义分享内容接口</a>
|
||||
* >分享接口-获取“分享到朋友圈”按钮点击状态及自定义分享内容接口(即将废弃)</a>
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
onMenuShareTimeline,
|
||||
/***
|
||||
* <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E7.BB.99.E6.9C.8B.E5.8F.8B.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
|
||||
* >分享接口-获取“分享给朋友”按钮点击状态及自定义分享内容接口</a>
|
||||
* >分享接口-获取“分享给朋友”按钮点击状态及自定义分享内容接口(即将废弃)</a>
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
onMenuShareAppMessage,
|
||||
/***
|
||||
* <a href=
|
||||
* "http://mp.weixin.qq.com/wiki/11/74ad127cc054f6b80759c40f77ec03db.html#.E8.8E.B7.E5.8F.96.E2.80.9C.E5.88.86.E4.BA.AB.E5.88.B0QQ.E2.80.9D.E6.8C.89.E9.92.AE.E7.82.B9.E5.87.BB.E7.8A.B6.E6.80.81.E5.8F.8A.E8.87.AA.E5.AE.9A.E4.B9.89.E5.88.86.E4.BA.AB.E5.86.85.E5.AE.B9.E6.8E.A5.E5.8F.A3"
|
||||
* >分享接口-获取“分享到QQ”按钮点击状态及自定义分享内容接口</a>
|
||||
* >分享接口-获取“分享到QQ”按钮点击状态及自定义分享内容接口(即将废弃)</a>
|
||||
* @deprecated
|
||||
*/
|
||||
@Deprecated
|
||||
onMenuShareQQ,
|
||||
/***
|
||||
* <a href=
|
||||
@ -270,8 +288,12 @@ public enum JSSDKAPI {
|
||||
/**
|
||||
* 分享接口集合
|
||||
*/
|
||||
@Deprecated
|
||||
public final static JSSDKAPI[] SHARE_APIS = { onMenuShareTimeline, onMenuShareAppMessage, onMenuShareQQ,
|
||||
onMenuShareWeibo, onMenuShareQZone };
|
||||
|
||||
public final static JSSDKAPI[] ALL_SHARE_APIS = { updateAppMessageShareData, updateTimelineShareData,
|
||||
onMenuShareWeibo, onMenuShareQZone };
|
||||
/**
|
||||
* 图像接口集合
|
||||
*/
|
||||
|
||||
@ -16,6 +16,10 @@
|
||||
package com.foxinmy.weixin4j.logging;
|
||||
|
||||
|
||||
import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
|
||||
import java.util.logging.ConsoleHandler;
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
|
||||
/**
|
||||
@ -27,6 +31,15 @@ public class JdkLoggerFactory extends InternalLoggerFactory {
|
||||
|
||||
@Override
|
||||
public InternalLogger newInstance(String name) {
|
||||
return new JdkLogger(Logger.getLogger(name));
|
||||
Logger logger = Logger.getLogger(name);
|
||||
Level level = Weixin4jConfigUtil.getJdkLoggerLevel();
|
||||
logger.setLevel(level);
|
||||
if(logger.getHandlers().length==0) {
|
||||
ConsoleHandler consoleHandler = new ConsoleHandler();
|
||||
consoleHandler.setLevel(level);
|
||||
logger.addHandler(consoleHandler);
|
||||
}
|
||||
|
||||
return new JdkLogger(logger);
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,7 +12,9 @@ import com.foxinmy.weixin4j.util.StringUtil;
|
||||
* @date 2015年6月26日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 支付相关的类现已迁移到weixin4j-pay子模块
|
||||
*/
|
||||
@Deprecated
|
||||
public class WeixinPayAccount extends WeixinAccount {
|
||||
|
||||
private static final long serialVersionUID = -2791256176906048632L;
|
||||
|
||||
@ -38,6 +38,30 @@ public final class CardCoupons {
|
||||
public static MemberCard.Builder customMemberCard(){
|
||||
return new MemberCard.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡信息构造器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static GiftCard.Builder customGiftCard() {
|
||||
return new GiftCard.Builder();
|
||||
}
|
||||
|
||||
/**
|
||||
* 礼品卡货架主题信息构造器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static PageTheme.Builder customCardPageTheme(){ return new PageTheme.Builder(); }
|
||||
|
||||
/**
|
||||
* 礼品卡货架信息构造器
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public static GiftCardPage.Builder customCardPage(){ return new GiftCardPage.Builder(); }
|
||||
|
||||
/**
|
||||
* 创建代金券
|
||||
*
|
||||
@ -122,4 +146,32 @@ public final class CardCoupons {
|
||||
MemberCard memberCard = new MemberCard(baseBuilder.build(), memberCardBudiler);
|
||||
return memberCard;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建单品类礼品卡
|
||||
*
|
||||
* @param baseBuilder
|
||||
* 卡券基础信息构造器 必填
|
||||
* @param giftCardBuilder
|
||||
* 礼品卡自身参数构造器 必填
|
||||
* @return
|
||||
*/
|
||||
public static VoucherCard createVoucherCard(CouponBaseInfo.Builder baseBuilder, GiftCard.Builder giftCardBuilder){
|
||||
baseBuilder.build();
|
||||
VoucherCard voucherCard = new VoucherCard(baseBuilder.build(), giftCardBuilder);
|
||||
return voucherCard;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建储值类礼品卡
|
||||
*
|
||||
* @param baseBuilder
|
||||
* @param giftCardBuilder
|
||||
* @return
|
||||
*/
|
||||
public static GiftCard createGiftCard(CouponBaseInfo.Builder baseBuilder, GiftCard.Builder giftCardBuilder){
|
||||
baseBuilder.build();
|
||||
GiftCard giftCard = new GiftCard(baseBuilder.build(), giftCardBuilder);
|
||||
return giftCard;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,183 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 已领取的礼品卡信息
|
||||
* 用于查询用户的礼品卡信息时,作为参数或返回对象
|
||||
*
|
||||
* @author kit (kit@muses.cc)
|
||||
* @date 2018-11-23
|
||||
*/
|
||||
public class CardInfo {
|
||||
/**
|
||||
* 礼品卡的code
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 礼品卡的card_id
|
||||
*/
|
||||
@JSONField(name = "card_id")
|
||||
private String cardId;
|
||||
/**
|
||||
* 生效时间
|
||||
*/
|
||||
@JSONField(name = "begin_time")
|
||||
private long beginTime;
|
||||
/**
|
||||
* 结束时间
|
||||
*/
|
||||
@JSONField(name = "end_time")
|
||||
private long endTime;
|
||||
/**
|
||||
* 当前的余额额度
|
||||
*/
|
||||
private int balance;
|
||||
/**
|
||||
* 礼品卡卡面显示的卡号,若没设置则与code相同
|
||||
*/
|
||||
@JSONField(name = "card_number")
|
||||
private String cardNumber;
|
||||
/**
|
||||
* 用于支持商家激活时针对单个礼品卡分配自定义的礼品卡背景。
|
||||
*/
|
||||
@JSONField(name = "background_pic_url")
|
||||
private String backgroundPicUrl;
|
||||
/**
|
||||
* 自定义金额消耗记录,不超过14个汉字。
|
||||
*/
|
||||
@JSONField(name = "record_balance")
|
||||
private String recordBalance;
|
||||
/**
|
||||
* 创建时字段custom_field1定义类型的最新数值,限制为4个汉字,12字节。
|
||||
*/
|
||||
@JSONField(name = "custom_field_value1")
|
||||
private String customFieldValue1;
|
||||
/**
|
||||
* 创建时字段custom_field2定义类型的最新数值,限制为4个汉字,12字节。
|
||||
*/
|
||||
@JSONField(name = "custom_field_value2")
|
||||
private String customFieldValue2;
|
||||
/**
|
||||
* 创建时字段custom_field3定义类型的最新数值,限制为4个汉字,12字节。
|
||||
*/
|
||||
@JSONField(name = "custom_field_value3")
|
||||
private String customFieldValue3;
|
||||
/**
|
||||
* 控制本次积分变动后转赠入口是否出现
|
||||
*/
|
||||
@JSONField(name = "can_give_friend")
|
||||
private Boolean canGiveFriend;
|
||||
/**
|
||||
* 该卡的价格
|
||||
*/
|
||||
private int price;
|
||||
/**
|
||||
* 祝福语
|
||||
*/
|
||||
@JSONField(name = "default_gifting_msg")
|
||||
private String defaultGiftingMsg;
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getCardId() {
|
||||
return cardId;
|
||||
}
|
||||
|
||||
public void setCardId(String cardId) {
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
public long getBeginTime() {
|
||||
return beginTime;
|
||||
}
|
||||
|
||||
public void setBeginTime(long beginTime) {
|
||||
this.beginTime = beginTime;
|
||||
}
|
||||
|
||||
public long getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public void setEndTime(long endTime) {
|
||||
this.endTime = endTime;
|
||||
}
|
||||
|
||||
public int getBalance() {
|
||||
return balance;
|
||||
}
|
||||
|
||||
public void setBalance(int balance) {
|
||||
this.balance = balance;
|
||||
}
|
||||
|
||||
public String getCardNumber() {
|
||||
return cardNumber;
|
||||
}
|
||||
|
||||
public void setCardNumber(String cardNumber) {
|
||||
this.cardNumber = cardNumber;
|
||||
}
|
||||
|
||||
public String getBackgroundPicUrl() {
|
||||
return backgroundPicUrl;
|
||||
}
|
||||
|
||||
public void setBackgroundPicUrl(String backgroundPicUrl) {
|
||||
this.backgroundPicUrl = backgroundPicUrl;
|
||||
}
|
||||
|
||||
public String getRecordBalance() {
|
||||
return recordBalance;
|
||||
}
|
||||
|
||||
public void setRecordBalance(String recordBalance) {
|
||||
this.recordBalance = recordBalance;
|
||||
}
|
||||
|
||||
public String getCustomFieldValue1() {
|
||||
return customFieldValue1;
|
||||
}
|
||||
|
||||
public void setCustomFieldValue1(String customFieldValue1) {
|
||||
this.customFieldValue1 = customFieldValue1;
|
||||
}
|
||||
|
||||
public String getCustomFieldValue2() {
|
||||
return customFieldValue2;
|
||||
}
|
||||
|
||||
public void setCustomFieldValue2(String customFieldValue2) {
|
||||
this.customFieldValue2 = customFieldValue2;
|
||||
}
|
||||
|
||||
public String getCustomFieldValue3() {
|
||||
return customFieldValue3;
|
||||
}
|
||||
|
||||
public void setCustomFieldValue3(String customFieldValue3) {
|
||||
this.customFieldValue3 = customFieldValue3;
|
||||
}
|
||||
|
||||
public Boolean getCanGiveFriend() {
|
||||
return canGiveFriend;
|
||||
}
|
||||
|
||||
public void setCanGiveFriend(Boolean canGiveFriend) {
|
||||
this.canGiveFriend = canGiveFriend;
|
||||
}
|
||||
|
||||
public void CardItem(){}
|
||||
|
||||
public void CardItem(String code, String cardId){
|
||||
this.code = code;
|
||||
this.cardId = cardId;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 礼品卡货架主题内的礼品卡描述项
|
||||
*
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月30日
|
||||
*/
|
||||
public class CardItem {
|
||||
/**
|
||||
* 待上架的card_id
|
||||
*/
|
||||
@JSONField(name = "card_id")
|
||||
private String cardId;
|
||||
/**
|
||||
* 商品名,不填写默认为卡名称
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 商品缩略图,1000像素*600像素以下
|
||||
*/
|
||||
@JSONField(name = "pic_url")
|
||||
private String picUrl;
|
||||
/**
|
||||
* 商品简介
|
||||
*/
|
||||
private String desc;
|
||||
|
||||
public CardItem(){
|
||||
|
||||
}
|
||||
|
||||
public CardItem(String cardId) {
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
public CardItem(String cardId, String title, String picUrl, String desc) {
|
||||
this.cardId = cardId;
|
||||
this.title = title;
|
||||
this.picUrl = picUrl;
|
||||
this.desc = desc;
|
||||
}
|
||||
|
||||
public String getCardId() {
|
||||
return cardId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getPicUrl() {
|
||||
return picUrl;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public void setCardId(String cardId) {
|
||||
this.cardId = cardId;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setPicUrl(String picUrl) {
|
||||
this.picUrl = picUrl;
|
||||
}
|
||||
|
||||
public void setDesc(String desc) {
|
||||
this.desc = desc;
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,18 @@ import com.foxinmy.weixin4j.type.card.CardColor;
|
||||
*/
|
||||
public class CouponBaseInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5725424121330101716L;
|
||||
private static final long serialVersionUID = -5725424121330101717L;
|
||||
|
||||
/**
|
||||
* 礼品卡信息,目前只有一个价格属性,礼品卡时必填
|
||||
*/
|
||||
@JSONField(name = "giftcard_info")
|
||||
private JSONObject giftcardInfo;
|
||||
/**
|
||||
* 礼品卡最大可赠送次数,必填
|
||||
*/
|
||||
@JSONField(name = "max_give_friend_times")
|
||||
private int maxGiveFriendTimes;
|
||||
/**
|
||||
* 卡券的商户logo,建议像素为300*300。
|
||||
*/
|
||||
@ -71,7 +82,7 @@ public class CouponBaseInfo implements Serializable {
|
||||
@JSONField(name = "use_custom_code")
|
||||
private Boolean useCustomCode;
|
||||
/**
|
||||
* 指定特殊用户群体
|
||||
* 指定特殊用户群体,礼品卡建议填写false
|
||||
*/
|
||||
@JSONField(name = "bind_openid")
|
||||
private Boolean bindOpenId;
|
||||
@ -140,12 +151,12 @@ public class CouponBaseInfo implements Serializable {
|
||||
*/
|
||||
private String source;
|
||||
/**
|
||||
* 每人可领券的数量限制,不填写默认为50。
|
||||
* 每人可领券的数量限制,不填写默认为50。礼品卡时须填0,不限制
|
||||
*/
|
||||
@JSONField(name = "get_limit")
|
||||
private int limitNum;
|
||||
/**
|
||||
* 卡券领取页面是否可分享
|
||||
* 卡券领取页面是否可分享,礼品卡建议填写false
|
||||
*/
|
||||
@JSONField(name = "can_share")
|
||||
private boolean canShare;
|
||||
@ -157,9 +168,41 @@ public class CouponBaseInfo implements Serializable {
|
||||
|
||||
@JSONField(name = "need_push_on_view")
|
||||
private Boolean needPushOnView;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序username,格式为公众号原始id@app。如:gh_86a091e50ad4@app 选填
|
||||
*/
|
||||
@JSONField(name = "center_app_brand_user_name")
|
||||
private String centerAppBrandUserName;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序路径. 如:pages/index/index 选填
|
||||
*/
|
||||
@JSONField(name = "center_app_brand_pass")
|
||||
private String centerAppBrandPass;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序username,格式为公众号原始id@app 选填
|
||||
*/
|
||||
@JSONField(name = "custom_app_brand_user_name")
|
||||
private String customAppBrandUserName;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序路径。选填
|
||||
*/
|
||||
@JSONField(name = "custom_app_brand_pass")
|
||||
private String customAppBrandPass;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序username,格式为公众号原始id@app 选填
|
||||
*/
|
||||
@JSONField(name = "promotion_app_brand_user_name")
|
||||
private String promotionAppBrandUserName;
|
||||
/**
|
||||
* 礼品卡用属性,自定义cell对应的小程序路径
|
||||
*/
|
||||
@JSONField(name = "promotion_app_brand_pass")
|
||||
private String promotionAppBrandPass;
|
||||
|
||||
private CouponBaseInfo(Builder builder) {
|
||||
this.giftcardInfo = builder.giftcardInfo;
|
||||
this.logoUrl = builder.logoUrl;
|
||||
this.maxGiveFriendTimes = builder.maxGiveFriendTimes;
|
||||
this.brandName = builder.brandName;
|
||||
this.title = builder.title;
|
||||
this.codeType = builder.codeType;
|
||||
@ -176,12 +219,18 @@ public class CouponBaseInfo implements Serializable {
|
||||
this.centerTitle = builder.centerTitle;
|
||||
this.centerUrl = builder.centerUrl;
|
||||
this.centerSubTitle = builder.centerSubTitle;
|
||||
this.centerAppBrandUserName = builder.centerAppBrandUserName;
|
||||
this.centerAppBrandPass = builder.centerAppBrandPass;
|
||||
this.customTitle = builder.customTitle;
|
||||
this.customUrl = builder.customUrl;
|
||||
this.customSubTitle = builder.customSubTitle;
|
||||
this.customAppBrandUserName = builder.customAppBrandUserName;
|
||||
this.customAppBrandPass = builder.customAppBrandPass;
|
||||
this.promotionTitle = builder.promotionTitle;
|
||||
this.promotionUrl = builder.promotionUrl;
|
||||
this.promotionSubTitle = builder.promotionSubTitle;
|
||||
this.promotionAppBrandUserName = builder.promotionAppBrandUserName;
|
||||
this.promotionAppBrandPass = builder.promotionAppBrandPass;
|
||||
this.source = builder.source;
|
||||
this.limitNum = builder.limitNum;
|
||||
this.canShare = builder.canShare;
|
||||
@ -301,23 +350,86 @@ public class CouponBaseInfo implements Serializable {
|
||||
return needPushOnView;
|
||||
}
|
||||
|
||||
public JSONObject getGiftcardInfo() {
|
||||
return giftcardInfo;
|
||||
}
|
||||
|
||||
public int getMaxGiveFriendTimes() {
|
||||
return maxGiveFriendTimes;
|
||||
}
|
||||
|
||||
public Boolean getUseCustomCode() {
|
||||
return useCustomCode;
|
||||
}
|
||||
|
||||
public Boolean getBindOpenId() {
|
||||
return bindOpenId;
|
||||
}
|
||||
|
||||
public String getCenterAppBrandUserName() {
|
||||
return centerAppBrandUserName;
|
||||
}
|
||||
|
||||
public String getCenterAppBrandPass() {
|
||||
return centerAppBrandPass;
|
||||
}
|
||||
|
||||
public String getCustomAppBrandUserName() {
|
||||
return customAppBrandUserName;
|
||||
}
|
||||
|
||||
public String getCustomAppBrandPass() {
|
||||
return customAppBrandPass;
|
||||
}
|
||||
|
||||
public String getPromotionAppBrandUserName() {
|
||||
return promotionAppBrandUserName;
|
||||
}
|
||||
|
||||
public String getPromotionAppBrandPass() {
|
||||
return promotionAppBrandPass;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "logoUrl=" + logoUrl + ", brandName=" + brandName + ", title="
|
||||
+ title + ", codeType=" + codeType + ", cardColor=" + cardColor
|
||||
+ ", notice=" + notice + ", description=" + description
|
||||
+ ", sku=" + sku + ", date=" + date + ", useCustomCode="
|
||||
+ useCustomCode + ", bindOpenId=" + bindOpenId
|
||||
+ ", servicePhone=" + servicePhone + ", locationIds="
|
||||
+ locationIds + ", useAllLocation=" + useAllLocation
|
||||
+ ", centerTitle=" + centerTitle + ", centerUrl=" + centerUrl
|
||||
+ ", centerSubTitle=" + centerSubTitle + ", customTitle="
|
||||
+ customTitle + ", customUrl=" + customUrl
|
||||
+ ", customSubTitle=" + customSubTitle + ", promotionTitle="
|
||||
+ promotionTitle + ", promotionUrl=" + promotionUrl
|
||||
+ ", promotionSubTitle=" + promotionSubTitle + ", source="
|
||||
+ source + ", limitNum=" + limitNum + ", canShare=" + canShare
|
||||
+ ", canGiveFriend=" + canGiveFriend;
|
||||
return "CouponBaseInfo{" +
|
||||
"giftcardInfo=" + giftcardInfo +
|
||||
", maxGiveFriendTimes=" + maxGiveFriendTimes +
|
||||
", logoUrl='" + logoUrl + '\'' +
|
||||
", brandName='" + brandName + '\'' +
|
||||
", title='" + title + '\'' +
|
||||
", codeType=" + codeType +
|
||||
", cardColor=" + cardColor +
|
||||
", notice='" + notice + '\'' +
|
||||
", description='" + description + '\'' +
|
||||
", sku=" + sku +
|
||||
", date=" + date +
|
||||
", useCustomCode=" + useCustomCode +
|
||||
", bindOpenId=" + bindOpenId +
|
||||
", servicePhone='" + servicePhone + '\'' +
|
||||
", locationIds=" + locationIds +
|
||||
", useAllLocation=" + useAllLocation +
|
||||
", centerTitle='" + centerTitle + '\'' +
|
||||
", centerUrl='" + centerUrl + '\'' +
|
||||
", centerSubTitle='" + centerSubTitle + '\'' +
|
||||
", customTitle='" + customTitle + '\'' +
|
||||
", customUrl='" + customUrl + '\'' +
|
||||
", customSubTitle='" + customSubTitle + '\'' +
|
||||
", promotionTitle='" + promotionTitle + '\'' +
|
||||
", promotionUrl='" + promotionUrl + '\'' +
|
||||
", promotionSubTitle='" + promotionSubTitle + '\'' +
|
||||
", source='" + source + '\'' +
|
||||
", limitNum=" + limitNum +
|
||||
", canShare=" + canShare +
|
||||
", canGiveFriend=" + canGiveFriend +
|
||||
", needPushOnView=" + needPushOnView +
|
||||
", centerAppBrandUserName='" + centerAppBrandUserName + '\'' +
|
||||
", centerAppBrandPass='" + centerAppBrandPass + '\'' +
|
||||
", customAppBrandUserName='" + customAppBrandUserName + '\'' +
|
||||
", customAppBrandPass='" + customAppBrandPass + '\'' +
|
||||
", promotionAppBrandUserName='" + promotionAppBrandUserName + '\'' +
|
||||
", promotionAppBrandPass='" + promotionAppBrandPass + '\'' +
|
||||
'}';
|
||||
}
|
||||
|
||||
public void cleanCantUpdateField() {
|
||||
@ -337,10 +449,18 @@ public class CouponBaseInfo implements Serializable {
|
||||
* @since JDK 1.6
|
||||
*/
|
||||
public static final class Builder {
|
||||
/**
|
||||
* 礼品卡信息,目前只有一个礼品卡的价格属性,必填
|
||||
*/
|
||||
private JSONObject giftcardInfo;
|
||||
/**
|
||||
* 卡券的商户logo,建议像素为300*300
|
||||
*/
|
||||
private String logoUrl;
|
||||
/**
|
||||
* 礼品卡最大可赠送次数,必填
|
||||
*/
|
||||
private int maxGiveFriendTimes;
|
||||
/**
|
||||
* 商户名字,字数上限为12个汉字,如:海底捞
|
||||
*/
|
||||
@ -452,11 +572,37 @@ public class CouponBaseInfo implements Serializable {
|
||||
* 用户点击进入卡券时推送事件
|
||||
*/
|
||||
private boolean needPushOnView;
|
||||
/**
|
||||
* 自定义cell对应的小程序username,格式为公众号原始id@app。如:gh_86a091e50ad4@app 选填
|
||||
*/
|
||||
private String centerAppBrandUserName;
|
||||
/**
|
||||
* 自定义cell对应的小程序路径. 如:pages/index/index 选填
|
||||
*/
|
||||
private String centerAppBrandPass;
|
||||
/**
|
||||
* 自定义cell对应的小程序username,格式为公众号原始id@app 选填
|
||||
*/
|
||||
private String customAppBrandUserName;
|
||||
/**
|
||||
* 自定义cell对应的小程序路径。选填
|
||||
*/
|
||||
private String customAppBrandPass;
|
||||
/**
|
||||
* 自定义cell对应的小程序username,格式为公众号原始id@app
|
||||
*/
|
||||
private String promotionAppBrandUserName;
|
||||
/**
|
||||
* 自定义cell对应的小程序路径
|
||||
*/
|
||||
private String promotionAppBrandPass;
|
||||
|
||||
/**
|
||||
* 默认永久有效
|
||||
*/
|
||||
public Builder() {
|
||||
this.giftcardInfo = new JSONObject();
|
||||
this.maxGiveFriendTimes = 1;
|
||||
this.sku = new JSONObject();
|
||||
this.date = new JSONObject();
|
||||
this.date.put("type",CardActiveType.DATE_TYPE_PERMANENT);
|
||||
@ -466,6 +612,46 @@ public class CouponBaseInfo implements Serializable {
|
||||
this.limitNum = 50;
|
||||
}
|
||||
|
||||
public Builder customAppBrandPass(String pass){
|
||||
this.customAppBrandPass = pass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder centerAppBrandUserName(String name){
|
||||
this.centerAppBrandUserName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder centerAppBrandPass(String pass){
|
||||
this.centerAppBrandPass = pass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder customAppBrandUserName(String name){
|
||||
this.customAppBrandUserName = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder promotionAppBrandUserName(String userName){
|
||||
this.promotionAppBrandUserName = userName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder promotionAppBrandPass(String pass){
|
||||
this.promotionAppBrandPass = pass;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder maxGiveFriendTimes(int times){
|
||||
this.maxGiveFriendTimes = times;
|
||||
return this;
|
||||
}
|
||||
|
||||
public Builder price(int price){
|
||||
this.giftcardInfo.put("price", price);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商户logo
|
||||
*
|
||||
|
||||
@ -0,0 +1,219 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.foxinmy.weixin4j.type.card.CardType;
|
||||
import com.foxinmy.weixin4j.type.card.SubCardType;
|
||||
|
||||
/**
|
||||
* 储值类礼品卡
|
||||
*
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月26日
|
||||
*/
|
||||
public class GiftCard extends CardCoupon {
|
||||
|
||||
/**
|
||||
* 子卡券类型
|
||||
*/
|
||||
@JSONField(name = "sub_card_type")
|
||||
private final String subCardType;
|
||||
/**
|
||||
* 礼品卡背景图片,非必需
|
||||
*/
|
||||
@JSONField(name = "background_pic_url")
|
||||
private String backgroundPicUrl;
|
||||
/**
|
||||
* 是否支持积分,填写true或者false。默认为false
|
||||
*/
|
||||
@JSONField(name = "supply_bonus")
|
||||
private boolean supplyBonus;
|
||||
/**
|
||||
* 是否支持余额,填写true或者false。默认为false
|
||||
*/
|
||||
@JSONField(name = "supply_balance")
|
||||
private boolean supplyBalance;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field1")
|
||||
private MemCardCustomField customField1;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field2")
|
||||
private MemCardCustomField customField2;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field3")
|
||||
private MemCardCustomField customField3;
|
||||
/**
|
||||
* 是否自动激活,若开发者不需要额外激活流程则填写true。
|
||||
*/
|
||||
@JSONField(name = "auto_activate")
|
||||
private boolean autoActivate;
|
||||
/**
|
||||
* 初始余额,用户购买礼品卡后卡面上显示的初始余额
|
||||
*/
|
||||
@JSONField(name = "init_balance")
|
||||
private Integer initBalance;
|
||||
|
||||
public GiftCard(CouponBaseInfo baseInfo, GiftCard.Builder builder){
|
||||
super(baseInfo);
|
||||
this.subCardType = SubCardType.VOUCHER.name();
|
||||
this.autoActivate = builder.isAutoActivate();
|
||||
this.backgroundPicUrl = builder.getBackgroundPicUrl();
|
||||
this.customField1 = builder.getCustomField1();
|
||||
this.customField2 = builder.getCustomField2();
|
||||
this.customField3 = builder.getCustomField3();
|
||||
this.supplyBalance = builder.isSupplyBalance();
|
||||
this.supplyBonus = builder.isSupplyBonus();
|
||||
this.initBalance = builder.getInitBalance();
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public CardType getCardType() {
|
||||
return CardType.GENERAL_COUPON;
|
||||
}
|
||||
|
||||
public static final class Builder {
|
||||
private String backgroundPicUrl;
|
||||
private boolean supplyBonus;
|
||||
private boolean supplyBalance;
|
||||
private boolean autoActivate;
|
||||
private Integer initBalance;
|
||||
private MemCardCustomField customField1;
|
||||
private MemCardCustomField customField2;
|
||||
private MemCardCustomField customField3;
|
||||
|
||||
public Builder(){
|
||||
this.autoActivate = true;
|
||||
this.supplyBalance = false;
|
||||
this.supplyBonus = false;
|
||||
}
|
||||
|
||||
public String getBackgroundPicUrl() {
|
||||
return backgroundPicUrl;
|
||||
}
|
||||
|
||||
public boolean isSupplyBonus() {
|
||||
return supplyBonus;
|
||||
}
|
||||
|
||||
public boolean isSupplyBalance() {
|
||||
return supplyBalance;
|
||||
}
|
||||
|
||||
public boolean isAutoActivate() {
|
||||
return autoActivate;
|
||||
}
|
||||
|
||||
public Integer getInitBalance() {
|
||||
return initBalance;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField1() {
|
||||
return customField1;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField2() {
|
||||
return customField2;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField3() {
|
||||
return customField3;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼品卡背景图片
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public Builder backgroundPicUrl(String url){
|
||||
this.backgroundPicUrl = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否支持积分(目前未清楚单品类礼品卡是否支持积分)
|
||||
* @param supplyBonus
|
||||
* @return
|
||||
*/
|
||||
public Builder supplyBonus(boolean supplyBonus){
|
||||
this.supplyBonus = supplyBonus;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否支持余额(需礼品卡类型为GIFT_CARD,单品类礼品卡VOUCHER并非用于储值)
|
||||
* 注意事项:开发者仅能在supply_balance和custom_field1、custom_field2、custom_field3中选择最多3个填写,否则报错。
|
||||
* @param supplyBalance
|
||||
* @return
|
||||
*/
|
||||
public Builder supplyBalance(boolean supplyBalance){
|
||||
this.supplyBalance = supplyBalance;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼品卡是否自动激活,若开发者不需要额外激活流程则填写true。
|
||||
* @param autoActivate
|
||||
* @return
|
||||
*/
|
||||
public Builder autoActivate(boolean autoActivate){
|
||||
this.autoActivate = autoActivate;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置初始化的余额(需礼品卡类型为GIFT_CARD,单品类礼品卡VOUCHER并非用于储值)
|
||||
* @param initBalance
|
||||
* @return
|
||||
*/
|
||||
public Builder initBalance(Integer initBalance){
|
||||
this.initBalance = initBalance;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置自定义会员信息类目
|
||||
* 注意事项:开发者仅能在supply_balance和custom_field1、custom_field2、custom_field3中选择最多3个填写,否则报错。
|
||||
* @param name 自定义信息类目名称
|
||||
* @param url 自定义信息类目跳转url
|
||||
* @return
|
||||
*/
|
||||
public Builder customField1(String name, String url){
|
||||
MemCardCustomField field = new MemCardCustomField(name, url, null);
|
||||
this.customField1 = field;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置自定义会员信息类目
|
||||
* 注意事项:开发者仅能在supply_balance和custom_field1、custom_field2、custom_field3中选择最多3个填写,否则报错。
|
||||
* @param name 自定义信息类目名称
|
||||
* @param url 自定义信息类目跳转url
|
||||
* @return
|
||||
*/
|
||||
public Builder customField2(String name, String url){
|
||||
MemCardCustomField field = new MemCardCustomField(name, url, null);
|
||||
this.customField2 = field;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置自定义会员信息类目
|
||||
* 注意事项:开发者仅能在supply_balance和custom_field1、custom_field2、custom_field3中选择最多3个填写,否则报错。
|
||||
* @param name 自定义信息类目名称
|
||||
* @param url 自定义信息类目跳转url
|
||||
* @return
|
||||
*/
|
||||
public Builder customField3(String name, String url){
|
||||
MemCardCustomField field = new MemCardCustomField(name, url, null);
|
||||
this.customField3 = field;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,11 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
/**
|
||||
* 礼品卡销售订单信息
|
||||
*
|
||||
* @author kit (kit.li@qq.com)
|
||||
*/
|
||||
public class GiftCardOrder {
|
||||
private String orderId;
|
||||
private String pageId;
|
||||
}
|
||||
@ -0,0 +1,351 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 礼品卡货架
|
||||
*
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月30日
|
||||
*/
|
||||
public class GiftCardPage {
|
||||
@JSONField(name = "page_id")
|
||||
private String pageId;
|
||||
/**
|
||||
* 礼品卡货架名称
|
||||
*/
|
||||
@JSONField(name = "page_title")
|
||||
private String title;
|
||||
/**
|
||||
* 是否支持一次购买多张及发送至群,填true或者false,若填true则支持,默认为false
|
||||
*/
|
||||
@JSONField(name = "support_multi")
|
||||
private Boolean supportMulti;
|
||||
/**
|
||||
* 礼品卡货架是否支持买给自己,填true或者false,若填true则支持,默认为false
|
||||
*/
|
||||
@JSONField(name = "support_buy_for_self")
|
||||
private Boolean supportBuyForSelf;
|
||||
/**
|
||||
* 礼品卡货架主题页顶部banner图片,须先将图片上传至CDN,建议尺寸为750px*630px
|
||||
*/
|
||||
@JSONField(name = "banner_pic_url")
|
||||
private String bannerPicUrl;
|
||||
/**
|
||||
* 主题结构体
|
||||
*/
|
||||
@JSONField(name = "theme_list")
|
||||
private JSONArray themeList;
|
||||
/**
|
||||
* 主题分类列表
|
||||
*/
|
||||
@JSONField(name = "category_list")
|
||||
private JSONArray categoryList;
|
||||
/**
|
||||
* 商家地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 商家服务电话
|
||||
*/
|
||||
@JSONField(name = "service_phone")
|
||||
private String servicePhone;
|
||||
/**
|
||||
* 商家使用说明,用于描述退款、发票等流程
|
||||
*/
|
||||
@JSONField(name = "biz_description")
|
||||
private String description;
|
||||
/**
|
||||
* 该货架的订单是否支持开发票,填true或者false,若填true则需要使用API设置支付后开票功能,默认为false
|
||||
*/
|
||||
@JSONField(name = "need_receipt")
|
||||
private Boolean needReceipt;
|
||||
/**
|
||||
* 商家自定义链接,用于承载退款、发票等流程
|
||||
*/
|
||||
@JSONField(name = "cell_1")
|
||||
private JSONObject cell1;
|
||||
/**
|
||||
* 商家自定义链接,用于承载退款、发票等流程
|
||||
*/
|
||||
@JSONField(name = "cell_2")
|
||||
private JSONObject cell2;
|
||||
|
||||
public String getPageId() { return pageId; }
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public Boolean getSupportMulti() {
|
||||
return supportMulti;
|
||||
}
|
||||
|
||||
public Boolean getSupportBuyForSelf() {
|
||||
return supportBuyForSelf;
|
||||
}
|
||||
|
||||
public String getBannerPicUrl() {
|
||||
return bannerPicUrl;
|
||||
}
|
||||
|
||||
public JSONArray getThemeList() {
|
||||
return themeList;
|
||||
}
|
||||
|
||||
public JSONArray getCategoryList() {
|
||||
return categoryList;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public String getServicePhone() {
|
||||
return servicePhone;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public Boolean getNeedReceipt() {
|
||||
return needReceipt;
|
||||
}
|
||||
|
||||
public JSONObject getCell1() {
|
||||
return cell1;
|
||||
}
|
||||
|
||||
public JSONObject getCell2() {
|
||||
return cell2;
|
||||
}
|
||||
|
||||
public GiftCardPage(Builder builder){
|
||||
this.pageId = builder.pageId;
|
||||
this.address = builder.address;
|
||||
this.bannerPicUrl = builder.bannerPicUrl;
|
||||
this.categoryList = builder.categoryList;
|
||||
this.cell1 = builder.cell1;
|
||||
this.cell2 = builder.cell2;
|
||||
this.description = builder.description;
|
||||
this.needReceipt = builder.needReceipt;
|
||||
this.servicePhone = builder.servicePhone;
|
||||
this.supportBuyForSelf = builder.supportBuyForSelf;
|
||||
this.supportMulti = builder.supportMulti;
|
||||
this.themeList = builder.themeList;
|
||||
this.title = builder.title;
|
||||
}
|
||||
|
||||
public static class Builder{
|
||||
/**
|
||||
* 货架ID,只在货架更新时用到
|
||||
*/
|
||||
private String pageId;
|
||||
/**
|
||||
* 礼品卡货架名称
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 是否支持一次购买多张及发送至群,填true或者false,若填true则支持,默认为false
|
||||
*/
|
||||
private Boolean supportMulti;
|
||||
/**
|
||||
* 礼品卡货架是否支持买给自己,填true或者false,若填true则支持,默认为false
|
||||
*/
|
||||
private Boolean supportBuyForSelf;
|
||||
/**
|
||||
* 礼品卡货架主题页顶部banner图片,须先将图片上传至CDN,建议尺寸为750px*630px
|
||||
*/
|
||||
private String bannerPicUrl;
|
||||
/**
|
||||
* 主题结构体
|
||||
*/
|
||||
private JSONArray themeList;
|
||||
/**
|
||||
* 主题分类列表
|
||||
*/
|
||||
private JSONArray categoryList;
|
||||
/**
|
||||
* 商家地址
|
||||
*/
|
||||
private String address;
|
||||
/**
|
||||
* 商家服务电话
|
||||
*/
|
||||
private String servicePhone;
|
||||
/**
|
||||
* 商家使用说明,用于描述退款、发票等流程
|
||||
*/
|
||||
private String description;
|
||||
/**
|
||||
* 该货架的订单是否支持开发票,填true或者false,若填true则需要使用API设置支付后开票功能,默认为false
|
||||
*/
|
||||
private Boolean needReceipt;
|
||||
/**
|
||||
* 商家自定义链接,用于承载退款、发票等流程
|
||||
*/
|
||||
private JSONObject cell1;
|
||||
/**
|
||||
* 商家自定义链接,用于承载退款、发票等流程
|
||||
*/
|
||||
private JSONObject cell2;
|
||||
|
||||
public Builder(){
|
||||
this.themeList = new JSONArray();
|
||||
this.categoryList = null;
|
||||
}
|
||||
|
||||
public Builder pageId(String pageId){
|
||||
this.pageId = pageId;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼品卡货架名称
|
||||
*
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
public Builder title(String title){
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否支持一次购买多张及发送至群
|
||||
*
|
||||
* @param supportMulti
|
||||
* @return
|
||||
*/
|
||||
public Builder supportMulti(boolean supportMulti){
|
||||
this.supportMulti = Boolean.valueOf(supportMulti);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼品卡货架是否支持买给自己
|
||||
*
|
||||
* @param supportBuyForSelf
|
||||
* @return
|
||||
*/
|
||||
public Builder supportBuyForSelf(boolean supportBuyForSelf){
|
||||
this.supportBuyForSelf = Boolean.valueOf(supportBuyForSelf);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼品卡货架主题页顶部banner图片
|
||||
*
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public Builder bannerPicUrl(String url){
|
||||
this.bannerPicUrl = url;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个主题
|
||||
*
|
||||
* @param theme
|
||||
* @return
|
||||
*/
|
||||
public Builder themeList(PageTheme theme){
|
||||
this.themeList.add(theme);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个主题分类
|
||||
*
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
public Builder categoryList(String title){
|
||||
if(this.categoryList==null){
|
||||
this.categoryList = new JSONArray();
|
||||
}
|
||||
JSONObject category = new JSONObject();
|
||||
category.put("title", title);
|
||||
this.categoryList.add(category);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商家地址
|
||||
*
|
||||
* @param address
|
||||
* @return
|
||||
*/
|
||||
public Builder address(String address){
|
||||
this.address = address;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商家服务电话
|
||||
*
|
||||
* @param phoneNo
|
||||
* @return
|
||||
*/
|
||||
public Builder servicePhone(String phoneNo){
|
||||
this.servicePhone = phoneNo;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商家使用说明
|
||||
*
|
||||
* @param description
|
||||
* @return
|
||||
*/
|
||||
public Builder description(String description){
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置该货架的订单是否支持开发票
|
||||
*
|
||||
* @param needReceipt
|
||||
* @return
|
||||
*/
|
||||
public Builder needReceipt(boolean needReceipt){
|
||||
this.needReceipt = Boolean.valueOf(needReceipt);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商家自定义链接
|
||||
*
|
||||
* @param title
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public Builder cell1(String title, String url){
|
||||
JSONObject cell = new JSONObject();
|
||||
cell.put("title", title);
|
||||
cell.put("url", url);
|
||||
this.cell1 = cell;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置商家自定义链接
|
||||
*
|
||||
* @param title
|
||||
* @param url
|
||||
* @return
|
||||
*/
|
||||
public Builder cell2(String title, String url){
|
||||
JSONObject cell = new JSONObject();
|
||||
cell.put("title", title);
|
||||
cell.put("url", url);
|
||||
this.cell2 = cell;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,249 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼品卡货架主题
|
||||
*
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月30日
|
||||
*/
|
||||
public class PageTheme {
|
||||
/**
|
||||
* 主题的封面图片,须先将图片上传至CDN 大小控制在1000px*600px
|
||||
*/
|
||||
@JSONField(name = "theme_pic_url")
|
||||
private String cover;
|
||||
/**
|
||||
* 主题名称,如“圣诞”“感恩家人”
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 主题title的颜色,直接传入色值
|
||||
*/
|
||||
@JSONField(name = "title_color")
|
||||
private String titleColor;
|
||||
/**
|
||||
* 礼品卡列表,表示主题可选择的礼品卡,由cardid及标题文字组成
|
||||
*/
|
||||
@JSONField(name = "item_list")
|
||||
private List<CardItem> itemList;
|
||||
/**
|
||||
* 礼品卡可选择的封面图
|
||||
*/
|
||||
@JSONField(name = "pic_item_list")
|
||||
private List<PicItem> picItemList;
|
||||
/**
|
||||
* 当前主题所属主题分类的索引,对应主题分类列表category_list内的title字段, 若填写了category_list则每个主题必填该序号
|
||||
*/
|
||||
@JSONField(name = "category_index")
|
||||
private Integer categoryIndex;
|
||||
/**
|
||||
* 该主题购买页是否突出商品名显示
|
||||
*/
|
||||
@JSONField(name = "show_sku_title_first")
|
||||
private Boolean showSkuTitleFirst;
|
||||
/**
|
||||
* 是否将当前主题设置为banner主题(主推荐)
|
||||
*/
|
||||
@JSONField(name = "is_banner")
|
||||
private Boolean bannerTheme;
|
||||
|
||||
public PageTheme(Builder builder){
|
||||
this.cover = builder.cover;
|
||||
this.title = builder.title;
|
||||
this.titleColor = builder.titleColor;
|
||||
this.itemList = builder.itemList;
|
||||
this.picItemList = builder.picItemList;
|
||||
this.categoryIndex = builder.categoryIndex;
|
||||
this.showSkuTitleFirst = builder.showSkuTitleFirst;
|
||||
this.bannerTheme = builder.bannerTheme;
|
||||
}
|
||||
|
||||
public String getCover() {
|
||||
return cover;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public String getTitleColor() {
|
||||
return titleColor;
|
||||
}
|
||||
|
||||
public List<CardItem> getItemList() {
|
||||
return itemList;
|
||||
}
|
||||
|
||||
public List<PicItem> getPicItemList() {
|
||||
return picItemList;
|
||||
}
|
||||
|
||||
public Integer getCategoryIndex() {
|
||||
return categoryIndex;
|
||||
}
|
||||
|
||||
public Boolean getShowSkuTitleFirst() {
|
||||
return showSkuTitleFirst;
|
||||
}
|
||||
|
||||
public Boolean getBannerTheme() {
|
||||
return bannerTheme;
|
||||
}
|
||||
|
||||
public static class Builder{
|
||||
/**
|
||||
* 主题的封面图片,须先将图片上传至CDN 大小控制在1000px*600px
|
||||
*/
|
||||
private String cover;
|
||||
/**
|
||||
* 主题名称,如“圣诞”“感恩家人”
|
||||
*/
|
||||
private String title;
|
||||
/**
|
||||
* 主题title的颜色,直接传入色值
|
||||
*/
|
||||
private String titleColor;
|
||||
/**
|
||||
* 礼品卡列表,表示主题可选择的礼品卡,由cardid及标题文字组成
|
||||
*/
|
||||
private List<CardItem> itemList;
|
||||
/**
|
||||
* 礼品卡可选择的封面图
|
||||
*/
|
||||
private List<PicItem> picItemList;
|
||||
/**
|
||||
* 主题标号,对应category_list内的title字段, 若填写了category_list则每个主题必填该序号
|
||||
*/
|
||||
private Integer categoryIndex;
|
||||
/**
|
||||
* 该主题购买页是否突出商品名显示
|
||||
*/
|
||||
private Boolean showSkuTitleFirst;
|
||||
/**
|
||||
* 是否将当前主题设置为banner主题(主推荐)
|
||||
*/
|
||||
private Boolean bannerTheme;
|
||||
|
||||
public Builder(){
|
||||
this.itemList = new ArrayList<CardItem>();
|
||||
this.picItemList = new ArrayList<PicItem>();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主题的封面图片
|
||||
*
|
||||
* @param cover
|
||||
* @return
|
||||
*/
|
||||
public Builder cover(String cover){
|
||||
this.cover = cover;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主题名称
|
||||
*
|
||||
* @param title
|
||||
* @return
|
||||
*/
|
||||
public Builder title(String title){
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置主题title的颜色
|
||||
*
|
||||
* @param titleColor
|
||||
* 直接设置色值,如:#FB966E
|
||||
* @return
|
||||
*/
|
||||
public Builder titleColor(String titleColor){
|
||||
this.titleColor = titleColor;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个或多个礼品卡内容
|
||||
*
|
||||
* @param items
|
||||
* @return
|
||||
*/
|
||||
public Builder cardItems(CardItem... items){
|
||||
this.itemList = Arrays.asList(items);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个礼品卡内容
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public Builder addCardItem(CardItem item){
|
||||
this.itemList.add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个或多个礼品卡封面图
|
||||
*
|
||||
* @param items
|
||||
* @return
|
||||
*/
|
||||
public Builder picItems(PicItem... items){
|
||||
this.picItemList = Arrays.asList(items);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个礼品卡封面图
|
||||
*
|
||||
* @param item
|
||||
* @return
|
||||
*/
|
||||
public Builder addPicItem(PicItem item){
|
||||
this.picItemList.add(item);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置所属主题分类的索引号
|
||||
*
|
||||
* @param index
|
||||
* @return
|
||||
*/
|
||||
public Builder categoryIndex(Integer index){
|
||||
this.categoryIndex = index;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置该主题购买页是否突出商品名显示
|
||||
*
|
||||
* @param isShow
|
||||
* @return
|
||||
*/
|
||||
public Builder showSkuTitleFirst(Boolean isShow){
|
||||
this.showSkuTitleFirst = isShow;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置是否将当前主题设置为banner主题(主推荐)
|
||||
*
|
||||
* @param isBanner
|
||||
* @return
|
||||
*/
|
||||
public Builder bannerTheme(Boolean isBanner){
|
||||
this.bannerTheme = isBanner;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,66 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
/**
|
||||
* 礼品卡货架主题中的卡面结构体
|
||||
*
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月30日
|
||||
*/
|
||||
public class PicItem {
|
||||
/**
|
||||
* 卡面图片,须先将图片上传至CDN,大小控制在1000 x 600像素以下
|
||||
*/
|
||||
@JSONField(name = "background_pic_url")
|
||||
private String backgroundPicUrl;
|
||||
/**
|
||||
* 自定义的卡面的标识, 非必填
|
||||
*/
|
||||
@JSONField(name = "outer_img_id")
|
||||
private String outerImgId;
|
||||
/**
|
||||
* 该卡面对应的默认祝福语,当用户没有编辑内容时会随卡默认填写为用户祝福内容
|
||||
*/
|
||||
@JSONField(name = "default_gifting_msg")
|
||||
private String defaultGiftingMsg;
|
||||
|
||||
public PicItem(){
|
||||
|
||||
}
|
||||
|
||||
public PicItem(String backgroundPicUrl, String defaultGiftingMsg) {
|
||||
this.backgroundPicUrl = backgroundPicUrl;
|
||||
this.defaultGiftingMsg = defaultGiftingMsg;
|
||||
}
|
||||
|
||||
public PicItem(String backgroundPicUrl, String outerImgId, String defaultGiftingMsg) {
|
||||
this.backgroundPicUrl = backgroundPicUrl;
|
||||
this.outerImgId = outerImgId;
|
||||
this.defaultGiftingMsg = defaultGiftingMsg;
|
||||
}
|
||||
|
||||
public String getBackgroundPicUrl() {
|
||||
return backgroundPicUrl;
|
||||
}
|
||||
|
||||
public String getOuterImgId() {
|
||||
return outerImgId;
|
||||
}
|
||||
|
||||
public String getDefaultGiftingMsg() {
|
||||
return defaultGiftingMsg;
|
||||
}
|
||||
|
||||
public void setBackgroundPicUrl(String backgroundPicUrl) {
|
||||
this.backgroundPicUrl = backgroundPicUrl;
|
||||
}
|
||||
|
||||
public void setOuterImgId(String outerImgId) {
|
||||
this.outerImgId = outerImgId;
|
||||
}
|
||||
|
||||
public void setDefaultGiftingMsg(String defaultGiftingMsg) {
|
||||
this.defaultGiftingMsg = defaultGiftingMsg;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,122 @@
|
||||
package com.foxinmy.weixin4j.model.card;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.foxinmy.weixin4j.type.card.CardType;
|
||||
import com.foxinmy.weixin4j.type.card.SubCardType;
|
||||
|
||||
/**
|
||||
* 单品类型礼品卡
|
||||
* 指该礼品卡用于兑换指定单品,如汉堡礼品卡
|
||||
*
|
||||
* @className VoucherCardCoupon
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月23日
|
||||
*/
|
||||
public class VoucherCard extends CardCoupon {
|
||||
|
||||
/**
|
||||
* 子卡券类型
|
||||
*/
|
||||
@JSONField(name = "sub_card_type")
|
||||
private final String subCardType;
|
||||
/**
|
||||
* 礼品卡背景图片,非必需
|
||||
*/
|
||||
@JSONField(name = "background_pic_url")
|
||||
private String backgroundPicUrl;
|
||||
/**
|
||||
* 是否支持积分,填写true或者false。默认为false
|
||||
*/
|
||||
@JSONField(name = "supply_bonus")
|
||||
private boolean supplyBonus;
|
||||
/**
|
||||
* 是否支持余额,填写true或者false。默认为false
|
||||
*/
|
||||
@JSONField(name = "supply_balance")
|
||||
private boolean supplyBalance;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field1")
|
||||
private MemCardCustomField customField1;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field2")
|
||||
private MemCardCustomField customField2;
|
||||
/**
|
||||
* 自定义会员信息类目,会员卡激活后显示,包含name和url字段
|
||||
*/
|
||||
@JSONField(name = "custom_field3")
|
||||
private MemCardCustomField customField3;
|
||||
/**
|
||||
* 是否自动激活,若开发者不需要额外激活流程则填写true。
|
||||
*/
|
||||
@JSONField(name = "auto_activate")
|
||||
private boolean autoActivate;
|
||||
|
||||
public String getSubCardType() {
|
||||
return subCardType;
|
||||
}
|
||||
|
||||
public String getBackgroundPicUrl() {
|
||||
return backgroundPicUrl;
|
||||
}
|
||||
|
||||
public boolean isSupplyBonus() {
|
||||
return supplyBonus;
|
||||
}
|
||||
|
||||
public boolean isSupplyBalance() {
|
||||
return supplyBalance;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField1() {
|
||||
return customField1;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField2() {
|
||||
return customField2;
|
||||
}
|
||||
|
||||
public MemCardCustomField getCustomField3() {
|
||||
return customField3;
|
||||
}
|
||||
|
||||
public boolean isAutoActivate() {
|
||||
return autoActivate;
|
||||
}
|
||||
|
||||
public VoucherCard(CouponBaseInfo baseInfo, GiftCard.Builder builder){
|
||||
super(baseInfo);
|
||||
this.subCardType = SubCardType.VOUCHER.name();
|
||||
this.autoActivate = builder.isAutoActivate();
|
||||
this.backgroundPicUrl = builder.getBackgroundPicUrl();
|
||||
this.customField1 = builder.getCustomField1();
|
||||
this.customField2 = builder.getCustomField2();
|
||||
this.customField3 = builder.getCustomField3();
|
||||
this.supplyBalance = false;
|
||||
this.supplyBonus = builder.isSupplyBonus();;
|
||||
}
|
||||
|
||||
@JSONField(serialize = false)
|
||||
@Override
|
||||
public CardType getCardType() {
|
||||
return CardType.GENERAL_CARD;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "VoucherCardCoupon [" +
|
||||
"subCardType='" + subCardType + '\'' +
|
||||
", backgroundPicUrl='" + backgroundPicUrl + '\'' +
|
||||
", supplyBonus=" + supplyBonus +
|
||||
", supplyBalance=" + supplyBalance +
|
||||
", customField1=" + customField1 +
|
||||
", customField2=" + customField2 +
|
||||
", customField3=" + customField3 +
|
||||
", autoActivate=" + autoActivate +
|
||||
", " + super.toString() +
|
||||
']';
|
||||
}
|
||||
}
|
||||
@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
* @date 2014年8月19日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class JsPayNotify extends PayBaseInfo {
|
||||
|
||||
@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.type.SignType;
|
||||
* @date 2014年11月5日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PayBaseInfo implements Serializable {
|
||||
|
||||
@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2014年12月18日
|
||||
* @since JDK 1.6
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PayPackage extends MerchantResult {
|
||||
|
||||
@ -10,6 +10,7 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.foxinmy.weixin4j.util.DateUtil;
|
||||
import com.foxinmy.weixin4j.util.RandomUtil;
|
||||
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PayRequest extends PayBaseInfo {
|
||||
|
||||
@ -56,7 +56,9 @@ import com.foxinmy.weixin4j.util.Weixin4jConfigUtil;
|
||||
* @date 2015年1月3日
|
||||
* @since JDK 1.6
|
||||
* @see <a href="http://pay.weixin.qq.com/wiki/doc/api/index.html">商户平台支付API</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class WeixinPayProxy {
|
||||
|
||||
/**
|
||||
|
||||
@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CouponDetail extends MerchantResult {
|
||||
|
||||
@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.payment.mch.MerchantResult;
|
||||
* @date 2015年3月25日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CouponResult extends MerchantResult {
|
||||
|
||||
@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CouponStock extends MerchantResult {
|
||||
|
||||
@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.type.mch.CouponType;
|
||||
* @date 2015年3月24日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class OrderCouponInfo implements Serializable {
|
||||
|
||||
@ -17,7 +17,9 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
* @date 2015年3月24日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RefundCouponInfo implements Serializable {
|
||||
|
||||
@ -21,7 +21,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
|
||||
* @see com.foxinmy.weixin4j.payment.PayRequest
|
||||
* @see <a href=
|
||||
* "https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=8_1">APP支付</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class APPPayRequest extends AbstractPayRequest {
|
||||
public APPPayRequest(String prePayId, WeixinPayAccount payAccount) {
|
||||
super(prePayId, payAccount);
|
||||
|
||||
@ -4,6 +4,7 @@ import com.foxinmy.weixin4j.model.WeixinPayAccount;
|
||||
import com.foxinmy.weixin4j.sign.WeixinPaymentSignature;
|
||||
import com.foxinmy.weixin4j.sign.WeixinSignature;
|
||||
|
||||
@Deprecated
|
||||
public abstract class AbstractPayRequest implements MchPayRequest {
|
||||
|
||||
private final String prePayId;
|
||||
|
||||
@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年4月1日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CorpPayment extends MerchantResult {
|
||||
|
||||
@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年6月23日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CorpPaymentRecord extends MerchantResult {
|
||||
|
||||
@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年4月1日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class CorpPaymentResult extends MerchantResult {
|
||||
|
||||
@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.type.CustomsCity;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CustomsOrder extends MerchantResult {
|
||||
|
||||
private static final long serialVersionUID = 799510373861612386L;
|
||||
|
||||
@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CustomsOrderRecord extends MerchantResult {
|
||||
|
||||
private static final long serialVersionUID = -1675090110657154049L;
|
||||
|
||||
@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class CustomsOrderResult extends MerchantResult {
|
||||
|
||||
private static final long serialVersionUID = 799510373861612386L;
|
||||
|
||||
@ -22,7 +22,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @see com.foxinmy.weixin4j.payment.PayRequest
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=7_1">网页端调起支付API</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class JSAPIPayRequest extends AbstractPayRequest {
|
||||
|
||||
public JSAPIPayRequest(String prePayId, WeixinPayAccount payAccount) {
|
||||
|
||||
@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @see com.foxinmy.weixin4j.payment.PayRequest
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/micropay.php?chapter=5_1">刷卡支付</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class MICROPayRequest extends Order implements MchPayRequest {
|
||||
|
||||
private static final long serialVersionUID = 6147576305404111278L;
|
||||
|
||||
@ -20,7 +20,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @date 2014年10月21日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class MchPayPackage extends PayPackage {
|
||||
|
||||
@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @see MICROPayRequest 刷卡支付
|
||||
* @see APPPayRequest APP支付
|
||||
* @see WAPPayRequest WAP支付
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public interface MchPayRequest {
|
||||
/**
|
||||
* 预支付交易ID
|
||||
|
||||
@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.type.SignType;
|
||||
* @date 2014年10月21日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class MerchantResult extends XmlResult {
|
||||
|
||||
@ -13,7 +13,9 @@ import com.foxinmy.weixin4j.type.CurrencyType;
|
||||
* @date 2016年7月21日
|
||||
* @since JDK 1.7
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class MerchantTradeResult extends MerchantResult {
|
||||
|
||||
private static final long serialVersionUID = 4205906286092873877L;
|
||||
|
||||
@ -15,7 +15,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @see com.foxinmy.weixin4j.payment.PayRequest
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/native.php?chapter=6_1">NATIVE扫码支付(模式二)</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class NATIVEPayRequest extends AbstractPayRequest {
|
||||
|
||||
private final String codeUrl;
|
||||
|
||||
@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
* @date 2014年10月30日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class NativePayNotify extends OpenIdResult {
|
||||
|
||||
@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.util.RandomUtil;
|
||||
* @date 2014年10月28日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class NativePayResponse extends MerchantResult {
|
||||
|
||||
@ -15,7 +15,9 @@ import com.alibaba.fastjson.annotation.JSONField;
|
||||
* @date 2015年7月23日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class OpenIdResult extends MerchantResult {
|
||||
|
||||
@ -25,7 +25,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
|
||||
* @date 2014年11月2日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class Order extends MerchantTradeResult {
|
||||
|
||||
@ -16,7 +16,9 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @date 2014年10月21日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class PrePay extends MerchantResult {
|
||||
|
||||
@ -20,7 +20,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_1">普通红包</a>
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=16_1">裂变红包</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class Redpacket extends MerchantResult {
|
||||
|
||||
@ -25,7 +25,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年6月4日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RedpacketRecord extends XmlResult {
|
||||
|
||||
@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
|
||||
* @date 2017年1月4日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class RedpacketRisk {
|
||||
private Map<String, String> risk;
|
||||
|
||||
|
||||
@ -18,7 +18,9 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @date 2015年4月1日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RedpacketSendResult extends MerchantResult {
|
||||
|
||||
@ -24,7 +24,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2016年7月21日
|
||||
* @since JDK 1.6
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RefundDetail implements Serializable {
|
||||
|
||||
@ -17,7 +17,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2014年11月1日
|
||||
* @since JDK 1.6
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RefundRecord extends MerchantTradeResult {
|
||||
|
||||
@ -19,7 +19,9 @@ import com.foxinmy.weixin4j.xml.ListsuffixResult;
|
||||
* @date 2014年11月6日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class RefundResult extends MerchantTradeResult {
|
||||
|
||||
@ -4,6 +4,7 @@ import javax.xml.bind.annotation.XmlAccessType;
|
||||
import javax.xml.bind.annotation.XmlAccessorType;
|
||||
import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SceneInfoApp {
|
||||
|
||||
@ -7,6 +7,7 @@ import javax.xml.bind.annotation.XmlRootElement;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
@Deprecated
|
||||
@XmlRootElement
|
||||
@XmlAccessorType(XmlAccessType.FIELD)
|
||||
public class SceneInfoStore {
|
||||
|
||||
@ -17,6 +17,7 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
*/
|
||||
@Deprecated
|
||||
public class SettlementRecord extends MerchantResult {
|
||||
|
||||
private static final long serialVersionUID = 7952659545609519979L;
|
||||
|
||||
@ -16,6 +16,7 @@ import com.foxinmy.weixin4j.type.TradeType;
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/wap.php?chapter=15_1">WAP支付</a>
|
||||
*/
|
||||
@Deprecated
|
||||
public class WAPPayRequest extends AbstractPayRequest {
|
||||
/**
|
||||
* 微信支付URL
|
||||
|
||||
@ -10,7 +10,9 @@ import com.foxinmy.weixin4j.util.MapUtil;
|
||||
* @date 2016年3月26日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public abstract class AbstractWeixinSignature implements WeixinSignature {
|
||||
/**
|
||||
* 是否编码
|
||||
|
||||
@ -12,7 +12,9 @@ import com.foxinmy.weixin4j.util.DigestUtil;
|
||||
* @since JDK 1.6
|
||||
* @see <a
|
||||
* href="https://pay.weixin.qq.com/wiki/doc/api/external/jsapi.php?chapter=4_3">支付签名说明</a>
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class WeixinPaymentSignature extends AbstractWeixinSignature {
|
||||
/**
|
||||
* 支付密钥
|
||||
|
||||
@ -10,7 +10,9 @@ import com.foxinmy.weixin4j.type.SignType;
|
||||
* @date 2016年3月26日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public interface WeixinSignature {
|
||||
/**
|
||||
* 是否编码
|
||||
|
||||
@ -9,7 +9,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2015年8月19日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum BankType {
|
||||
/**
|
||||
* 工商银行(借记卡)
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CredentialType {
|
||||
IDCARD("身份证");
|
||||
CredentialType(String name) {
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2014年11月2日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CurrencyType {
|
||||
CNY("人民币"), HKD("港元"), TWD("台币"), EUR("欧元"), USD("美元"), GBP("英镑"), JPY("日元"), CAD(
|
||||
"加拿大元"), AUD("澳大利亚元"), NZD("新西兰元"), KRW("韩元"), THB("泰铢");
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CustomsCity {
|
||||
NO("无需上报海关"), GUANGZHOU("广州"), HANGZHOU("杭州"), NINGBO("宁波"), ZHENGZHOU_BS(
|
||||
"郑州(保税物流中心)"), CHONGQING("重庆"), XIAN("西安"), SHANGHAI("上海"), ZHENGZHOU_ZH(
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2016年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CustomsSatus {
|
||||
UNDECLARED("未申报"), SUBMITTED("申报已提交"), PROCESSING("申报中"), SUCCESS("申报成功"), FAIL(
|
||||
"申报失败"), EXCEPT("海关接口异常");
|
||||
|
||||
@ -10,7 +10,9 @@ import java.io.Serializable;
|
||||
* @date 2014年11月1日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public class IdQuery implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -5273675987521807370L;
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2014年11月1日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum IdType {
|
||||
/**
|
||||
* 微信退款单号
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2014年11月5日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum SignType {
|
||||
SHA1, MD5, HMAC$SHA256
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2016年12月21日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum TarType {
|
||||
GZIP
|
||||
}
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2014年11月2日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum TradeState {
|
||||
/**
|
||||
* 支付成功
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type;
|
||||
* @date 2014年10月21日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到weixin4j-pay子模块
|
||||
*/
|
||||
@Deprecated
|
||||
public enum TradeType {
|
||||
/**
|
||||
* JS支付
|
||||
|
||||
@ -34,5 +34,10 @@ public enum CardType {
|
||||
/**
|
||||
* 会员卡
|
||||
*/
|
||||
MEMBER_CARD;
|
||||
MEMBER_CARD,
|
||||
|
||||
/**
|
||||
* 通用(礼品)卡
|
||||
*/
|
||||
GENERAL_CARD
|
||||
}
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
package com.foxinmy.weixin4j.type.card;
|
||||
|
||||
/**
|
||||
* 礼品卡类型
|
||||
*
|
||||
* @className SubCardType
|
||||
* @author kit(kit.li@qq.com)
|
||||
* @date 2018年10月23日
|
||||
*/
|
||||
public enum SubCardType {
|
||||
/**
|
||||
* 礼品卡
|
||||
*/
|
||||
GIFT_CARD,
|
||||
/**
|
||||
* 兑换卡
|
||||
*/
|
||||
VOUCHER
|
||||
}
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2014年10月31日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum BillType {
|
||||
/**
|
||||
* 全部
|
||||
|
||||
@ -9,6 +9,7 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CorpPaymentCheckNameType {
|
||||
/**
|
||||
* 不校验真实姓名
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CouponStatus {
|
||||
/**
|
||||
* 已激活
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CouponStockStatus {
|
||||
/**
|
||||
* 未激活
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CouponStockType {
|
||||
/**
|
||||
* 批量型
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年3月27日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum CouponType {
|
||||
/**
|
||||
* 使用无门槛
|
||||
|
||||
@ -7,7 +7,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2017年1月4日
|
||||
* @since JDK 1.6
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum RedpacketSceneType {
|
||||
/**
|
||||
* 商品促销
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年6月4日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum RedpacketSendType {
|
||||
/**
|
||||
* 通过API接口发放
|
||||
|
||||
@ -7,7 +7,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年6月4日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum RedpacketStatus {
|
||||
/**
|
||||
* 发放中
|
||||
|
||||
@ -8,7 +8,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @date 2015年6月4日
|
||||
* @since JDK 1.6
|
||||
* @see
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum RedpacketType {
|
||||
/**
|
||||
* 裂变红包
|
||||
|
||||
@ -5,7 +5,9 @@ package com.foxinmy.weixin4j.type.mch;
|
||||
* @className RefundAccountType
|
||||
* @author jinyu(foxinmy@gmail.com)
|
||||
* @date 2016年12月12日
|
||||
* @deprecated 迁移到子模块weixin4j-pay
|
||||
*/
|
||||
@Deprecated
|
||||
public enum RefundAccountType {
|
||||
/**
|
||||
* ---未结算资金退款(默认使用未结算资金退款)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user