release 1.2
This commit is contained in:
parent
681d8afd1d
commit
d8d294fea9
@ -166,6 +166,10 @@
|
||||
|
||||
+ **weixin4j-mp**:调整部分实体类(*paypackage)中没有按照骆驼命名规则的属性名
|
||||
|
||||
* 2015-01-31
|
||||
* 2015-01-31
|
||||
|
||||
+ **weixin4j-mp**: 新增数据分析接口
|
||||
+ **weixin4j-mp**: 新增数据分析接口
|
||||
|
||||
* 2015-02-05
|
||||
|
||||
+ release 1.2
|
||||
@ -30,20 +30,20 @@ weixin4j
|
||||
|
||||
如何获取API
|
||||
----------
|
||||
###1.maven依赖(1.1,2014-12-18 released)
|
||||
###1.maven依赖(1.2,2015-02-05 released)
|
||||
微信公众平台API
|
||||
|
||||
<dependency>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-mp-api</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
微信企业号API
|
||||
|
||||
<dependency>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-qy-api</artifactId>
|
||||
<version>1.1</version>
|
||||
<version>1.2</version>
|
||||
</dependency>
|
||||
以上依赖如果出现Missing artifact错误 请尝试在eclipse里这么做
|
||||
|
||||
|
||||
9
pom.xml
9
pom.xml
@ -4,7 +4,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>weixin4j</name>
|
||||
<url>https://github.com/foxinmy/weixin4j</url>
|
||||
@ -90,6 +90,13 @@
|
||||
<version>${maven.resources.plugin.version}</version>
|
||||
<configuration>
|
||||
<encoding>${project.build.sourceEncoding}</encoding>
|
||||
<!-- 过滤证书文件 -->
|
||||
<nonFilteredFileExtensions>
|
||||
<nonFilteredFileExtension>pem</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>pfx</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>p12</nonFilteredFileExtension>
|
||||
<nonFilteredFileExtension>jks</nonFilteredFileExtension>
|
||||
</nonFilteredFileExtensions>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-base</artifactId>
|
||||
<name>weixin4j-base</name>
|
||||
|
||||
@ -40,7 +40,7 @@ import com.foxinmy.weixin4j.util.MapUtil;
|
||||
import com.thoughtworks.xstream.mapper.CannotResolveClassException;
|
||||
|
||||
/**
|
||||
* 调用微信相关接口的HttpRequest,对于其他请求可能并不试用
|
||||
* 调用微信相关接口的HttpRequest,对于其他请求可能并不适用
|
||||
*
|
||||
* @className HttpRequest
|
||||
* @author jy
|
||||
|
||||
@ -113,7 +113,7 @@ public class HttpWeixinMessage implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "HttpMessage [toUserName=" + toUserName + ", encryptContent="
|
||||
return "HttpWeixinMessage [toUserName=" + toUserName + ", encryptContent="
|
||||
+ encryptContent + ", encryptType=" + encryptType
|
||||
+ ", echoStr=" + echoStr + ", timeStamp=" + timeStamp
|
||||
+ ", nonce=" + nonce + ", signature=" + signature + ", token="
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<name>weixin4j-mp</name>
|
||||
|
||||
@ -30,6 +30,7 @@ weixin4j-mp-api
|
||||
* Pay2Api `V2支付API`
|
||||
|
||||
* Pay3Api `V3支付API`
|
||||
|
||||
* DataApi `数据统计API`
|
||||
|
||||
如何使用
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-mp-api</artifactId>
|
||||
<name>weixin4j-mp-api</name>
|
||||
|
||||
@ -261,7 +261,7 @@ public class WeixinPayProxy {
|
||||
* @param caFile
|
||||
* 证书文件(后缀为*.p12)
|
||||
* @param idQuery
|
||||
* ) 商户系统内部的订单号, transaction_id 、 out_trade_no 二选一,如果同时存在优先级:
|
||||
* 商户系统内部的订单号, transaction_id 、 out_trade_no 二选一,如果同时存在优先级:
|
||||
* transaction_id> out_trade_no
|
||||
* @param outRefundNo
|
||||
* 商户系统内部的退款单号,商 户系统内部唯一,同一退款单号多次请求只退一笔
|
||||
|
||||
@ -9,6 +9,7 @@ import com.foxinmy.weixin4j.exception.WeixinException;
|
||||
import com.foxinmy.weixin4j.http.JsonResult;
|
||||
import com.foxinmy.weixin4j.model.Button;
|
||||
import com.foxinmy.weixin4j.mp.api.CustomApi;
|
||||
import com.foxinmy.weixin4j.mp.api.DataApi;
|
||||
import com.foxinmy.weixin4j.mp.api.GroupApi;
|
||||
import com.foxinmy.weixin4j.mp.api.HelperApi;
|
||||
import com.foxinmy.weixin4j.mp.api.MassApi;
|
||||
@ -29,6 +30,7 @@ import com.foxinmy.weixin4j.mp.model.QRParameter;
|
||||
import com.foxinmy.weixin4j.mp.model.SemQuery;
|
||||
import com.foxinmy.weixin4j.mp.model.SemResult;
|
||||
import com.foxinmy.weixin4j.mp.model.User;
|
||||
import com.foxinmy.weixin4j.mp.type.DatacubeType;
|
||||
import com.foxinmy.weixin4j.mp.type.IndustryType;
|
||||
import com.foxinmy.weixin4j.mp.type.Lang;
|
||||
import com.foxinmy.weixin4j.msg.model.Base;
|
||||
@ -61,6 +63,7 @@ public class WeixinProxy {
|
||||
private final QrApi qrApi;
|
||||
private final TmplApi tmplApi;
|
||||
private final HelperApi helperApi;
|
||||
private final DataApi dataApi;
|
||||
|
||||
/**
|
||||
* 默认采用文件存放Token信息
|
||||
@ -95,6 +98,7 @@ public class WeixinProxy {
|
||||
this.qrApi = new QrApi(tokenHolder);
|
||||
this.tmplApi = new TmplApi(tokenHolder);
|
||||
this.helperApi = new HelperApi(tokenHolder);
|
||||
this.dataApi = new DataApi(tokenHolder);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -921,4 +925,90 @@ public class WeixinProxy {
|
||||
public List<String> getcallbackip() throws WeixinException {
|
||||
return helperApi.getcallbackip();
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据统计
|
||||
*
|
||||
* @param datacubeType
|
||||
* 数据统计类型
|
||||
* @param beginDate
|
||||
* 获取数据的起始日期,begin_date和end_date的差值需小于“最大时间跨度”(比如最大时间跨度为1时,
|
||||
* begin_date和end_date的差值只能为0,才能小于1),否则会报错
|
||||
* @param endDate
|
||||
* 获取数据的结束日期,end_date允许设置的最大值为昨日
|
||||
* @see com.foxinmy.weixin4j.mp.api.DataApi
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.UserSummary
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.ArticleSummary
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.ArticleTotal
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.ArticleDatacubeShare
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.UpstreamMsg
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.UpstreamMsgDist
|
||||
* @see com.foxinmy.weixin4j.mp.datacube.InterfaceSummary
|
||||
* @return 统计结果
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/3/ecfed6e1a0a03b5f35e5efac98e864b7.html">用户分析</a>
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/8/c0453610fb5131d1fcb17b4e87c82050.html">图文分析</a>
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/12/32d42ad542f2e4fc8a8aa60e1bce9838.html">消息分析</a>
|
||||
* @see <a
|
||||
* href="http://mp.weixin.qq.com/wiki/8/30ed81ae38cf4f977194bf1a5db73668.html">接口分析</a>
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, Date beginDate,
|
||||
Date endDate) throws WeixinException {
|
||||
return dataApi.datacube(datacubeType, beginDate, endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据统计
|
||||
*
|
||||
* @param datacubeType
|
||||
* 统计类型
|
||||
* @param beginDate
|
||||
* 开始日期
|
||||
* @param offset
|
||||
* 增量 表示向前几天 比如 offset=1 则查询 beginDate的后一天之间的数据
|
||||
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#datacube(DatacubeType, Date,Date)}
|
||||
* @see com.foxinmy.weixin4j.mp.api.DataApi
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, Date beginDate,
|
||||
int offset) throws WeixinException {
|
||||
return dataApi.datacube(datacubeType, beginDate, offset);
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据统计
|
||||
*
|
||||
* @param datacubeType
|
||||
* 统计类型
|
||||
* @param offset
|
||||
* 增量 表示向后几天 比如 offset=1 则查询 beginDate的前一天之间的数据
|
||||
* @param endDate
|
||||
* 截至日期
|
||||
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#datacube(DatacubeType, Date,Date)}
|
||||
* @see com.foxinmy.weixin4j.mp.api.DataApi
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, int offset, Date endDate)
|
||||
throws WeixinException {
|
||||
return dataApi.datacube(datacubeType, offset, endDate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日期跨度为0的统计数据(当天)
|
||||
*
|
||||
* @param datacubeType
|
||||
* 统计类型
|
||||
* @param date
|
||||
* 统计日期
|
||||
* @see {@link com.foxinmy.weixin4j.mp.WeixinProxy#datacube(DatacubeType, Date,Date)}
|
||||
* @see com.foxinmy.weixin4j.mp.api.DataApi
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, Date date)
|
||||
throws WeixinException {
|
||||
return dataApi.datacube(datacubeType, date);
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,8 +16,8 @@ import com.foxinmy.weixin4j.util.DateUtil;
|
||||
/**
|
||||
* 数据分析API
|
||||
* <p>
|
||||
* 1、接口侧的公众号数据的数据库中仅存储了2014年12月1日之后的数据,将查询不到在此之前的日期,即使有查到,也是不可信的脏数据;
|
||||
* 2、请开发者在调用接口获取数据后,将数据保存在自身数据库中,即加快下次用户的访问速度,也降低了微信侧接口调用的不必要损耗。
|
||||
* 1、接口侧的公众号数据的数据库中仅存储了2014年12月1日之后的数据,将查询不到在此之前的日期,即使有查到,也是不可信的脏数据;<br/>
|
||||
* 2、请开发者在调用接口获取数据后,将数据保存在自身数据库中,即加快下次用户的访问速度,也降低了微信侧接口调用的不必要损耗。<br/>
|
||||
* </p>
|
||||
*
|
||||
* @className DataApi
|
||||
@ -42,7 +42,7 @@ public class DataApi extends MpApi {
|
||||
* 开始日期
|
||||
* @param offset
|
||||
* 增量 表示向前几天 比如 offset=1 则查询 beginDate的后一天之间的数据
|
||||
* @return
|
||||
* @see {@link com.foxinmy.weixin4j.mp.api.DataApi#datacube(DatacubeType, Date,Date)}
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, Date beginDate,
|
||||
@ -62,7 +62,7 @@ public class DataApi extends MpApi {
|
||||
* 增量 表示向后几天 比如 offset=1 则查询 beginDate的前一天之间的数据
|
||||
* @param endDate
|
||||
* 截至日期
|
||||
* @return
|
||||
* @see {@link com.foxinmy.weixin4j.mp.api.DataApi#datacube(DatacubeType, Date,Date)}
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, int offset, Date endDate)
|
||||
@ -74,13 +74,13 @@ public class DataApi extends MpApi {
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询日期跨度为1的统计数据
|
||||
* 查询日期跨度为0的统计数据(当天)
|
||||
*
|
||||
* @param datacubeType
|
||||
* 统计类型
|
||||
* @param date
|
||||
* 统计日期
|
||||
* @return 统计结果
|
||||
* @see {@link com.foxinmy.weixin4j.mp.api.DataApi#datacube(DatacubeType, Date,Date)}
|
||||
* @throws WeixinException
|
||||
*/
|
||||
public List<?> datacube(DatacubeType datacubeType, Date date)
|
||||
|
||||
@ -31,16 +31,16 @@ public class PayTest {
|
||||
private final static WeixinMpAccount ACCOUNT3;
|
||||
static {
|
||||
ACCOUNT2 = new WeixinMpAccount(
|
||||
"appId",
|
||||
"appSecret",
|
||||
"paySignKey",
|
||||
"appid",
|
||||
"appsecret",
|
||||
"paysignkey",
|
||||
"partnerId", "partnerKey");
|
||||
PAY2 = new WeixinPayProxy(ACCOUNT2, new FileTokenHolder(
|
||||
new WeixinTokenCreator(ACCOUNT2.getId(), ACCOUNT2.getSecret(),
|
||||
AccountType.MP)));
|
||||
ACCOUNT3 = new WeixinMpAccount("appId",
|
||||
"appSecret",
|
||||
"paySignKey", "mchId");
|
||||
ACCOUNT3 = new WeixinMpAccount("appid",
|
||||
"appsecret",
|
||||
"paysignkey", "mchId");
|
||||
PAY3 = new WeixinPayProxy(ACCOUNT3, new FileTokenHolder(
|
||||
new WeixinTokenCreator(ACCOUNT3.getId(), ACCOUNT3.getSecret(),
|
||||
AccountType.MP)));
|
||||
@ -54,10 +54,10 @@ public class PayTest {
|
||||
@Test
|
||||
public void refundV2() throws WeixinException {
|
||||
File caFile = new File(
|
||||
"/Users/jy/download/1221928801.pfx");
|
||||
IdQuery idQuery = new IdQuery("D15012400026", IdType.TRADENO);
|
||||
System.err.println(PAY2.refundV2(caFile, idQuery, "R000000001", 2d, 2d,
|
||||
"1221928801", "111111", null, null, null));
|
||||
"/path/xxx.pfx");
|
||||
IdQuery idQuery = new IdQuery("D15020300005", IdType.TRADENO);
|
||||
System.err.println(PAY2.refundV2(caFile, idQuery, "1422925555037", 16d, 16d,
|
||||
"partnerId", "password", null, null, null));
|
||||
}
|
||||
|
||||
@Test
|
||||
@ -110,7 +110,7 @@ public class PayTest {
|
||||
@Test
|
||||
public void refundV3() throws WeixinException {
|
||||
File caFile = new File(
|
||||
"/Users/jy/download/10020674.p12");
|
||||
"/path/xxx.p12");
|
||||
IdQuery idQuery = new IdQuery("T00015", IdType.TRADENO);
|
||||
com.foxinmy.weixin4j.mp.payment.v3.RefundResult result = PAY3.refundV3(
|
||||
caFile, idQuery, "R0002", 1d, 1d, "10020674");
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-mp</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-mp-server</artifactId>
|
||||
<name>weixin4j-mp-server</name>
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
<!-- 控制台输出日志 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
@ -31,6 +32,7 @@
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-qy</artifactId>
|
||||
<name>weixin4j-qy</name>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-qy</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-qy-api</artifactId>
|
||||
<name>weixin4j-qy-api</name>
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
<parent>
|
||||
<groupId>com.foxinmy</groupId>
|
||||
<artifactId>weixin4j-qy</artifactId>
|
||||
<version>1.2-SNAPSHOT</version>
|
||||
<version>1.2</version>
|
||||
</parent>
|
||||
<artifactId>weixin4j-qy-server</artifactId>
|
||||
<name>weixin4j-qy-server</name>
|
||||
|
||||
@ -9,7 +9,7 @@ import com.foxinmy.weixin4j.type.MessageType;
|
||||
/**
|
||||
* 用户进入应用的事件推送
|
||||
*
|
||||
* @className
|
||||
* @className EnterAgentAction
|
||||
* @author jy
|
||||
* @date 2014年12月28日
|
||||
* @since JDK 1.7
|
||||
|
||||
@ -12,6 +12,7 @@
|
||||
<!-- 控制台输出日志 -->
|
||||
<appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
@ -31,6 +32,7 @@
|
||||
</rollingPolicy>
|
||||
|
||||
<encoder>
|
||||
<charset>UTF-8</charset>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
|
||||
</pattern>
|
||||
</encoder>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user