version upgrade to 1.7.1

This commit is contained in:
jinyu 2016-08-09 15:58:44 +08:00
parent 46b496c84c
commit ee836c3193
14 changed files with 311 additions and 277 deletions

View File

@ -753,4 +753,6 @@
+ weixin4j-base:修复媒体消息转换错误bug + weixin4j-base:修复媒体消息转换错误bug
+ weixin4j-mp:新增创建卡券二维码接口 + weixin4j-mp:新增创建卡券二维码接口
+ version upgrade to 1.7.1

520
pom.xml
View File

@ -1,261 +1,261 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.7.0</version> <version>1.7.1</version>
<packaging>pom</packaging> <packaging>pom</packaging>
<name>weixin4j</name> <name>weixin4j</name>
<url>https://github.com/foxinmy/weixin4j</url> <url>https://github.com/foxinmy/weixin4j</url>
<description>微信开发工具包</description> <description>微信开发工具包</description>
<inceptionYear>2014</inceptionYear> <inceptionYear>2014</inceptionYear>
<licenses> <licenses>
<license> <license>
<name>Apache License, Version 2.0</name> <name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url> <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
<distribution>repo</distribution> <distribution>repo</distribution>
<comments>A business-friendly OSS license</comments> <comments>A business-friendly OSS license</comments>
</license> </license>
</licenses> </licenses>
<scm> <scm>
<url>https://github.com/foxinmy/weixin4j</url> <url>https://github.com/foxinmy/weixin4j</url>
<connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection> <connection>scm:git:git://github.com/foxinmy/weixin4j.git</connection>
<developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection> <developerConnection>scm:git:git@github.com:foxinmy/weixin4j.git</developerConnection>
<tag>HEAD</tag> <tag>HEAD</tag>
</scm> </scm>
<issueManagement> <issueManagement>
<url>https://github.com/foxinmy/weixin4j/issues</url> <url>https://github.com/foxinmy/weixin4j/issues</url>
</issueManagement> </issueManagement>
<developers> <developers>
<developer> <developer>
<email>hujinyuhao@163.com</email> <email>hujinyuhao@163.com</email>
<id>jinyu</id> <id>jinyu</id>
<name>jinyu</name> <name>jinyu</name>
<url>https://github.com/foxinmy</url> <url>https://github.com/foxinmy</url>
<timezone>+8</timezone> <timezone>+8</timezone>
<roles> <roles>
<role>java developer</role> <role>java developer</role>
</roles> </roles>
</developer> </developer>
</developers> </developers>
<modules> <modules>
<module>weixin4j-base</module> <module>weixin4j-base</module>
<module>weixin4j-mp</module> <module>weixin4j-mp</module>
<module>weixin4j-qy</module> <module>weixin4j-qy</module>
<module>weixin4j-server</module> <module>weixin4j-server</module>
<module>weixin4j-example</module> <module>weixin4j-example</module>
</modules> </modules>
<properties> <properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.6</maven.compiler.source> <maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target> <maven.compiler.target>1.6</maven.compiler.target>
<fastjson.version>1.2.3</fastjson.version> <fastjson.version>1.2.3</fastjson.version>
</properties> </properties>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.0</version> <version>3.0</version>
<configuration> <configuration>
<source>1.6</source> <source>1.6</source>
<target>1.6</target> <target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId> <artifactId>maven-resources-plugin</artifactId>
<version>2.6</version> <version>2.6</version>
<configuration> <configuration>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
<!-- 过滤证书文件 --> <!-- 过滤证书文件 -->
<nonFilteredFileExtensions> <nonFilteredFileExtensions>
<nonFilteredFileExtension>pem</nonFilteredFileExtension> <nonFilteredFileExtension>pem</nonFilteredFileExtension>
<nonFilteredFileExtension>pfx</nonFilteredFileExtension> <nonFilteredFileExtension>pfx</nonFilteredFileExtension>
<nonFilteredFileExtension>p12</nonFilteredFileExtension> <nonFilteredFileExtension>p12</nonFilteredFileExtension>
<nonFilteredFileExtension>jks</nonFilteredFileExtension> <nonFilteredFileExtension>jks</nonFilteredFileExtension>
</nonFilteredFileExtensions> </nonFilteredFileExtensions>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId> <artifactId>maven-jar-plugin</artifactId>
<version>2.5</version> <version>2.5</version>
<executions> <executions>
<execution> <execution>
<id>default-jar</id> <id>default-jar</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
<configuration> <configuration>
<classesDirectory>target/classes</classesDirectory> <classesDirectory>target/classes</classesDirectory>
<excludes> <excludes>
<exclude>*.properties</exclude> <exclude>*.properties</exclude>
<exclude>*.xml</exclude> <exclude>*.xml</exclude>
<exclude>*.txt</exclude> <exclude>*.txt</exclude>
<exclude>**/*.md</exclude> <exclude>**/*.md</exclude>
</excludes> </excludes>
<archive> <archive>
<addMavenDescriptor>true</addMavenDescriptor> <addMavenDescriptor>true</addMavenDescriptor>
</archive> </archive>
<useDefaultManifestFile>true</useDefaultManifestFile> <useDefaultManifestFile>true</useDefaultManifestFile>
</configuration> </configuration>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
<pluginManagement> <pluginManagement>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
<version>2.4</version> <version>2.4</version>
<executions> <executions>
<execution> <execution>
<id>attach-sources</id> <id>attach-sources</id>
<goals> <goals>
<goal>jar-no-fork</goal> <goal>jar-no-fork</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<excludes> <excludes>
<exclude>*.properties</exclude> <exclude>*.properties</exclude>
<exclude>*.xml</exclude> <exclude>*.xml</exclude>
</excludes> </excludes>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.1</version> <version>2.10.1</version>
<executions> <executions>
<execution> <execution>
<id>attach-javadocs</id> <id>attach-javadocs</id>
<goals> <goals>
<goal>jar</goal> <goal>jar</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
<configuration> <configuration>
<show>public</show> <show>public</show>
<charset>${project.build.sourceEncoding}</charset> <charset>${project.build.sourceEncoding}</charset>
<encoding>${project.build.sourceEncoding}</encoding> <encoding>${project.build.sourceEncoding}</encoding>
<docencoding>${project.build.sourceEncoding}</docencoding> <docencoding>${project.build.sourceEncoding}</docencoding>
<links> <links>
<link>http://docs.oracle.com/javase/7/docs/api</link> <link>http://docs.oracle.com/javase/7/docs/api</link>
</links> </links>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId> <artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version> <version>2.8.2</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
<version>1.5</version> <version>1.5</version>
<executions> <executions>
<execution> <execution>
<phase>verify</phase> <phase>verify</phase>
<goals> <goals>
<goal>sign</goal> <goal>sign</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-surefire-plugin</artifactId>
<version>2.18</version> <version>2.18</version>
<configuration> <configuration>
<skipTests>true</skipTests> <skipTests>true</skipTests>
</configuration> </configuration>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId> <artifactId>maven-assembly-plugin</artifactId>
<version>2.5.1</version> <version>2.5.1</version>
<configuration> <configuration>
<descriptors> <descriptors>
<descriptor>../assembly.xml</descriptor> <descriptor>../assembly.xml</descriptor>
</descriptors> </descriptors>
</configuration> </configuration>
<executions> <executions>
<execution> <execution>
<id>make-assembly</id> <id>make-assembly</id>
<phase>package</phase> <phase>package</phase>
<goals> <goals>
<goal>single</goal> <goal>single</goal>
</goals> </goals>
</execution> </execution>
</executions> </executions>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
<resources> <resources>
<resource> <resource>
<directory>src/main/java</directory> <directory>src/main/java</directory>
<includes> <includes>
<include>**/*.xml</include> <include>**/*.xml</include>
<include>**/*.properties</include> <include>**/*.properties</include>
<include>**/*.pem</include> <include>**/*.pem</include>
<include>**/*.p12</include> <include>**/*.p12</include>
<include>**/*.pfx</include> <include>**/*.pfx</include>
</includes> </includes>
</resource> </resource>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<includes> <includes>
<include>**/*.xml</include> <include>**/*.xml</include>
<include>**/*.properties</include> <include>**/*.properties</include>
</includes> </includes>
</resource> </resource>
</resources> </resources>
</build> </build>
<profiles> <profiles>
<profile> <profile>
<id>release</id> <id>release</id>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId> <artifactId>maven-source-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId> <artifactId>maven-javadoc-plugin</artifactId>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId> <artifactId>maven-gpg-plugin</artifactId>
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
</profile> </profile>
</profiles> </profiles>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>junit</groupId> <groupId>junit</groupId>
<artifactId>junit</artifactId> <artifactId>junit</artifactId>
<version>4.8.2</version> <version>4.8.2</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<distributionManagement> <distributionManagement>
<snapshotRepository> <snapshotRepository>
<id>oss-snapshot</id> <id>oss-snapshot</id>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url> <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository> </snapshotRepository>
<repository> <repository>
<id>oss-release</id> <id>oss-release</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url> <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository> </repository>
</distributionManagement> </distributionManagement>
</project> </project>

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.7.0</version> <version>1.7.1</version>
</parent> </parent>
<artifactId>weixin4j-base</artifactId> <artifactId>weixin4j-base</artifactId>
<name>weixin4j-base</name> <name>weixin4j-base</name>

