maven多模块分离
This commit is contained in:
parent
4cee4678af
commit
cde0f75069
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,3 @@
|
|||||||
ass
|
|
||||||
|
|
||||||
# Mobile Tools for Java (J2ME)
|
# Mobile Tools for Java (J2ME)
|
||||||
.mtj.tmp/
|
.mtj.tmp/
|
||||||
|
|
||||||
@ -27,4 +25,4 @@ target/*
|
|||||||
*.tmp
|
*.tmp
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
/target/
|
/target/
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|||||||
57
README.md
57
README.md
@ -1,65 +1,24 @@
|
|||||||
weixin4j
|
weixin4j
|
||||||
========
|
========
|
||||||
|
|
||||||
tencent weixin platform java sdk 微信公众平台开发工具包 http://mp.weixin.qq.com/wiki
|
微信开发工具包
|
||||||
|
|
||||||
功能列表
|
功能列表
|
||||||
-------
|
-------
|
||||||
|
|
||||||
* TokenApi token实现API
|
* 公众平台API封装
|
||||||
|
|
||||||
* MediaApi 上传/下载媒体文件API
|
|
||||||
|
|
||||||
* NotifyApi 客服消息API
|
|
||||||
|
|
||||||
* MassApi 群发消息API
|
|
||||||
|
|
||||||
* UserApi 用户管理API
|
|
||||||
|
|
||||||
* GroupApi 分组管理API
|
|
||||||
|
|
||||||
* MenuApi 底部菜单API
|
|
||||||
|
|
||||||
* QrApi 二维码API
|
|
||||||
|
|
||||||
* TmplApi 模板消息API
|
|
||||||
|
|
||||||
* HelperApi 辅助API
|
|
||||||
|
|
||||||
* netty服务器 & 消息分发
|
|
||||||
|
|
||||||
|
|
||||||
如何使用
|
|
||||||
--------
|
|
||||||
|
|
||||||
1.编辑weixin.properties文件,填入appid/appsecret信息,当然也可通过构造函数传入.
|
|
||||||
|
|
||||||
2.实例化一个WeixinProxy对象,如无特别指明appid/appsecret则使用weixin.properties中的值.
|
|
||||||
|
|
||||||
WeixinProxy weixinProxy = new WeixinProxy();
|
|
||||||
// weixinProxy = new WeixinProxy(appid,appsecret);
|
|
||||||
weixinProxy.getUser(openId);
|
|
||||||
|
|
||||||
3.针对token存储有两种方案,File存储/Redis存储,当然也可自己实现TokenApi,如无特别指明默认使用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenApi.
|
|
||||||
|
|
||||||
WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenApi());
|
|
||||||
// weixinProxy = new WeixinProxy(new RedisTokenApi(appid,appsecret));
|
|
||||||
|
|
||||||
4.mvn package,得到一个zip的压缩包,解压到启动目录(见src/main/startup.sh/APP_HOME)
|
|
||||||
|
|
||||||
5.启动netty服务
|
|
||||||
|
|
||||||
com.foxinmy.weixin4j.server.WeixinServiceBootstrap
|
|
||||||
sh startup.sh start
|
|
||||||
|
|
||||||
更新LOG
|
更新LOG
|
||||||
-------
|
-------
|
||||||
2014-10-27
|
2014-10-27
|
||||||
|
|
||||||
1).用netty构建http服务器并支持消息分发
|
1).maven多模块分离
|
||||||
|
|
||||||
|
2).weixin4j-mp:用netty构建http服务器并支持消息分发
|
||||||
|
|
||||||
接下来
|
接下来
|
||||||
------
|
------
|
||||||
maven多模块分离
|
公众号支付模块引入
|
||||||
|
|
||||||
微信支付模块引入
|
企业号API封装
|
||||||
|
|||||||
173
pom.xml
173
pom.xml
@ -1,13 +1,35 @@
|
|||||||
<?xml version="1.0"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project
|
<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">
|
||||||
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.foxinmy.weixin</groupId>
|
<groupId>com.foxinmy.weixin4j</groupId>
|
||||||
<version>0.0.1-SNAPSHOT</version>
|
|
||||||
<artifactId>weixin4j</artifactId>
|
<artifactId>weixin4j</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
<packaging>pom</packaging>
|
||||||
<name>weixin4j</name>
|
<name>weixin4j</name>
|
||||||
|
<modules>
|
||||||
|
<module>weixin4j-base</module>
|
||||||
|
<module>weixin4j-mp</module>
|
||||||
|
<module>weixin4j-qy</module>
|
||||||
|
</modules>
|
||||||
|
<properties>
|
||||||
|
<weixin4j.version>0.0.1-SNAPSHOT</weixin4j.version>
|
||||||
|
<junit.version>4.8.2</junit.version>
|
||||||
|
<dom4j.version>1.6.1</dom4j.version>
|
||||||
|
<logback.version>1.0.9</logback.version>
|
||||||
|
<jcl.over.version>1.7.6</jcl.over.version>
|
||||||
|
<log4j.over.version>1.7.6</log4j.over.version>
|
||||||
|
<xstream.version>1.4.7</xstream.version>
|
||||||
|
<httpclient.version>4.2.5</httpclient.version>
|
||||||
|
<commons.codec.version>1.9</commons.codec.version>
|
||||||
|
<fastjson.version>1.1.9</fastjson.version>
|
||||||
|
<jsoup.version>1.7.3</jsoup.version>
|
||||||
|
<jaxen.version>1.1.6</jaxen.version>
|
||||||
|
<jedis.version>2.6.0</jedis.version>
|
||||||
|
<netty.version>4.0.23.Final</netty.version>
|
||||||
|
<commons.lang.version>3.3.2</commons.lang.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
</properties>
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
@ -27,27 +49,7 @@
|
|||||||
<encoding>${project.build.sourceEncoding}</encoding>
|
<encoding>${project.build.sourceEncoding}</encoding>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
|
||||||
<artifactId>maven-assembly-plugin</artifactId>
|
|
||||||
<version>2.2.1</version>
|
|
||||||
<configuration>
|
|
||||||
<descriptors>
|
|
||||||
<descriptor>src/main/assembly.xml</descriptor>
|
|
||||||
</descriptors>
|
|
||||||
</configuration>
|
|
||||||
<executions>
|
|
||||||
<execution>
|
|
||||||
<id>make-assembly</id>
|
|
||||||
<phase>package</phase>
|
|
||||||
<goals>
|
|
||||||
<goal>single</goal>
|
|
||||||
</goals>
|
|
||||||
</execution>
|
|
||||||
</executions>
|
|
||||||
</plugin>
|
|
||||||
</plugins>
|
</plugins>
|
||||||
<finalName>weixin4j</finalName>
|
|
||||||
</build>
|
</build>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -56,122 +58,7 @@
|
|||||||
<version>${junit.version}</version>
|
<version>${junit.version}</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.thoughtworks.xstream</groupId>
|
|
||||||
<artifactId>xstream</artifactId>
|
|
||||||
<version>${xstream.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpclient</artifactId>
|
|
||||||
<version>${httpclient.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>commons-logging</artifactId>
|
|
||||||
<groupId>commons-logging</groupId>
|
|
||||||
</exclusion>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.apache.httpcomponents</groupId>
|
|
||||||
<artifactId>httpmime</artifactId>
|
|
||||||
<version>${httpclient.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>commons-codec</groupId>
|
|
||||||
<artifactId>commons-codec</artifactId>
|
|
||||||
<version>${commons.codec.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>com.alibaba</groupId>
|
|
||||||
<artifactId>fastjson</artifactId>
|
|
||||||
<version>${fastjson.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>dom4j</groupId>
|
|
||||||
<artifactId>dom4j</artifactId>
|
|
||||||
<version>${dom4j.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-core</artifactId>
|
|
||||||
<version>${logback.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
<artifactId>logback-classic</artifactId>
|
|
||||||
<version>${logback.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<artifactId>logback-core</artifactId>
|
|
||||||
<groupId>ch.qos.logback</groupId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>jcl-over-slf4j</artifactId>
|
|
||||||
<version>${jcl.over.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>log4j-over-slf4j</artifactId>
|
|
||||||
<version>${log4j.over.version}</version>
|
|
||||||
<exclusions>
|
|
||||||
<exclusion>
|
|
||||||
<groupId>org.slf4j</groupId>
|
|
||||||
<artifactId>slf4j-api</artifactId>
|
|
||||||
</exclusion>
|
|
||||||
</exclusions>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.jsoup</groupId>
|
|
||||||
<artifactId>jsoup</artifactId>
|
|
||||||
<version>${jsoup.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>jaxen</groupId>
|
|
||||||
<artifactId>jaxen</artifactId>
|
|
||||||
<version>${jaxen.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>redis.clients</groupId>
|
|
||||||
<artifactId>jedis</artifactId>
|
|
||||||
<version>${jedis.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.netty</groupId>
|
|
||||||
<artifactId>netty-all</artifactId>
|
|
||||||
<version>${netty.version}</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<properties>
|
|
||||||
<junit.version>4.8.2</junit.version>
|
|
||||||
<dom4j.version>1.6.1</dom4j.version>
|
|
||||||
<logback.version>1.0.9</logback.version>
|
|
||||||
<jcl.over.version>1.7.6</jcl.over.version>
|
|
||||||
<log4j.over.version>1.7.6</log4j.over.version>
|
|
||||||
<xstream.version>1.4.7</xstream.version>
|
|
||||||
<httpclient.version>4.2.5</httpclient.version>
|
|
||||||
<commons.codec.version>1.9</commons.codec.version>
|
|
||||||
<fastjson.version>1.1.9</fastjson.version>
|
|
||||||
<jsoup.version>1.7.3</jsoup.version>
|
|
||||||
<jaxen.version>1.1.6</jaxen.version>
|
|
||||||
<jedis.version>2.6.0</jedis.version>
|
|
||||||
<netty.version>4.0.23.Final</netty.version>
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
||||||
</properties>
|
|
||||||
<profiles>
|
<profiles>
|
||||||
<profile>
|
<profile>
|
||||||
<id>default</id>
|
<id>default</id>
|
||||||
@ -183,4 +70,4 @@
|
|||||||
</properties>
|
</properties>
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
@ -1,23 +0,0 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 返回空白消息
|
|
||||||
*
|
|
||||||
* @className BlankAction
|
|
||||||
* @author jy.hu
|
|
||||||
* @date 2014年10月2日
|
|
||||||
* @since JDK 1.7
|
|
||||||
* @see
|
|
||||||
*/
|
|
||||||
public abstract class BlankAction<M extends BaseMessage> extends
|
|
||||||
AbstractAction<M> {
|
|
||||||
|
|
||||||
private final String BLANK = "";
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String execute(M message) {
|
|
||||||
return BLANK;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1 +0,0 @@
|
|||||||
基于HttpClient封装的针对微信公众平台API的HttpRequest
|
|
||||||
@ -1,5 +0,0 @@
|
|||||||
package com.foxinmy.weixin4j.spider;
|
|
||||||
|
|
||||||
public final class MpWeixin {
|
|
||||||
|
|
||||||
}
|
|
||||||
26
weixin4j-base/.classpath
Normal file
26
weixin4j-base/.classpath
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<classpath>
|
||||||
|
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
|
</classpath>
|
||||||
1
weixin4j-base/.gitignore
vendored
Normal file
1
weixin4j-base/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/target/
|
||||||
23
weixin4j-base/.project
Normal file
23
weixin4j-base/.project
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<projectDescription>
|
||||||
|
<name>weixin4j-base</name>
|
||||||
|
<comment></comment>
|
||||||
|
<projects>
|
||||||
|
</projects>
|
||||||
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.m2e.core.maven2Builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
|
</buildSpec>
|
||||||
|
<natures>
|
||||||
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
|
</natures>
|
||||||
|
</projectDescription>
|
||||||
4
weixin4j-base/.settings/org.eclipse.core.resources.prefs
Normal file
4
weixin4j-base/.settings/org.eclipse.core.resources.prefs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
encoding//src/main/java=UTF-8
|
||||||
|
encoding//src/test/java=UTF-8
|
||||||
|
encoding/<project>=UTF-8
|
||||||
13
weixin4j-base/.settings/org.eclipse.jdt.core.prefs
Normal file
13
weixin4j-base/.settings/org.eclipse.jdt.core.prefs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
eclipse.preferences.version=1
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
|
||||||
|
org.eclipse.jdt.core.compiler.compliance=1.7
|
||||||
|
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.source=1.7
|
||||||
4
weixin4j-base/.settings/org.eclipse.m2e.core.prefs
Normal file
4
weixin4j-base/.settings/org.eclipse.m2e.core.prefs
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
activeProfiles=
|
||||||
|
eclipse.preferences.version=1
|
||||||
|
resolveWorkspaceProjects=true
|
||||||
|
version=1
|
||||||
4
weixin4j-base/README.md
Normal file
4
weixin4j-base/README.md
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
weixin4j-base
|
||||||
|
=============
|
||||||
|
|
||||||
|
tencent weixin base java sdk 微信开发基础工程
|
||||||
104
weixin4j-base/pom.xml
Normal file
104
weixin4j-base/pom.xml
Normal file
@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.foxinmy.weixin4j</groupId>
|
||||||
|
<artifactId>weixin4j</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<artifactId>weixin4j-base</artifactId>
|
||||||
|
<name>weixin4j-base</name>
|
||||||
|
<url>https://github.com/foxinmy</url>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.thoughtworks.xstream</groupId>
|
||||||
|
<artifactId>xstream</artifactId>
|
||||||
|
<version>${xstream.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpclient</artifactId>
|
||||||
|
<version>${httpclient.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
</exclusion>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.httpcomponents</groupId>
|
||||||
|
<artifactId>httpmime</artifactId>
|
||||||
|
<version>${httpclient.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
<version>${commons.lang.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>${fastjson.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>dom4j</groupId>
|
||||||
|
<artifactId>dom4j</artifactId>
|
||||||
|
<version>${dom4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
<artifactId>logback-classic</artifactId>
|
||||||
|
<version>${logback.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<artifactId>logback-core</artifactId>
|
||||||
|
<groupId>ch.qos.logback</groupId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>jcl-over-slf4j</artifactId>
|
||||||
|
<version>${jcl.over.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>log4j-over-slf4j</artifactId>
|
||||||
|
<version>${log4j.over.version}</version>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>org.slf4j</groupId>
|
||||||
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>redis.clients</groupId>
|
||||||
|
<artifactId>jedis</artifactId>
|
||||||
|
<version>${jedis.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-codec</groupId>
|
||||||
|
<artifactId>commons-codec</artifactId>
|
||||||
|
<version>${commons.codec.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@ -0,0 +1,32 @@
|
|||||||
|
package com.foxinmy.weixin4j.exception;
|
||||||
|
|
||||||
|
public class PayException extends Exception {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 7148145661883468514L;
|
||||||
|
|
||||||
|
private String errorCode;
|
||||||
|
private String errorMsg;
|
||||||
|
|
||||||
|
public PayException(String errorCode, String errorMsg) {
|
||||||
|
this.errorCode = errorCode;
|
||||||
|
this.errorMsg = errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PayException(String errorMsg) {
|
||||||
|
this.errorCode = "-1";
|
||||||
|
this.errorMsg = errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorCode() {
|
||||||
|
return this.errorCode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getErrorMsg() {
|
||||||
|
return this.errorMsg;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getMessage() {
|
||||||
|
return String.format("%s,%s", getErrorMsg(), getErrorCode());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -6,7 +6,7 @@ import java.io.IOException;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.codec.binary.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.apache.http.Consts;
|
import org.apache.http.Consts;
|
||||||
import org.apache.http.Header;
|
import org.apache.http.Header;
|
||||||
import org.apache.http.HttpEntity;
|
import org.apache.http.HttpEntity;
|
||||||
@ -170,7 +170,7 @@ public class HttpRequest {
|
|||||||
response.setStatusCode(status);
|
response.setStatusCode(status);
|
||||||
response.setStatusText(statusLine.getReasonPhrase());
|
response.setStatusText(statusLine.getReasonPhrase());
|
||||||
response.setStream(new ByteArrayInputStream(data));
|
response.setStream(new ByteArrayInputStream(data));
|
||||||
response.setText(StringUtils.newStringUtf8(data));
|
response.setText(StringUtils.join(data));
|
||||||
|
|
||||||
Header contentType = httpResponse
|
Header contentType = httpResponse
|
||||||
.getFirstHeader(HttpHeaders.CONTENT_TYPE);
|
.getFirstHeader(HttpHeaders.CONTENT_TYPE);
|
||||||
@ -0,0 +1 @@
|
|||||||
|
基于HttpClient封装的针对微信公众平台、微信企业号API的HttpRequest
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.foxinmy.weixin4j.msg.in;
|
package com.foxinmy.weixin4j.msg;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.foxinmy.weixin4j.msg.in;
|
package com.foxinmy.weixin4j.msg;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.foxinmy.weixin4j.msg.in;
|
package com.foxinmy.weixin4j.msg;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.foxinmy.weixin4j.msg.in;
|
package com.foxinmy.weixin4j.msg;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
||||||
@ -1,6 +1,5 @@
|
|||||||
package com.foxinmy.weixin4j.msg.in;
|
package com.foxinmy.weixin4j.msg;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
import com.thoughtworks.xstream.annotations.XStreamAlias;
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.api.token;
|
package com.foxinmy.weixin4j.token;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
@ -1,11 +1,11 @@
|
|||||||
package com.foxinmy.weixin4j.api.token;
|
package com.foxinmy.weixin4j.token;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
|
|
||||||
import org.jsoup.helper.StringUtil;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.HttpRequest;
|
import com.foxinmy.weixin4j.http.HttpRequest;
|
||||||
@ -56,7 +56,7 @@ public class FileTokenApi extends AbstractTokenApi {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Token getToken() throws WeixinException {
|
public Token getToken() throws WeixinException {
|
||||||
if (StringUtil.isBlank(appid) || StringUtil.isBlank(appsecret)) {
|
if (StringUtils.isBlank(appid) || StringUtils.isBlank(appsecret)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"appid or appsecret not be null!");
|
"appid or appsecret not be null!");
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.api.token;
|
package com.foxinmy.weixin4j.token;
|
||||||
|
|
||||||
import org.jsoup.helper.StringUtil;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import redis.clients.jedis.Jedis;
|
import redis.clients.jedis.Jedis;
|
||||||
import redis.clients.jedis.JedisPool;
|
import redis.clients.jedis.JedisPool;
|
||||||
@ -53,7 +53,7 @@ public class RedisTokenApi extends AbstractTokenApi {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Token getToken() throws WeixinException {
|
public Token getToken() throws WeixinException {
|
||||||
if (StringUtil.isBlank(appid) || StringUtil.isBlank(appsecret)) {
|
if (StringUtils.isBlank(appid) || StringUtils.isBlank(appsecret)) {
|
||||||
throw new IllegalArgumentException(
|
throw new IllegalArgumentException(
|
||||||
"appid or appsecret not be null!");
|
"appid or appsecret not be null!");
|
||||||
}
|
}
|
||||||
@ -63,7 +63,7 @@ public class RedisTokenApi extends AbstractTokenApi {
|
|||||||
jedis = jedisPool.getResource();
|
jedis = jedisPool.getResource();
|
||||||
String key = String.format("token:%s", appid);
|
String key = String.format("token:%s", appid);
|
||||||
String accessToken = jedis.get(key);
|
String accessToken = jedis.get(key);
|
||||||
if (StringUtil.isBlank(accessToken)) {
|
if (StringUtils.isBlank(accessToken)) {
|
||||||
String api_token_uri = String.format(
|
String api_token_uri = String.format(
|
||||||
ConfigUtil.getValue("api_token_uri"), appid, appsecret);
|
ConfigUtil.getValue("api_token_uri"), appid, appsecret);
|
||||||
token = request.get(api_token_uri).getAsObject(Token.class);
|
token = request.get(api_token_uri).getAsObject(Token.class);
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.api.token;
|
package com.foxinmy.weixin4j.token;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
@ -11,9 +11,9 @@ import com.foxinmy.weixin4j.model.Token;
|
|||||||
* @date 2014年9月27日
|
* @date 2014年9月27日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.model.Token
|
* @see com.foxinmy.weixin4j.model.Token
|
||||||
* @see com.foxinmy.weixin4j.api.token.AbstractTokenApi
|
* @see com.foxinmy.weixin4j.token.AbstractTokenApi
|
||||||
* @see com.foxinmy.weixin4j.api.token.FileTokenApi
|
* @see com.foxinmy.weixin4j.token.FileTokenApi
|
||||||
* @see com.foxinmy.weixin4j.api.token.RedisTokenApi
|
* @see com.foxinmy.weixin4j.token.RedisTokenApi
|
||||||
*/
|
*/
|
||||||
public interface TokenApi {
|
public interface TokenApi {
|
||||||
public Token getToken() throws WeixinException;
|
public Token getToken() throws WeixinException;
|
||||||
@ -1,16 +1,13 @@
|
|||||||
package com.foxinmy.weixin4j.type;
|
package com.foxinmy.weixin4j.type;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
import com.foxinmy.weixin4j.msg.BaseMessage;
|
||||||
|
import com.foxinmy.weixin4j.msg.ImageMessage;
|
||||||
|
import com.foxinmy.weixin4j.msg.LinkMessage;
|
||||||
|
import com.foxinmy.weixin4j.msg.LocationMessage;
|
||||||
import com.foxinmy.weixin4j.msg.TextMessage;
|
import com.foxinmy.weixin4j.msg.TextMessage;
|
||||||
|
import com.foxinmy.weixin4j.msg.VideoMessage;
|
||||||
|
import com.foxinmy.weixin4j.msg.VoiceMessage;
|
||||||
import com.foxinmy.weixin4j.msg.event.EventMessage;
|
import com.foxinmy.weixin4j.msg.event.EventMessage;
|
||||||
import com.foxinmy.weixin4j.msg.in.ImageMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.in.LinkMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.in.LocationMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.in.VideoMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.in.VoiceMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.out.ArticleMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.out.MusicMessage;
|
|
||||||
import com.foxinmy.weixin4j.msg.out.TransferMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -20,16 +17,10 @@ import com.foxinmy.weixin4j.msg.out.TransferMessage;
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public enum MessageType {
|
public enum MessageType {
|
||||||
// 接收到的消息类型
|
|
||||||
text(TextMessage.class), image(ImageMessage.class), voice(
|
text(TextMessage.class), image(ImageMessage.class), voice(
|
||||||
VoiceMessage.class), video(VideoMessage.class), location(
|
VoiceMessage.class), video(VideoMessage.class), location(
|
||||||
LocationMessage.class), link(LinkMessage.class), event(
|
LocationMessage.class), link(LinkMessage.class), event(
|
||||||
EventMessage.class),
|
EventMessage.class), signature(null);
|
||||||
// 发送的消息类型
|
|
||||||
music(MusicMessage.class), news(ArticleMessage.class), transfer_customer_service(
|
|
||||||
TransferMessage.class),
|
|
||||||
// 微信消息认证
|
|
||||||
signature(null);
|
|
||||||
private Class<? extends BaseMessage> messageClass;
|
private Class<? extends BaseMessage> messageClass;
|
||||||
|
|
||||||
MessageType(Class<? extends BaseMessage> messageClass) {
|
MessageType(Class<? extends BaseMessage> messageClass) {
|
||||||
@ -2,13 +2,10 @@ package com.foxinmy.weixin4j.util;
|
|||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FilenameFilter;
|
import java.io.FilenameFilter;
|
||||||
import java.io.IOException;
|
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.WeixinAction;
|
|
||||||
|
|
||||||
public class ClassUtil {
|
public class ClassUtil {
|
||||||
|
|
||||||
public static Set<Class<?>> getClasses(Package _package) {
|
public static Set<Class<?>> getClasses(Package _package) {
|
||||||
@ -48,9 +45,4 @@ public class ClassUtil {
|
|||||||
}
|
}
|
||||||
return classes;
|
return classes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws ClassNotFoundException,
|
|
||||||
IOException, InstantiationException, IllegalAccessException {
|
|
||||||
System.out.println(getClasses(WeixinAction.class.getPackage()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@ -4,11 +4,11 @@ import java.io.InputStream;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import org.apache.commons.codec.digest.DigestUtils;
|
import org.apache.commons.codec.digest.DigestUtils;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.dom4j.Document;
|
import org.dom4j.Document;
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
import org.dom4j.DocumentHelper;
|
import org.dom4j.DocumentHelper;
|
||||||
import org.dom4j.io.SAXReader;
|
import org.dom4j.io.SAXReader;
|
||||||
import org.jsoup.helper.StringUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -42,12 +42,12 @@ public class MessageUtil {
|
|||||||
*/
|
*/
|
||||||
public static String signature(String token, String echostr,
|
public static String signature(String token, String echostr,
|
||||||
String timestamp, String nonce, String signature) {
|
String timestamp, String nonce, String signature) {
|
||||||
if (StringUtil.isBlank(token)) {
|
if (StringUtils.isBlank(token)) {
|
||||||
log.error("signature fail : token is null!");
|
log.error("signature fail : token is null!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (StringUtil.isBlank(echostr) || StringUtil.isBlank(timestamp)
|
if (StringUtils.isBlank(echostr) || StringUtils.isBlank(timestamp)
|
||||||
|| StringUtil.isBlank(nonce)) {
|
|| StringUtils.isBlank(nonce)) {
|
||||||
log.error("signature fail : invalid parameter!");
|
log.error("signature fail : invalid parameter!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -73,6 +73,7 @@ public class MessageUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取对应的mapping key
|
* 获取对应的mapping key
|
||||||
|
*
|
||||||
* @param xmlMsg
|
* @param xmlMsg
|
||||||
* @return
|
* @return
|
||||||
* @throws DocumentException
|
* @throws DocumentException
|
||||||
@ -104,11 +105,11 @@ public class MessageUtil {
|
|||||||
* @see com.foxinmy.weixin4j.type.MessageType
|
* @see com.foxinmy.weixin4j.type.MessageType
|
||||||
* @see com.feican.weixin.msg.BaeMessage
|
* @see com.feican.weixin.msg.BaeMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.TextMessage
|
* @see com.foxinmy.weixin4j.msg.TextMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.in.ImageMessage
|
* @see com.foxinmy.weixin4j.msg.ImageMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.in.VoiceMessage
|
* @see com.foxinmy.weixin4j.msg.VoiceMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.in.VideoMessage
|
* @see com.foxinmy.weixin4j.msg.VideoMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.in.LocationMessage
|
* @see com.foxinmy.weixin4j.msg.LocationMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.in.LinkMessage
|
* @see com.foxinmy.weixin4j.msg.LinkMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.event.ScribeEventMessage
|
* @see com.foxinmy.weixin4j.msg.event.ScribeEventMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.event.ScanEventMessage
|
* @see com.foxinmy.weixin4j.msg.event.ScanEventMessage
|
||||||
* @see com.foxinmy.weixin4j.msg.event.LocationEventMessage
|
* @see com.foxinmy.weixin4j.msg.event.LocationEventMessage
|
||||||
@ -117,7 +118,7 @@ public class MessageUtil {
|
|||||||
public static BaseMessage xml2msg(String xmlMsg) throws DocumentException {
|
public static BaseMessage xml2msg(String xmlMsg) throws DocumentException {
|
||||||
Document doc = DocumentHelper.parseText(xmlMsg);
|
Document doc = DocumentHelper.parseText(xmlMsg);
|
||||||
String type = doc.selectSingleNode("/xml/MsgType").getStringValue();
|
String type = doc.selectSingleNode("/xml/MsgType").getStringValue();
|
||||||
if (StringUtil.isBlank(type)) {
|
if (StringUtils.isBlank(type)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
MessageType messageType = MessageType.valueOf(type.toLowerCase());
|
MessageType messageType = MessageType.valueOf(type.toLowerCase());
|
||||||
28
weixin4j-mp/.gitignore
vendored
Normal file
28
weixin4j-mp/.gitignore
vendored
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.ear
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
|
||||||
|
*~
|
||||||
|
|
||||||
|
# eclipse ignore
|
||||||
|
*.settings/*
|
||||||
|
/.project
|
||||||
|
/.classpath
|
||||||
|
/.tomcatplugin
|
||||||
|
|
||||||
|
# maven ignore
|
||||||
|
target/*
|
||||||
|
|
||||||
|
# other ignore
|
||||||
|
*.log
|
||||||
|
*.tmp
|
||||||
|
Thumbs.db
|
||||||
|
/target/
|
||||||
|
.DS_Store
|
||||||
59
weixin4j-mp/README.md
Normal file
59
weixin4j-mp/README.md
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
weixin4j-mp
|
||||||
|
===========
|
||||||
|
|
||||||
|
tencent weixin platform java sdk 微信公众平台开发工具包 http://mp.weixin.qq.com/wiki
|
||||||
|
|
||||||
|
功能列表
|
||||||
|
-------
|
||||||
|
|
||||||
|
* TokenApi token实现API
|
||||||
|
|
||||||
|
* MediaApi 上传/下载媒体文件API
|
||||||
|
|
||||||
|
* NotifyApi 客服消息API
|
||||||
|
|
||||||
|
* MassApi 群发消息API
|
||||||
|
|
||||||
|
* UserApi 用户管理API
|
||||||
|
|
||||||
|
* GroupApi 分组管理API
|
||||||
|
|
||||||
|
* MenuApi 底部菜单API
|
||||||
|
|
||||||
|
* QrApi 二维码API
|
||||||
|
|
||||||
|
* TmplApi 模板消息API
|
||||||
|
|
||||||
|
* HelperApi 辅助API
|
||||||
|
|
||||||
|
* netty服务器 & 消息分发
|
||||||
|
|
||||||
|
|
||||||
|
如何使用
|
||||||
|
--------
|
||||||
|
|
||||||
|
1.编辑weixin.properties文件,填入appid/appsecret信息,当然也可通过构造函数传入.
|
||||||
|
|
||||||
|
2.实例化一个WeixinProxy对象,如无特别指明appid/appsecret则使用weixin.properties中的值.
|
||||||
|
|
||||||
|
WeixinProxy weixinProxy = new WeixinProxy();
|
||||||
|
// weixinProxy = new WeixinProxy(appid,appsecret);
|
||||||
|
weixinProxy.getUser(openId);
|
||||||
|
|
||||||
|
3.针对token存储有两种方案,File存储/Redis存储,当然也可自己实现TokenApi,如无特别指明默认使用文件(xml)的方式保存token,如果环境中支持redis,建议使用RedisTokenApi.
|
||||||
|
|
||||||
|
WeixinProxy weixinProxy = new WeixinProxy(new RedisTokenApi());
|
||||||
|
// weixinProxy = new WeixinProxy(new RedisTokenApi(appid,appsecret));
|
||||||
|
|
||||||
|
4.mvn package,得到一个zip的压缩包,解压到启动目录(见src/main/startup.sh/APP_HOME)
|
||||||
|
|
||||||
|
5.启动netty服务
|
||||||
|
|
||||||
|
com.foxinmy.weixin4j.mp.startup.WeixinServiceBootstrap
|
||||||
|
sh startup.sh start
|
||||||
|
|
||||||
|
更新LOG
|
||||||
|
-------
|
||||||
|
2014-10-27
|
||||||
|
|
||||||
|
1).用netty构建http服务器并支持消息分发
|
||||||
61
weixin4j-mp/pom.xml
Normal file
61
weixin4j-mp/pom.xml
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<project
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.foxinmy.weixin4j</groupId>
|
||||||
|
<artifactId>weixin4j</artifactId>
|
||||||
|
<version>0.0.1-SNAPSHOT</version>
|
||||||
|
</parent>
|
||||||
|
<groupId>com.foxinmy.weixin</groupId>
|
||||||
|
<artifactId>weixin4j-mp</artifactId>
|
||||||
|
<name>weixin4j-mp</name>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-assembly-plugin</artifactId>
|
||||||
|
<version>2.2.1</version>
|
||||||
|
<configuration>
|
||||||
|
<descriptors>
|
||||||
|
<descriptor>src/main/assembly.xml</descriptor>
|
||||||
|
</descriptors>
|
||||||
|
</configuration>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>make-assembly</id>
|
||||||
|
<phase>package</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>single</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
<finalName>weixin4j-mp</finalName>
|
||||||
|
</build>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.jsoup</groupId>
|
||||||
|
<artifactId>jsoup</artifactId>
|
||||||
|
<version>${jsoup.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jaxen</groupId>
|
||||||
|
<artifactId>jaxen</artifactId>
|
||||||
|
<version>${jaxen.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.netty</groupId>
|
||||||
|
<artifactId>netty-all</artifactId>
|
||||||
|
<version>${netty.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.foxinmy.weixin4j</groupId>
|
||||||
|
<artifactId>weixin4j-base</artifactId>
|
||||||
|
<version>${weixin4j.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
||||||
@ -1,35 +1,35 @@
|
|||||||
package com.foxinmy.weixin4j;
|
package com.foxinmy.weixin4j.mp;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.foxinmy.weixin4j.api.GroupApi;
|
|
||||||
import com.foxinmy.weixin4j.api.HelperApi;
|
|
||||||
import com.foxinmy.weixin4j.api.MassApi;
|
|
||||||
import com.foxinmy.weixin4j.api.MediaApi;
|
|
||||||
import com.foxinmy.weixin4j.api.MenuApi;
|
|
||||||
import com.foxinmy.weixin4j.api.NotifyApi;
|
|
||||||
import com.foxinmy.weixin4j.api.QrApi;
|
|
||||||
import com.foxinmy.weixin4j.api.TmplApi;
|
|
||||||
import com.foxinmy.weixin4j.api.UserApi;
|
|
||||||
import com.foxinmy.weixin4j.api.token.FileTokenApi;
|
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.BaseResult;
|
import com.foxinmy.weixin4j.http.BaseResult;
|
||||||
import com.foxinmy.weixin4j.model.Button;
|
import com.foxinmy.weixin4j.mp.api.GroupApi;
|
||||||
import com.foxinmy.weixin4j.model.CustomRecord;
|
import com.foxinmy.weixin4j.mp.api.HelperApi;
|
||||||
import com.foxinmy.weixin4j.model.Following;
|
import com.foxinmy.weixin4j.mp.api.MassApi;
|
||||||
import com.foxinmy.weixin4j.model.Group;
|
import com.foxinmy.weixin4j.mp.api.MediaApi;
|
||||||
import com.foxinmy.weixin4j.model.MpArticle;
|
import com.foxinmy.weixin4j.mp.api.MenuApi;
|
||||||
import com.foxinmy.weixin4j.model.QRParameter;
|
import com.foxinmy.weixin4j.mp.api.NotifyApi;
|
||||||
import com.foxinmy.weixin4j.model.User;
|
import com.foxinmy.weixin4j.mp.api.QrApi;
|
||||||
import com.foxinmy.weixin4j.model.UserToken;
|
import com.foxinmy.weixin4j.mp.api.TmplApi;
|
||||||
import com.foxinmy.weixin4j.msg.model.Article;
|
import com.foxinmy.weixin4j.mp.api.UserApi;
|
||||||
import com.foxinmy.weixin4j.msg.model.BaseMsg;
|
import com.foxinmy.weixin4j.mp.model.Button;
|
||||||
import com.foxinmy.weixin4j.msg.notify.BaseNotify;
|
import com.foxinmy.weixin4j.mp.model.CustomRecord;
|
||||||
import com.foxinmy.weixin4j.msg.out.TemplateMessage;
|
import com.foxinmy.weixin4j.mp.model.Following;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.Group;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.MpArticle;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.QRParameter;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.User;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.UserToken;
|
||||||
|
import com.foxinmy.weixin4j.mp.msg.model.Article;
|
||||||
|
import com.foxinmy.weixin4j.mp.msg.model.BaseMsg;
|
||||||
|
import com.foxinmy.weixin4j.mp.msg.notify.BaseNotify;
|
||||||
|
import com.foxinmy.weixin4j.mp.response.TemplateMessage;
|
||||||
|
import com.foxinmy.weixin4j.token.FileTokenApi;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.type.MediaType;
|
import com.foxinmy.weixin4j.type.MediaType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,7 +98,7 @@ public class WeixinProxy {
|
|||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E4%B8%8A%E4%BC%A0%E4%B8%8B%E8%BD%BD%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6">上传下载说明</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E4%B8%8A%E4%BC%A0%E4%B8%8B%E8%BD%BD%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6">上传下载说明</a>
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see com.foxinmy.weixin4j.api.MediaApi
|
* @see com.foxinmy.weixin4j.mp.api.MediaApi
|
||||||
*/
|
*/
|
||||||
public String uploadMedia(File file, MediaType mediaType)
|
public String uploadMedia(File file, MediaType mediaType)
|
||||||
throws WeixinException, IOException {
|
throws WeixinException, IOException {
|
||||||
@ -114,8 +114,8 @@ public class WeixinProxy {
|
|||||||
* 媒体类型
|
* 媒体类型
|
||||||
* @return 上传到微信服务器返回的媒体标识
|
* @return 上传到微信服务器返回的媒体标识
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.api.MediaApi
|
* @see com.foxinmy.weixin4j.mp.api.MediaApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#uploadMedia(File, MediaType)}
|
||||||
*/
|
*/
|
||||||
public String uploadMedia(String fileName, byte[] data, MediaType mediaType)
|
public String uploadMedia(String fileName, byte[] data, MediaType mediaType)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -138,7 +138,7 @@ public class WeixinProxy {
|
|||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E4%B8%8A%E4%BC%A0%E4%B8%8B%E8%BD%BD%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6">上传下载说明</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E4%B8%8A%E4%BC%A0%E4%B8%8B%E8%BD%BD%E5%A4%9A%E5%AA%92%E4%BD%93%E6%96%87%E4%BB%B6">上传下载说明</a>
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see com.foxinmy.weixin4j.api.MediaApi
|
* @see com.foxinmy.weixin4j.mp.api.MediaApi
|
||||||
*/
|
*/
|
||||||
public File downloadMedia(String mediaId, MediaType mediaType)
|
public File downloadMedia(String mediaId, MediaType mediaType)
|
||||||
throws WeixinException, IOException {
|
throws WeixinException, IOException {
|
||||||
@ -152,8 +152,8 @@ public class WeixinProxy {
|
|||||||
* @param mediaType
|
* @param mediaType
|
||||||
* @return 二进制数据包
|
* @return 二进制数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.api.MediaApi
|
* @see com.foxinmy.weixin4j.mp.api.MediaApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#downloadMedia(String, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#downloadMedia(String, MediaType)}
|
||||||
*/
|
*/
|
||||||
public byte[] downloadMediaData(String mediaId, MediaType mediaType)
|
public byte[] downloadMediaData(String mediaId, MediaType mediaType)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -168,13 +168,13 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">发送客服消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">发送客服消息</a>
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.TextNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.TextNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ImageNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ImageNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.MusicNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.MusicNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VideoNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VideoNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VoiceNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VoiceNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ArticleNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify
|
||||||
* @see com.foxinmy.weixin4j.api.NotifyApi
|
* @see com.foxinmy.weixin4j.mp.api.NotifyApi
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(BaseNotify notify) throws WeixinException {
|
public BaseResult sendNotify(BaseNotify notify) throws WeixinException {
|
||||||
return notifyApi.sendNotify(notify);
|
return notifyApi.sendNotify(notify);
|
||||||
@ -189,9 +189,9 @@ public class WeixinProxy {
|
|||||||
* 图文列表
|
* 图文列表
|
||||||
* @return 发送结果
|
* @return 发送结果
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Article
|
* @see com.foxinmy.weixin4j.mp.msg.model.Article
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ArticleNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify
|
||||||
* @see com.foxinmy.weixin4j.api.NotifyApi
|
* @see com.foxinmy.weixin4j.mp.api.NotifyApi
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(String touser, List<Article> articles)
|
public BaseResult sendNotify(String touser, List<Article> articles)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -207,12 +207,12 @@ public class WeixinProxy {
|
|||||||
* 消息类型
|
* 消息类型
|
||||||
* @return 发送结果
|
* @return 发送结果
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Text
|
* @see com.foxinmy.weixin4j.mp.msg.model.Text
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Image
|
* @see com.foxinmy.weixin4j.mp.msg.model.Image
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Music
|
* @see com.foxinmy.weixin4j.mp.msg.model.Music
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Video
|
* @see com.foxinmy.weixin4j.mp.msg.model.Video
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Voice
|
* @see com.foxinmy.weixin4j.mp.msg.model.Voice
|
||||||
* @see com.foxinmy.weixin4j.api.NotifyApi
|
* @see com.foxinmy.weixin4j.mp.api.NotifyApi
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(String touser, BaseMsg baseMsg)
|
public BaseResult sendNotify(String touser, BaseMsg baseMsg)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -233,8 +233,8 @@ public class WeixinProxy {
|
|||||||
* @param pageindex
|
* @param pageindex
|
||||||
* 查询第几页 从1开始
|
* 查询第几页 从1开始
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.CustomRecord
|
* @see com.foxinmy.weixin4j.mp.model.CustomRecord
|
||||||
* @see com.foxinmy.weixin4j.api.NotifyApi
|
* @see com.foxinmy.weixin4j.mp.api.NotifyApi
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%9C%8D%E8%81%8A%E5%A4%A9%E8%AE%B0%E5%BD%95">查询客服聊天记录</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%9C%8D%E8%81%8A%E5%A4%A9%E8%AE%B0%E5%BD%95">查询客服聊天记录</a>
|
||||||
*/
|
*/
|
||||||
@ -255,8 +255,8 @@ public class WeixinProxy {
|
|||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E7.B4.A0.E6.9D.90">上传图文消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E7.B4.A0.E6.9D.90">上传图文消息</a>
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
*/
|
*/
|
||||||
public String uploadArticle(List<MpArticle> articles)
|
public String uploadArticle(List<MpArticle> articles)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -277,8 +277,8 @@ public class WeixinProxy {
|
|||||||
*
|
*
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
*/
|
*/
|
||||||
public String uploadVideo(String mediaId, String title, String desc)
|
public String uploadVideo(String mediaId, String title, String desc)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -296,12 +296,12 @@ public class WeixinProxy {
|
|||||||
* 分组ID
|
* 分组ID
|
||||||
* @return
|
* @return
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroupByOpenId(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroupByOpenId(String)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroups()}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroups()}
|
||||||
*/
|
*/
|
||||||
public String massByGroup(String mediaId, MediaType mediaType,
|
public String massByGroup(String mediaId, MediaType mediaType,
|
||||||
String groupId) throws WeixinException {
|
String groupId) throws WeixinException {
|
||||||
@ -317,12 +317,12 @@ public class WeixinProxy {
|
|||||||
* 分组ID
|
* 分组ID
|
||||||
* @return 发送出去的消息ID
|
* @return 发送出去的消息ID
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#uploadNews(List)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#uploadNews(List)}
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#massByGroup(String,MediaType,String)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#massByGroup(String,MediaType,String)}
|
||||||
*/
|
*/
|
||||||
public String massArticleByGroup(List<MpArticle> articles, String groupId)
|
public String massArticleByGroup(List<MpArticle> articles, String groupId)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -340,11 +340,11 @@ public class WeixinProxy {
|
|||||||
* openId列表
|
* openId列表
|
||||||
* @return
|
* @return
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#massByOpenIds(JSONObject,String...)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#massByOpenIds(JSONObject,String...)}
|
||||||
*/
|
*/
|
||||||
public String massByOpenIds(String mediaId, MediaType mediaType,
|
public String massByOpenIds(String mediaId, MediaType mediaType,
|
||||||
String... openIds) throws WeixinException {
|
String... openIds) throws WeixinException {
|
||||||
@ -360,12 +360,12 @@ public class WeixinProxy {
|
|||||||
* 目标ID列表
|
* 目标ID列表
|
||||||
* @return 发送出去的消息ID
|
* @return 发送出去的消息ID
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadNews(List)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadNews(List)}
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#massByOpenIds(String,MediaType,String...)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#massByOpenIds(String,MediaType,String...)}
|
||||||
*/
|
*/
|
||||||
public String massArticleByOpenIds(List<MpArticle> articles,
|
public String massArticleByOpenIds(List<MpArticle> articles,
|
||||||
String... openIds) throws WeixinException {
|
String... openIds) throws WeixinException {
|
||||||
@ -383,9 +383,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E5.88.A0.E9.99.A4.E7.BE.A4.E5.8F.91">删除群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E5.88.A0.E9.99.A4.E7.BE.A4.E5.8F.91">删除群发</a>
|
||||||
* @see com.foxinmy.weixin4j.api.MassApi
|
* @see com.foxinmy.weixin4j.mp.api.MassApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#massByGroup(JSONObject, String)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#massByGroup(JSONObject, String)}
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#massByOpenIds(JSONObject, String...)
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#massByOpenIds(JSONObject, String...)
|
||||||
*/
|
*/
|
||||||
public BaseResult deleteMassNews(String msgid) throws WeixinException {
|
public BaseResult deleteMassNews(String msgid) throws WeixinException {
|
||||||
return massApi.deleteMassNews(msgid);
|
return massApi.deleteMassNews(msgid);
|
||||||
@ -400,8 +400,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%BD%91%E9%A1%B5%E6%8E%88%E6%9D%83%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF#.E7.AC.AC.E4.BA.8C.E6.AD.A5.EF.BC.9A.E9.80.9A.E8.BF.87code.E6.8D.A2.E5.8F.96.E7.BD.91.E9.A1.B5.E6.8E.88.E6.9D.83access_token">获取用户token</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%BD%91%E9%A1%B5%E6%8E%88%E6%9D%83%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF#.E7.AC.AC.E4.BA.8C.E6.AD.A5.EF.BC.9A.E9.80.9A.E8.BF.87code.E6.8D.A2.E5.8F.96.E7.BD.91.E9.A1.B5.E6.8E.88.E6.9D.83access_token">获取用户token</a>
|
||||||
* @see com.foxinmy.weixin4j.model.UserToken
|
* @see com.foxinmy.weixin4j.mp.model.UserToken
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
*/
|
*/
|
||||||
public UserToken getAccessToken(String code) throws WeixinException {
|
public UserToken getAccessToken(String code) throws WeixinException {
|
||||||
return userApi.getAccessToken(code);
|
return userApi.getAccessToken(code);
|
||||||
@ -416,10 +416,10 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%BD%91%E9%A1%B5%E6%8E%88%E6%9D%83%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF#.E7.AC.AC.E5.9B.9B.E6.AD.A5.EF.BC.9A.E6.8B.89.E5.8F.96.E7.94.A8.E6.88.B7.E4.BF.A1.E6.81.AF.28.E9.9C.80scope.E4.B8.BA_snsapi_userinfo.29">拉取用户信息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%BD%91%E9%A1%B5%E6%8E%88%E6%9D%83%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF#.E7.AC.AC.E5.9B.9B.E6.AD.A5.EF.BC.9A.E6.8B.89.E5.8F.96.E7.94.A8.E6.88.B7.E4.BF.A1.E6.81.AF.28.E9.9C.80scope.E4.B8.BA_snsapi_userinfo.29">拉取用户信息</a>
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see com.foxinmy.weixin4j.model.UserToken
|
* @see com.foxinmy.weixin4j.mp.model.UserToken
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#getAccessToken(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#getAccessToken(String)}
|
||||||
*/
|
*/
|
||||||
public User getUser(UserToken token) throws WeixinException {
|
public User getUser(UserToken token) throws WeixinException {
|
||||||
return userApi.getUser(token);
|
return userApi.getUser(token);
|
||||||
@ -438,8 +438,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF">获取用户信息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E7%94%A8%E6%88%B7%E5%9F%BA%E6%9C%AC%E4%BF%A1%E6%81%AF">获取用户信息</a>
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
*/
|
*/
|
||||||
public User getUser(String openId) throws WeixinException {
|
public User getUser(String openId) throws WeixinException {
|
||||||
return userApi.getUser(openId);
|
return userApi.getUser(openId);
|
||||||
@ -454,8 +454,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%85%B3%E6%B3%A8%E8%80%85%E5%88%97%E8%A1%A8">获取关注者列表</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%85%B3%E6%B3%A8%E8%80%85%E5%88%97%E8%A1%A8">获取关注者列表</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Following
|
* @see com.foxinmy.weixin4j.mp.model.Following
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
*/
|
*/
|
||||||
public Following getFollowing(String nextOpenId) throws WeixinException {
|
public Following getFollowing(String nextOpenId) throws WeixinException {
|
||||||
return userApi.getFollowing(nextOpenId);
|
return userApi.getFollowing(nextOpenId);
|
||||||
@ -472,9 +472,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%85%B3%E6%B3%A8%E8%80%85%E5%88%97%E8%A1%A8">获取关注者列表</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%85%B3%E6%B3%A8%E8%80%85%E5%88%97%E8%A1%A8">获取关注者列表</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Following
|
* @see com.foxinmy.weixin4j.mp.model.Following
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#getFollowing(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#getFollowing(String)}
|
||||||
*/
|
*/
|
||||||
public List<User> getAllFollowing() throws WeixinException {
|
public List<User> getAllFollowing() throws WeixinException {
|
||||||
return userApi.getAllFollowing();
|
return userApi.getAllFollowing();
|
||||||
@ -490,7 +490,7 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E5%A4%87%E6%B3%A8%E5%90%8D%E6%8E%A5%E5%8F%A3">设置用户备注名</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%AE%BE%E7%BD%AE%E7%94%A8%E6%88%B7%E5%A4%87%E6%B3%A8%E5%90%8D%E6%8E%A5%E5%8F%A3">设置用户备注名</a>
|
||||||
* @see com.foxinmy.weixin4j.api.UserApi
|
* @see com.foxinmy.weixin4j.mp.api.UserApi
|
||||||
*/
|
*/
|
||||||
public BaseResult remarkUserName(String openId, String remark)
|
public BaseResult remarkUserName(String openId, String remark)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -506,9 +506,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E5.88.9B.E5.BB.BA.E5.88.86.E7.BB.84">创建分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E5.88.9B.E5.BB.BA.E5.88.86.E7.BB.84">创建分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.model.Group#toCreateJson()
|
* @see com.foxinmy.weixin4j.mp.model.Group#toCreateJson()
|
||||||
* @see com.foxinmy.weixin4j.api.GroupApi
|
* @see com.foxinmy.weixin4j.mp.api.GroupApi
|
||||||
*/
|
*/
|
||||||
public Group createGroup(String name) throws WeixinException {
|
public Group createGroup(String name) throws WeixinException {
|
||||||
return groupApi.createGroup(name);
|
return groupApi.createGroup(name);
|
||||||
@ -521,8 +521,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E6.89.80.E6.9C.89.E5.88.86.E7.BB.84">查询所有分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E6.89.80.E6.9C.89.E5.88.86.E7.BB.84">查询所有分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.api.GroupApi
|
* @see com.foxinmy.weixin4j.mp.api.GroupApi
|
||||||
*/
|
*/
|
||||||
public List<Group> getGroups() throws WeixinException {
|
public List<Group> getGroups() throws WeixinException {
|
||||||
return groupApi.getGroups();
|
return groupApi.getGroups();
|
||||||
@ -537,8 +537,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E7.94.A8.E6.88.B7.E6.89.80.E5.9C.A8.E5.88.86.E7.BB.84">查询用户所在分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E7.94.A8.E6.88.B7.E6.89.80.E5.9C.A8.E5.88.86.E7.BB.84">查询用户所在分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.api.GroupApi
|
* @see com.foxinmy.weixin4j.mp.api.GroupApi
|
||||||
*/
|
*/
|
||||||
public int getGroupByOpenId(String openId) throws WeixinException {
|
public int getGroupByOpenId(String openId) throws WeixinException {
|
||||||
return groupApi.getGroupByOpenId(openId);
|
return groupApi.getGroupByOpenId(openId);
|
||||||
@ -554,9 +554,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E4.BF.AE.E6.94.B9.E5.88.86.E7.BB.84.E5.90.8D">修改分组名</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E4.BF.AE.E6.94.B9.E5.88.86.E7.BB.84.E5.90.8D">修改分组名</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.model.Group#toModifyJson()
|
* @see com.foxinmy.weixin4j.mp.model.Group#toModifyJson()
|
||||||
* @see com.foxinmy.weixin4j.api.GroupApi
|
* @see com.foxinmy.weixin4j.mp.api.GroupApi
|
||||||
*/
|
*/
|
||||||
public BaseResult modifyGroup(int groupId, String name)
|
public BaseResult modifyGroup(int groupId, String name)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -573,8 +573,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E7.A7.BB.E5.8A.A8.E7.94.A8.E6.88.B7.E5.88.86.E7.BB.84">移动分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E7.A7.BB.E5.8A.A8.E7.94.A8.E6.88.B7.E5.88.86.E7.BB.84">移动分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.api.GroupApi
|
* @see com.foxinmy.weixin4j.mp.api.GroupApi
|
||||||
*/
|
*/
|
||||||
public BaseResult moveGroup(String openId, int groupId)
|
public BaseResult moveGroup(String openId, int groupId)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -588,9 +588,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%9B%E5%BB%BA%E6%8E%A5%E5%8F%A3">创建自定义菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%9B%E5%BB%BA%E6%8E%A5%E5%8F%A3">创建自定义菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
* @see com.foxinmy.weixin4j.type.ButtonType
|
* @see com.foxinmy.weixin4j.type.ButtonType
|
||||||
* @see com.foxinmy.weixin4j.api.MenuApi
|
* @see com.foxinmy.weixin4j.mp.api.MenuApi
|
||||||
*/
|
*/
|
||||||
public BaseResult createMenu(List<Button> btnList) throws WeixinException {
|
public BaseResult createMenu(List<Button> btnList) throws WeixinException {
|
||||||
return menuApi.createMenu(btnList);
|
return menuApi.createMenu(btnList);
|
||||||
@ -603,8 +603,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3">查询菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3">查询菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
* @see com.foxinmy.weixin4j.api.MenuApi
|
* @see com.foxinmy.weixin4j.mp.api.MenuApi
|
||||||
*/
|
*/
|
||||||
public List<Button> getMenu() throws WeixinException {
|
public List<Button> getMenu() throws WeixinException {
|
||||||
return menuApi.getMenu();
|
return menuApi.getMenu();
|
||||||
@ -616,8 +616,8 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3">删除菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3">删除菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
* @see com.foxinmy.weixin4j.api.MenuApi
|
* @see com.foxinmy.weixin4j.mp.api.MenuApi
|
||||||
*/
|
*/
|
||||||
public BaseResult deleteMenu() throws WeixinException {
|
public BaseResult deleteMenu() throws WeixinException {
|
||||||
return menuApi.deleteMenu();
|
return menuApi.deleteMenu();
|
||||||
@ -629,8 +629,8 @@ public class WeixinProxy {
|
|||||||
* @param parameter
|
* @param parameter
|
||||||
* @return byte数据包
|
* @return byte数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.api.QrApi
|
* @see com.foxinmy.weixin4j.mp.api.QrApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy.QrApi#getQR(QRParameter)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy.QrApi#getQR(QRParameter)}
|
||||||
*/
|
*/
|
||||||
public byte[] getQRData(QRParameter parameter) throws WeixinException {
|
public byte[] getQRData(QRParameter parameter) throws WeixinException {
|
||||||
return qrApi.getQRData(parameter);
|
return qrApi.getQRData(parameter);
|
||||||
@ -645,8 +645,8 @@ public class WeixinProxy {
|
|||||||
* 过期秒数 如果小于等于0则 视为永久二维码
|
* 过期秒数 如果小于等于0则 视为永久二维码
|
||||||
* @return byte数据包
|
* @return byte数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.api.QrApi
|
* @see com.foxinmy.weixin4j.mp.api.QrApi
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy.QrApi#getQR(QRParameter)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy.QrApi#getQR(QRParameter)}
|
||||||
*/
|
*/
|
||||||
public byte[] getQRData(int sceneId, int expireSeconds)
|
public byte[] getQRData(int sceneId, int expireSeconds)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -666,8 +666,8 @@ public class WeixinProxy {
|
|||||||
* @throws IOException
|
* @throws IOException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%94%9F%E6%88%90%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81">二维码</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%94%9F%E6%88%90%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81">二维码</a>
|
||||||
* @see com.foxinmy.weixin4j.model.QRParameter
|
* @see com.foxinmy.weixin4j.mp.model.QRParameter
|
||||||
* @see com.foxinmy.weixin4j.api.QrApi
|
* @see com.foxinmy.weixin4j.mp.api.QrApi
|
||||||
*/
|
*/
|
||||||
public File getQR(QRParameter parameter) throws WeixinException,
|
public File getQR(QRParameter parameter) throws WeixinException,
|
||||||
IOException {
|
IOException {
|
||||||
@ -682,9 +682,9 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E6%A8%A1%E6%9D%BF%E6%B6%88%E6%81%AF%E6%8E%A5%E5%8F%A3">模板消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E6%A8%A1%E6%9D%BF%E6%B6%88%E6%81%AF%E6%8E%A5%E5%8F%A3">模板消息</a>
|
||||||
* @see com.foxinmy.weixin4j.msg.out.TemplateMessage
|
* @see com.foxinmy.weixin4j.mp.response.TemplateMessage
|
||||||
* @seee com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage
|
* @seee com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage
|
||||||
* @see com.foxinmy.weixin4j.api.TmplApi
|
* @see com.foxinmy.weixin4j.mp.api.TmplApi
|
||||||
*/
|
*/
|
||||||
public BaseResult sendTmplMessage(TemplateMessage tplMessage)
|
public BaseResult sendTmplMessage(TemplateMessage tplMessage)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -699,7 +699,7 @@ public class WeixinProxy {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%95%BF%E9%93%BE%E6%8E%A5%E8%BD%AC%E7%9F%AD%E9%93%BE%E6%8E%A5%E6%8E%A5%E5%8F%A3">长链接转短链接</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%95%BF%E9%93%BE%E6%8E%A5%E8%BD%AC%E7%9F%AD%E9%93%BE%E6%8E%A5%E6%8E%A5%E5%8F%A3">长链接转短链接</a>
|
||||||
* @see com.foxinmy.weixin4j.api.HelperApi
|
* @see com.foxinmy.weixin4j.mp.api.HelperApi
|
||||||
*/
|
*/
|
||||||
public String getShorturl(String url) throws WeixinException {
|
public String getShorturl(String url) throws WeixinException {
|
||||||
return helperApi.getShorturl(url);
|
return helperApi.getShorturl(url);
|
||||||
@ -1,10 +1,11 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
import java.lang.reflect.Type;
|
||||||
|
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
|
|
||||||
|
import com.foxinmy.weixin4j.mp.response.BaseResponse;
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
import com.foxinmy.weixin4j.msg.BaseMessage;
|
||||||
import com.foxinmy.weixin4j.util.MessageUtil;
|
import com.foxinmy.weixin4j.util.MessageUtil;
|
||||||
import com.foxinmy.weixin4j.xml.XStream;
|
import com.foxinmy.weixin4j.xml.XStream;
|
||||||
@ -21,7 +22,7 @@ import com.foxinmy.weixin4j.xml.XStream;
|
|||||||
public abstract class AbstractAction<M extends BaseMessage> implements
|
public abstract class AbstractAction<M extends BaseMessage> implements
|
||||||
WeixinAction {
|
WeixinAction {
|
||||||
|
|
||||||
public abstract String execute(M inMessage);
|
public abstract BaseResponse execute(M inMessage);
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
@ -34,9 +35,9 @@ public abstract class AbstractAction<M extends BaseMessage> implements
|
|||||||
xstream.autodetectAnnotations(true);
|
xstream.autodetectAnnotations(true);
|
||||||
xstream.processAnnotations(messageClass);
|
xstream.processAnnotations(messageClass);
|
||||||
xstream.alias("xml", messageClass);
|
xstream.alias("xml", messageClass);
|
||||||
return execute(xstream.fromXML(msg, messageClass));
|
return execute(xstream.fromXML(msg, messageClass)).toXml();
|
||||||
}
|
}
|
||||||
return execute((M) message);
|
return execute((M) message).toXml();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
@ -0,0 +1,21 @@
|
|||||||
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
|
import com.foxinmy.weixin4j.mp.response.TextResponse;
|
||||||
|
import com.foxinmy.weixin4j.msg.BaseMessage;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 返回空白消息
|
||||||
|
*
|
||||||
|
* @className BlankAction
|
||||||
|
* @author jy.hu
|
||||||
|
* @date 2014年10月2日
|
||||||
|
* @since JDK 1.7
|
||||||
|
* @see
|
||||||
|
*/
|
||||||
|
public class BlankAction<M extends BaseMessage> extends AbstractAction<M> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TextResponse execute(M inMessage) {
|
||||||
|
return new TextResponse("", inMessage);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
|
import com.foxinmy.weixin4j.mp.response.TextResponse;
|
||||||
import com.foxinmy.weixin4j.msg.BaseMessage;
|
import com.foxinmy.weixin4j.msg.BaseMessage;
|
||||||
import com.foxinmy.weixin4j.msg.TextMessage;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示调试信息
|
* 显示调试信息
|
||||||
@ -16,8 +16,7 @@ public abstract class DebugAction<M extends BaseMessage> extends
|
|||||||
AbstractAction<M> {
|
AbstractAction<M> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String execute(M message) {
|
public TextResponse execute(M message) {
|
||||||
BaseMessage response = new TextMessage(message.toString(), message);
|
return new TextResponse(message.toString(), message);
|
||||||
return response.toXml();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.in.ImageMessage;
|
import com.foxinmy.weixin4j.msg.ImageMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年10月9日
|
* @date 2014年10月9日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.msg.in.ImageMessage
|
* @see com.foxinmy.weixin4j.msg.ImageMessage
|
||||||
*/
|
*/
|
||||||
@Action(msgType = MessageType.image)
|
@Action(msgType = MessageType.image)
|
||||||
public class ImageAction extends DebugAction<ImageMessage> {
|
public class ImageAction extends DebugAction<ImageMessage> {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.in.LinkMessage;
|
import com.foxinmy.weixin4j.msg.LinkMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年10月9日
|
* @date 2014年10月9日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.msg.in.LinkMessage
|
* @see com.foxinmy.weixin4j.msg.LinkMessage
|
||||||
*/
|
*/
|
||||||
@Action(msgType = MessageType.link)
|
@Action(msgType = MessageType.link)
|
||||||
public class LinkAction extends DebugAction<LinkMessage> {
|
public class LinkAction extends DebugAction<LinkMessage> {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.in.LocationMessage;
|
import com.foxinmy.weixin4j.msg.LocationMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年10月9日
|
* @date 2014年10月9日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.msg.in.LocationMessage
|
* @see com.foxinmy.weixin4j.msg.LocationMessage
|
||||||
*/
|
*/
|
||||||
@Action(msgType = MessageType.location)
|
@Action(msgType = MessageType.location)
|
||||||
public class LocationAction extends DebugAction<LocationMessage> {
|
public class LocationAction extends DebugAction<LocationMessage> {
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import io.netty.handler.codec.http.QueryStringDecoder;
|
import io.netty.handler.codec.http.QueryStringDecoder;
|
||||||
|
|
||||||
@ -1,5 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
|
import com.foxinmy.weixin4j.mp.response.TextResponse;
|
||||||
import com.foxinmy.weixin4j.msg.TextMessage;
|
import com.foxinmy.weixin4j.msg.TextMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
@ -16,7 +17,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
public class TextAction extends AbstractAction<TextMessage> {
|
public class TextAction extends AbstractAction<TextMessage> {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String execute(TextMessage inMessage) {
|
public TextResponse execute(TextMessage inMessage) {
|
||||||
return new TextMessage("Hello World!", inMessage).toXml();
|
return new TextResponse("Hello World!", inMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.in.VideoMessage;
|
import com.foxinmy.weixin4j.msg.VideoMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年10月9日
|
* @date 2014年10月9日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.msg.in.VideoMessage
|
* @see com.foxinmy.weixin4j.msg.VideoMessage
|
||||||
*/
|
*/
|
||||||
@Action(msgType = MessageType.video)
|
@Action(msgType = MessageType.video)
|
||||||
public class VideoAction extends DebugAction<VideoMessage> {
|
public class VideoAction extends DebugAction<VideoMessage> {
|
||||||
@ -1,6 +1,6 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.msg.in.VoiceMessage;
|
import com.foxinmy.weixin4j.msg.VoiceMessage;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -10,7 +10,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
|||||||
* @author jy
|
* @author jy
|
||||||
* @date 2014年10月9日
|
* @date 2014年10月9日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.msg.in.VoiceMessage
|
* @see com.foxinmy.weixin4j.msg.VoiceMessage
|
||||||
*/
|
*/
|
||||||
@Action(msgType = MessageType.voice)
|
@Action(msgType = MessageType.voice)
|
||||||
public class VoiceAction extends DebugAction<VoiceMessage> {
|
public class VoiceAction extends DebugAction<VoiceMessage> {
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.action;
|
package com.foxinmy.weixin4j.mp.action;
|
||||||
|
|
||||||
import org.dom4j.DocumentException;
|
import org.dom4j.DocumentException;
|
||||||
|
|
||||||
@ -9,9 +9,9 @@ import org.dom4j.DocumentException;
|
|||||||
* @author jy.hu
|
* @author jy.hu
|
||||||
* @date 2014年10月2日
|
* @date 2014年10月2日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.action.AbstractAction
|
* @see com.foxinmy.weixin4j.mp.action.AbstractAction
|
||||||
* @see com.foxinmy.weixin4j.action.BlankAction
|
* @see com.foxinmy.weixin4j.mp.action.BlankAction
|
||||||
* @see com.foxinmy.weixin4j.action.DebugAction
|
* @see com.foxinmy.weixin4j.mp.action.DebugAction
|
||||||
*/
|
*/
|
||||||
public interface WeixinAction {
|
public interface WeixinAction {
|
||||||
public String execute(String msg) throws DocumentException;
|
public String execute(String msg) throws DocumentException;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.LocationEventMessage;
|
import com.foxinmy.weixin4j.msg.event.LocationEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.MassEventMessage;
|
import com.foxinmy.weixin4j.msg.event.MassEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.menu.MenuEventMessage;
|
import com.foxinmy.weixin4j.msg.event.menu.MenuEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.menu.MenuLocationEventMessage;
|
import com.foxinmy.weixin4j.msg.event.menu.MenuLocationEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.menu.MenuPhotoEventMessage;
|
import com.foxinmy.weixin4j.msg.event.menu.MenuPhotoEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.menu.MenuScanEventMessage;
|
import com.foxinmy.weixin4j.msg.event.menu.MenuScanEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.menu.MenuEventMessage;
|
import com.foxinmy.weixin4j.msg.event.menu.MenuEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.ScanEventMessage;
|
import com.foxinmy.weixin4j.msg.event.ScanEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.ScribeEventMessage;
|
import com.foxinmy.weixin4j.msg.event.ScribeEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage;
|
import com.foxinmy.weixin4j.msg.event.TemplatesendjobfinishMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
package com.foxinmy.weixin4j.action.event;
|
package com.foxinmy.weixin4j.mp.action.event;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.action.Action;
|
import com.foxinmy.weixin4j.mp.action.Action;
|
||||||
import com.foxinmy.weixin4j.action.DebugAction;
|
import com.foxinmy.weixin4j.mp.action.DebugAction;
|
||||||
import com.foxinmy.weixin4j.msg.event.ScribeEventMessage;
|
import com.foxinmy.weixin4j.msg.event.ScribeEventMessage;
|
||||||
import com.foxinmy.weixin4j.type.EventType;
|
import com.foxinmy.weixin4j.type.EventType;
|
||||||
import com.foxinmy.weixin4j.type.MessageType;
|
import com.foxinmy.weixin4j.type.MessageType;
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.http.HttpRequest;
|
import com.foxinmy.weixin4j.http.HttpRequest;
|
||||||
|
|
||||||
@ -1,14 +1,14 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.BaseResult;
|
import com.foxinmy.weixin4j.http.BaseResult;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.Group;
|
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.Group;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -20,7 +20,7 @@ import com.foxinmy.weixin4j.util.ConfigUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see <a href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%
|
* @see <a href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%
|
||||||
* BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3">分组接口</a>
|
* BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3">分组接口</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
*/
|
*/
|
||||||
public class GroupApi extends BaseApi {
|
public class GroupApi extends BaseApi {
|
||||||
|
|
||||||
@ -38,8 +38,8 @@ public class GroupApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E5.88.9B.E5.BB.BA.E5.88.86.E7.BB.84">创建分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E5.88.9B.E5.BB.BA.E5.88.86.E7.BB.84">创建分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.model.Group#toCreateJson()
|
* @see com.foxinmy.weixin4j.mp.model.Group#toCreateJson()
|
||||||
*/
|
*/
|
||||||
public Group createGroup(String name) throws WeixinException {
|
public Group createGroup(String name) throws WeixinException {
|
||||||
String group_create_uri = ConfigUtil.getValue("group_create_uri");
|
String group_create_uri = ConfigUtil.getValue("group_create_uri");
|
||||||
@ -59,7 +59,7 @@ public class GroupApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E6.89.80.E6.9C.89.E5.88.86.E7.BB.84">查询所有分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E6.89.80.E6.9C.89.E5.88.86.E7.BB.84">查询所有分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
*/
|
*/
|
||||||
public List<Group> getGroups() throws WeixinException {
|
public List<Group> getGroups() throws WeixinException {
|
||||||
String group_get_uri = ConfigUtil.getValue("group_get_uri");
|
String group_get_uri = ConfigUtil.getValue("group_get_uri");
|
||||||
@ -80,7 +80,7 @@ public class GroupApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E7.94.A8.E6.88.B7.E6.89.80.E5.9C.A8.E5.88.86.E7.BB.84">查询用户所在分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E6.9F.A5.E8.AF.A2.E7.94.A8.E6.88.B7.E6.89.80.E5.9C.A8.E5.88.86.E7.BB.84">查询用户所在分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
*/
|
*/
|
||||||
public int getGroupByOpenId(String openId) throws WeixinException {
|
public int getGroupByOpenId(String openId) throws WeixinException {
|
||||||
String group_getid_uri = ConfigUtil.getValue("group_getid_uri");
|
String group_getid_uri = ConfigUtil.getValue("group_getid_uri");
|
||||||
@ -102,8 +102,8 @@ public class GroupApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E4.BF.AE.E6.94.B9.E5.88.86.E7.BB.84.E5.90.8D">修改分组名</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E4.BF.AE.E6.94.B9.E5.88.86.E7.BB.84.E5.90.8D">修改分组名</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.model.Group#toModifyJson()
|
* @see com.foxinmy.weixin4j.mp.model.Group#toModifyJson()
|
||||||
*/
|
*/
|
||||||
public BaseResult modifyGroup(int groupId, String name)
|
public BaseResult modifyGroup(int groupId, String name)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -127,7 +127,7 @@ public class GroupApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E7.A7.BB.E5.8A.A8.E7.94.A8.E6.88.B7.E5.88.86.E7.BB.84">移动分组</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%88%86%E7%BB%84%E7%AE%A1%E7%90%86%E6%8E%A5%E5%8F%A3#.E7.A7.BB.E5.8A.A8.E7.94.A8.E6.88.B7.E5.88.86.E7.BB.84">移动分组</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
*/
|
*/
|
||||||
public BaseResult moveGroup(String openId, int groupId)
|
public BaseResult moveGroup(String openId, int groupId)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -1,10 +1,10 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1,15 +1,15 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.BaseResult;
|
import com.foxinmy.weixin4j.http.BaseResult;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.MpArticle;
|
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.MpArticle;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.type.MediaType;
|
import com.foxinmy.weixin4j.type.MediaType;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ import com.foxinmy.weixin4j.util.ConfigUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">群发接口</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">群发接口</a>
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
*/
|
*/
|
||||||
public class MassApi extends BaseApi {
|
public class MassApi extends BaseApi {
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class MassApi extends BaseApi {
|
|||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E7.B4.A0.E6.9D.90">上传图文消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E4.B8.8A.E4.BC.A0.E5.9B.BE.E6.96.87.E6.B6.88.E6.81.AF.E7.B4.A0.E6.9D.90">上传图文消息</a>
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
*/
|
*/
|
||||||
public String uploadArticle(List<MpArticle> articles)
|
public String uploadArticle(List<MpArticle> articles)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -71,7 +71,7 @@ public class MassApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3">高级群发</a>
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
*/
|
*/
|
||||||
public String uploadVideo(String mediaId, String title, String desc)
|
public String uploadVideo(String mediaId, String title, String desc)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -103,9 +103,9 @@ public class MassApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E6.A0.B9.E6.8D.AE.E5.88.86.E7.BB.84.E8.BF.9B.E8.A1.8C.E7.BE.A4.E5.8F.91">分组群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E6.A0.B9.E6.8D.AE.E5.88.86.E7.BB.84.E8.BF.9B.E8.A1.8C.E7.BE.A4.E5.8F.91">分组群发</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroupByOpenId(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroupByOpenId(String)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroups()}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroups()}
|
||||||
*/
|
*/
|
||||||
private String massByGroup(JSONObject jsonPara, String groupId)
|
private String massByGroup(JSONObject jsonPara, String groupId)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -129,7 +129,7 @@ public class MassApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E6.A0.B9.E6.8D.AEOpenID.E5.88.97.E8.A1.A8.E7.BE.A4.E5.8F.91">openId群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E6.A0.B9.E6.8D.AEOpenID.E5.88.97.E8.A1.A8.E7.BE.A4.E5.8F.91">openId群发</a>
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
*/
|
*/
|
||||||
private String massByOpenIds(JSONObject jsonPara, String... openIds)
|
private String massByOpenIds(JSONObject jsonPara, String... openIds)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -153,12 +153,12 @@ public class MassApi extends BaseApi {
|
|||||||
* 分组ID
|
* 分组ID
|
||||||
* @return
|
* @return
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroupByOpenId(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroupByOpenId(String)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.GroupApi#getGroups()}
|
* @see {@link com.foxinmy.weixin4j.mp.api.GroupApi#getGroups()}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByGroup(JSONObject,String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByGroup(JSONObject,String)}
|
||||||
*/
|
*/
|
||||||
public String massByGroup(String mediaId, MediaType mediaType,
|
public String massByGroup(String mediaId, MediaType mediaType,
|
||||||
String groupId) throws WeixinException {
|
String groupId) throws WeixinException {
|
||||||
@ -180,11 +180,11 @@ public class MassApi extends BaseApi {
|
|||||||
* 分组ID
|
* 分组ID
|
||||||
* @return 发送出去的消息ID
|
* @return 发送出去的消息ID
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
* @see com.foxinmy.weixin4j.model.Group
|
* @see com.foxinmy.weixin4j.mp.model.Group
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#uploadNews(List)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#uploadNews(List)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByGroup(String,MediaType,String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByGroup(String,MediaType,String)}
|
||||||
*/
|
*/
|
||||||
public String massArticleByGroup(List<MpArticle> articles, String groupId)
|
public String massArticleByGroup(List<MpArticle> articles, String groupId)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -204,10 +204,10 @@ public class MassApi extends BaseApi {
|
|||||||
* openId列表
|
* openId列表
|
||||||
* @return
|
* @return
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see com.foxinmy.weixin4j.type.MediaType
|
* @see com.foxinmy.weixin4j.type.MediaType
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByOpenIds(JSONObject,String...)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByOpenIds(JSONObject,String...)}
|
||||||
*/
|
*/
|
||||||
public String massByOpenIds(String mediaId, MediaType mediaType,
|
public String massByOpenIds(String mediaId, MediaType mediaType,
|
||||||
String... openIds) throws WeixinException {
|
String... openIds) throws WeixinException {
|
||||||
@ -229,11 +229,11 @@ public class MassApi extends BaseApi {
|
|||||||
* 目标ID列表
|
* 目标ID列表
|
||||||
* @return 发送出去的消息ID
|
* @return 发送出去的消息ID
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.MpArticle
|
* @see com.foxinmy.weixin4j.mp.model.MpArticle
|
||||||
* @see com.foxinmy.weixin4j.model.User
|
* @see com.foxinmy.weixin4j.mp.model.User
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadNews(List)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadNews(List)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByOpenIds(String,MediaType,String...)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByOpenIds(String,MediaType,String...)}
|
||||||
*/
|
*/
|
||||||
public String massArticleByOpenIds(List<MpArticle> articles,
|
public String massArticleByOpenIds(List<MpArticle> articles,
|
||||||
String... openIds) throws WeixinException {
|
String... openIds) throws WeixinException {
|
||||||
@ -253,8 +253,8 @@ public class MassApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E5.88.A0.E9.99.A4.E7.BE.A4.E5.8F.91">删除群发</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E9%AB%98%E7%BA%A7%E7%BE%A4%E5%8F%91%E6%8E%A5%E5%8F%A3#.E5.88.A0.E9.99.A4.E7.BE.A4.E5.8F.91">删除群发</a>
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByGroup(JSONObject, String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByGroup(JSONObject, String)}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MassApi#massByOpenIds(JSONObject, String...)
|
* @see {@link com.foxinmy.weixin4j.mp.api.MassApi#massByOpenIds(JSONObject, String...)
|
||||||
*/
|
*/
|
||||||
public BaseResult deleteMassNews(String msgid) throws WeixinException {
|
public BaseResult deleteMassNews(String msgid) throws WeixinException {
|
||||||
JSONObject obj = new JSONObject();
|
JSONObject obj = new JSONObject();
|
||||||
@ -1,4 +1,4 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
@ -7,11 +7,11 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import org.apache.http.entity.mime.content.ByteArrayBody;
|
import org.apache.http.entity.mime.content.ByteArrayBody;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.PartParameter;
|
import com.foxinmy.weixin4j.http.PartParameter;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.type.MediaType;
|
import com.foxinmy.weixin4j.type.MediaType;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
import com.foxinmy.weixin4j.util.IOUtil;
|
import com.foxinmy.weixin4j.util.IOUtil;
|
||||||
@ -69,7 +69,7 @@ public class MediaApi extends BaseApi {
|
|||||||
* 媒体类型
|
* 媒体类型
|
||||||
* @return 上传到微信服务器返回的媒体标识
|
* @return 上传到微信服务器返回的媒体标识
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see {@link com.foxinmy.weixin4j.api.MediaApi#uploadMedia(File, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.MediaApi#uploadMedia(File, MediaType)}
|
||||||
*/
|
*/
|
||||||
public String uploadMedia(String fileName, byte[] bytes, MediaType mediaType)
|
public String uploadMedia(String fileName, byte[] bytes, MediaType mediaType)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -128,7 +128,7 @@ public class MediaApi extends BaseApi {
|
|||||||
* @param mediaType
|
* @param mediaType
|
||||||
* @return 二进制数据包
|
* @return 二进制数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see {@link com.foxinmy.weixin4j.WeixinProxy#downloadMedia(String, MediaType)}
|
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#downloadMedia(String, MediaType)}
|
||||||
*/
|
*/
|
||||||
public byte[] downloadMediaData(String mediaId, MediaType mediaType)
|
public byte[] downloadMediaData(String mediaId, MediaType mediaType)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -1,15 +1,15 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.BaseResult;
|
import com.foxinmy.weixin4j.http.BaseResult;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.Button;
|
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.Button;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,7 +19,7 @@ import com.foxinmy.weixin4j.util.ConfigUtil;
|
|||||||
* @author jy.hu
|
* @author jy.hu
|
||||||
* @date 2014年9月25日
|
* @date 2014年9月25日
|
||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
*/
|
*/
|
||||||
public class MenuApi extends BaseApi {
|
public class MenuApi extends BaseApi {
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ public class MenuApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%9B%E5%BB%BA%E6%8E%A5%E5%8F%A3">创建自定义菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%9B%E5%BB%BA%E6%8E%A5%E5%8F%A3">创建自定义菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
*/
|
*/
|
||||||
public BaseResult createMenu(List<Button> btnList) throws WeixinException {
|
public BaseResult createMenu(List<Button> btnList) throws WeixinException {
|
||||||
String menu_create_uri = ConfigUtil.getValue("menu_create_uri");
|
String menu_create_uri = ConfigUtil.getValue("menu_create_uri");
|
||||||
@ -57,7 +57,7 @@ public class MenuApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3">查询菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E6%9F%A5%E8%AF%A2%E6%8E%A5%E5%8F%A3">查询菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
*/
|
*/
|
||||||
public List<Button> getMenu() throws WeixinException {
|
public List<Button> getMenu() throws WeixinException {
|
||||||
String menu_get_uri = ConfigUtil.getValue("menu_get_uri");
|
String menu_get_uri = ConfigUtil.getValue("menu_get_uri");
|
||||||
@ -76,7 +76,7 @@ public class MenuApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3">删除菜单</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%87%AA%E5%AE%9A%E4%B9%89%E8%8F%9C%E5%8D%95%E5%88%A0%E9%99%A4%E6%8E%A5%E5%8F%A3">删除菜单</a>
|
||||||
* @see com.foxinmy.weixin4j.model.Button
|
* @see com.foxinmy.weixin4j.mp.model.Button
|
||||||
*/
|
*/
|
||||||
public BaseResult deleteMenu() throws WeixinException {
|
public BaseResult deleteMenu() throws WeixinException {
|
||||||
String menu_delete_uri = ConfigUtil.getValue("menu_delete_uri");
|
String menu_delete_uri = ConfigUtil.getValue("menu_delete_uri");
|
||||||
@ -1,19 +1,19 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSON;
|
import com.alibaba.fastjson.JSON;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.BaseResult;
|
import com.foxinmy.weixin4j.http.BaseResult;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.CustomRecord;
|
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
import com.foxinmy.weixin4j.msg.model.Article;
|
import com.foxinmy.weixin4j.mp.model.CustomRecord;
|
||||||
import com.foxinmy.weixin4j.msg.model.BaseMsg;
|
import com.foxinmy.weixin4j.mp.msg.model.Article;
|
||||||
import com.foxinmy.weixin4j.msg.notify.ArticleNotify;
|
import com.foxinmy.weixin4j.mp.msg.model.BaseMsg;
|
||||||
import com.foxinmy.weixin4j.msg.notify.BaseNotify;
|
import com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify;
|
||||||
|
import com.foxinmy.weixin4j.mp.msg.notify.BaseNotify;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -25,12 +25,12 @@ import com.foxinmy.weixin4j.util.ConfigUtil;
|
|||||||
* @since JDK 1.7
|
* @since JDK 1.7
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">客服消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">客服消息</a>
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.TextNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.TextNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ImageNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ImageNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.MusicNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.MusicNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VideoNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VideoNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VoiceNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VoiceNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ArticleNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify
|
||||||
*/
|
*/
|
||||||
public class NotifyApi extends BaseApi {
|
public class NotifyApi extends BaseApi {
|
||||||
|
|
||||||
@ -67,13 +67,13 @@ public class NotifyApi extends BaseApi {
|
|||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">发送客服消息</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E5%8F%91%E9%80%81%E5%AE%A2%E6%9C%8D%E6%B6%88%E6%81%AF">发送客服消息</a>
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.TextNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.TextNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ImageNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ImageNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.MusicNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.MusicNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VideoNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VideoNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.VoiceNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.VoiceNotify
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ArticleNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify
|
||||||
* @see {@link com.foxinmy.weixin4j.api.NotifyApi#sendNotify(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.NotifyApi#sendNotify(String)}
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(BaseNotify notify) throws WeixinException {
|
public BaseResult sendNotify(BaseNotify notify) throws WeixinException {
|
||||||
return sendNotify(notify.toJson());
|
return sendNotify(notify.toJson());
|
||||||
@ -88,8 +88,8 @@ public class NotifyApi extends BaseApi {
|
|||||||
* 图文列表
|
* 图文列表
|
||||||
* @return 发送结果
|
* @return 发送结果
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Article
|
* @see com.foxinmy.weixin4j.mp.msg.model.Article
|
||||||
* @see com.foxinmy.weixin4j.msg.notify.ArticleNotify
|
* @see com.foxinmy.weixin4j.mp.msg.notify.ArticleNotify
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(String touser, List<Article> articles)
|
public BaseResult sendNotify(String touser, List<Article> articles)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -107,13 +107,13 @@ public class NotifyApi extends BaseApi {
|
|||||||
* 消息类型
|
* 消息类型
|
||||||
* @return 发送结果
|
* @return 发送结果
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Text
|
* @see com.foxinmy.weixin4j.mp.msg.model.Text
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Image
|
* @see com.foxinmy.weixin4j.mp.msg.model.Image
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Music
|
* @see com.foxinmy.weixin4j.mp.msg.model.Music
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Video
|
* @see com.foxinmy.weixin4j.mp.msg.model.Video
|
||||||
* @see com.foxinmy.weixin4j.msg.model.Voice
|
* @see com.foxinmy.weixin4j.mp.msg.model.Voice
|
||||||
* @see {@link com.foxinmy.weixin4j.msg.model.BaseMsg#toNotifyJson()}
|
* @see {@link com.foxinmy.weixin4j.mp.msg.model.BaseMsg#toNotifyJson()}
|
||||||
* @see {@link com.foxinmy.weixin4j.api.NotifyApi#sendNotify(String)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.NotifyApi#sendNotify(String)}
|
||||||
*/
|
*/
|
||||||
public BaseResult sendNotify(String touser, BaseMsg baseMsg)
|
public BaseResult sendNotify(String touser, BaseMsg baseMsg)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -142,7 +142,7 @@ public class NotifyApi extends BaseApi {
|
|||||||
* @param pageindex
|
* @param pageindex
|
||||||
* 查询第几页 从1开始
|
* 查询第几页 从1开始
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see com.foxinmy.weixin4j.model.CustomRecord
|
* @see com.foxinmy.weixin4j.mp.model.CustomRecord
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%9C%8D%E8%81%8A%E5%A4%A9%E8%AE%B0%E5%BD%95">查询客服聊天记录</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E8%8E%B7%E5%8F%96%E5%AE%A2%E6%9C%8D%E8%81%8A%E5%A4%A9%E8%AE%B0%E5%BD%95">查询客服聊天记录</a>
|
||||||
*/
|
*/
|
||||||
@ -1,16 +1,16 @@
|
|||||||
package com.foxinmy.weixin4j.api;
|
package com.foxinmy.weixin4j.mp.api;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import com.foxinmy.weixin4j.api.token.TokenApi;
|
|
||||||
import com.foxinmy.weixin4j.exception.WeixinException;
|
import com.foxinmy.weixin4j.exception.WeixinException;
|
||||||
import com.foxinmy.weixin4j.http.Response;
|
import com.foxinmy.weixin4j.http.Response;
|
||||||
import com.foxinmy.weixin4j.model.QRParameter;
|
|
||||||
import com.foxinmy.weixin4j.model.QRParameter.QRType;
|
|
||||||
import com.foxinmy.weixin4j.model.Token;
|
import com.foxinmy.weixin4j.model.Token;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.QRParameter;
|
||||||
|
import com.foxinmy.weixin4j.mp.model.QRParameter.QRType;
|
||||||
|
import com.foxinmy.weixin4j.token.TokenApi;
|
||||||
import com.foxinmy.weixin4j.util.ConfigUtil;
|
import com.foxinmy.weixin4j.util.ConfigUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -37,7 +37,7 @@ public class QrApi extends BaseApi {
|
|||||||
* @param parameter
|
* @param parameter
|
||||||
* @return byte数据包
|
* @return byte数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see {@link com.foxinmy.weixin4j.api.QrApi#getQR(QRParameter)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.QrApi#getQR(QRParameter)}
|
||||||
*/
|
*/
|
||||||
public byte[] getQRData(QRParameter parameter) throws WeixinException {
|
public byte[] getQRData(QRParameter parameter) throws WeixinException {
|
||||||
Token token = tokenApi.getToken();
|
Token token = tokenApi.getToken();
|
||||||
@ -61,7 +61,7 @@ public class QrApi extends BaseApi {
|
|||||||
* 过期秒数 如果小于等于0则 视为永久二维码
|
* 过期秒数 如果小于等于0则 视为永久二维码
|
||||||
* @return byte数据包
|
* @return byte数据包
|
||||||
* @throws WeixinException
|
* @throws WeixinException
|
||||||
* @see {@link com.foxinmy.weixin4j.api.QrApi#getQR(QRParameter)}
|
* @see {@link com.foxinmy.weixin4j.mp.api.QrApi#getQR(QRParameter)}
|
||||||
*/
|
*/
|
||||||
public byte[] getQRData(int sceneId, int expireSeconds)
|
public byte[] getQRData(int sceneId, int expireSeconds)
|
||||||
throws WeixinException {
|
throws WeixinException {
|
||||||
@ -86,7 +86,7 @@ public class QrApi extends BaseApi {
|
|||||||
* @throws FileNotFoundException
|
* @throws FileNotFoundException
|
||||||
* @see <a
|
* @see <a
|
||||||
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%94%9F%E6%88%90%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81">二维码</a>
|
* href="http://mp.weixin.qq.com/wiki/index.php?title=%E7%94%9F%E6%88%90%E5%B8%A6%E5%8F%82%E6%95%B0%E7%9A%84%E4%BA%8C%E7%BB%B4%E7%A0%81">二维码</a>
|
||||||
* @see com.foxinmy.weixin4j.model.QRParameter
|
* @see com.foxinmy.weixin4j.mp.model.QRParameter
|
||||||
*/
|
*/
|
||||||
public File getQR(QRParameter parameter) throws WeixinException,
|
public File getQR(QRParameter parameter) throws WeixinException,
|
||||||
IOException {
|
IOException {
|
||||||
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