View File

@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.foxinmy.weixin4j.model.card.CardQR; import com.foxinmy.weixin4j.model.card.CardQR;
import com.foxinmy.weixin4j.type.QRType; import com.foxinmy.weixin4j.type.QRType;
import com.foxinmy.weixin4j.util.Consts;
/** /**
* 二维码参数对象 * 二维码参数对象
@ -22,7 +23,7 @@ import com.foxinmy.weixin4j.type.QRType;
public class QRParameter implements Serializable { public class QRParameter implements Serializable {
private static final long serialVersionUID = 6611187606558274253L; private static final long serialVersionUID = 6611187606558274253L;
/** /**
* 二维码的类型 * 二维码的类型
* *
@ -35,6 +36,11 @@ public class QRParameter implements Serializable {
*/ */
@JSONField(name = "expire_seconds") @JSONField(name = "expire_seconds")
private Integer expireSeconds; private Integer expireSeconds;
/**
* 二维码的场景值
*/
@JSONField(serialize = false)
private String sceneValue;
/** /**
* 二维码的内容 * 二维码的内容
*/ */
@ -42,9 +48,10 @@ public class QRParameter implements Serializable {
private JSONObject sceneContent; private JSONObject sceneContent;
private QRParameter(QRType qrType, Integer expireSeconds, private QRParameter(QRType qrType, Integer expireSeconds,
JSONObject sceneContent) { String sceneValue, JSONObject sceneContent) {
this.qrType = qrType; this.qrType = qrType;
this.expireSeconds = expireSeconds; this.expireSeconds = expireSeconds;
this.sceneValue = sceneValue;
this.sceneContent = sceneContent; this.sceneContent = sceneContent;
} }
@ -56,6 +63,10 @@ public class QRParameter implements Serializable {
return qrType; return qrType;
} }
public String getSceneValue() {
return sceneValue;
}
public JSONObject getSceneContent() { public JSONObject getSceneContent() {
return sceneContent; return sceneContent;
} }
@ -75,7 +86,8 @@ public class QRParameter implements Serializable {
JSONObject scene = new JSONObject(); JSONObject scene = new JSONObject();
scene.put("scene_id", sceneValue); scene.put("scene_id", sceneValue);
sceneContent.put("scene", scene); sceneContent.put("scene", scene);
return new QRParameter(QRType.QR_SCENE, expireSeconds, sceneContent); return new QRParameter(QRType.QR_SCENE, expireSeconds,
Long.toString(sceneValue), sceneContent);
} }
/** /**
@ -89,7 +101,8 @@ public class QRParameter implements Serializable {
JSONObject scene = new JSONObject(); JSONObject scene = new JSONObject();
scene.put("scene_id", sceneValue); scene.put("scene_id", sceneValue);
sceneContent.put("scene", scene); sceneContent.put("scene", scene);
return new QRParameter(QRType.QR_LIMIT_SCENE, null, sceneContent); return new QRParameter(QRType.QR_LIMIT_SCENE, null,
Integer.toString(sceneValue), sceneContent);
} }
/** /**
@ -103,7 +116,8 @@ public class QRParameter implements Serializable {
JSONObject scene = new JSONObject(); JSONObject scene = new JSONObject();
scene.put("scene_str", sceneValue); scene.put("scene_str", sceneValue);
sceneContent.put("scene", scene); sceneContent.put("scene", scene);
return new QRParameter(QRType.QR_LIMIT_STR_SCENE, null, sceneContent); return new QRParameter(QRType.QR_LIMIT_STR_SCENE, null, sceneValue,
sceneContent);
} }
/** /**
@ -118,15 +132,22 @@ public class QRParameter implements Serializable {
CardQR... cardQRs) { CardQR... cardQRs) {
QRType qrType = QRType.QR_CARD; QRType qrType = QRType.QR_CARD;
JSONObject sceneContent = new JSONObject(); JSONObject sceneContent = new JSONObject();
StringBuilder sceneValue = new StringBuilder();
sceneValue.append(cardQRs[0].getSceneValue());
if (cardQRs.length > 1) { if (cardQRs.length > 1) {
qrType = QRType.QR_MULTIPLE_CARD; qrType = QRType.QR_MULTIPLE_CARD;
JSONObject multipleCard = new JSONObject(); JSONObject multipleCard = new JSONObject();
multipleCard.put("card_list", cardQRs); multipleCard.put("card_list", cardQRs);
sceneContent.put("multiple_card", multipleCard); sceneContent.put("multiple_card", multipleCard);
for (int i = 1; i < cardQRs.length; i++) {
sceneValue.append(Consts.SEPARATOR).append(
cardQRs[i].getSceneValue());
}
} else { } else {
sceneContent.put("card", cardQRs[0]); sceneContent.put("card", cardQRs[0]);
} }
return new QRParameter(qrType, expireSeconds, sceneContent); return new QRParameter(qrType, expireSeconds, sceneValue.toString(),
sceneContent);
} }
@Override @Override

View File

@ -951,5 +951,5 @@ public class WeixinPayProxy {
return customsApi.queryCustomsOrder(idQuery, customsCity); return customsApi.queryCustomsOrder(idQuery, customsCity);
} }
public final static String VERSION = "1.7.0"; public final static String VERSION = "1.7.1";
} }

View File

@ -28,4 +28,5 @@ public final class Consts {
public static final String SHA1 = "SHA-1"; public static final String SHA1 = "SHA-1";
public static final String PROTOCOL_FILE = "file"; public static final String PROTOCOL_FILE = "file";
public static final String PROTOCOL_JAR = "jar"; public static final String PROTOCOL_JAR = "jar";
public static final String SEPARATOR = ",";
} }

View File

@ -242,4 +242,10 @@
* 2016-08-05 * 2016-08-05
+ 新增CardApi:创建卡券接口 + 新增CardApi:创建卡券接口
* 2016-08-09
+ 新增创建卡券二维码接口
+ version upgrade to 1.7.1

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.7.0</version> <version>1.7.1</version>
</parent> </parent>
<artifactId>weixin4j-mp</artifactId> <artifactId>weixin4j-mp</artifactId>
<name>weixin4j-mp</name> <name>weixin4j-mp</name>

View File

@ -185,5 +185,5 @@ public class WeixinComponentProxy {
component(componentId).getTokenManager()); component(componentId).getTokenManager());
} }
public final static String VERSION = "1.7.0"; public final static String VERSION = "1.7.1";
} }

View File

@ -1926,5 +1926,5 @@ public class WeixinProxy {
return cardApi.createCardQR(expireSeconds, cardQRs); return cardApi.createCardQR(expireSeconds, cardQRs);
} }
public final static String VERSION = "1.7.0"; public final static String VERSION = "1.7.1";
} }

View File

@ -187,4 +187,8 @@
* 2016-06-20 * 2016-06-20
+ version upgrade to 1.7.0 + version upgrade to 1.7.0
* 2016-08-09
+ version upgrade to 1.7.1

View File

@ -5,7 +5,7 @@
<parent> <parent>
<groupId>com.foxinmy</groupId> <groupId>com.foxinmy</groupId>
<artifactId>weixin4j</artifactId> <artifactId>weixin4j</artifactId>
<version>1.7.0</version> <version>1.7.1</version>
</parent> </parent>
<artifactId>weixin4j-qy</artifactId> <artifactId>weixin4j-qy</artifactId>
<name>weixin4j-qy</name> <name>weixin4j-qy</name>

View File

@ -1353,5 +1353,5 @@ public class WeixinProxy {
return chatApi.sendChatMessage(message); return chatApi.sendChatMessage(message);
} }
public final static String VERSION = "1.7.0"; public final static String VERSION = "1.7.1";
} }

View File

@ -243,5 +243,5 @@ public class WeixinSuiteProxy {
return new WeixinProxy(suite(suiteId).getPerTicketManager(authCorpId), suite(suiteId).getTokenManager()); return new WeixinProxy(suite(suiteId).getPerTicketManager(authCorpId), suite(suiteId).getTokenManager());
} }
public final static String VERSION = "1.7.0"; public final static String VERSION = "1.7.1";
} }