mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-05-08 06:37:46 +08:00
commit
ddd4079f28
2
.gitignore
vendored
2
.gitignore
vendored
@ -48,3 +48,5 @@ Icon
|
||||
Network Trash Folder
|
||||
Temporary Items
|
||||
.apdisk
|
||||
/.sonar/
|
||||
sonar-project.properties
|
||||
|
@ -26,7 +26,7 @@ Weixin Java Tools 微信公众号/企业号开发Java SDK
|
||||
|
||||
## 版本说明
|
||||
1. 本项目定为每两个月发布一次正式版,版本号格式为X.X.0(如2.1.0,2.2.0等),月底发布新版本,遇到重大问题需修复会及时提交新版本,欢迎大家随时提交Pull Request;
|
||||
1. BUG修复和新特性一般会先发布成小版本作为临时版本(如2.0.1,2.0.2等,即尾号不为0,以区别于正式版);
|
||||
1. BUG修复和新特性一般会先发布成小版本作为临时测试版本(如2.0.1-beta,2.0.2-beta等,即尾号不为0,并添加beta字样,以区别于正式版);
|
||||
1. 目前最新版本号为 [](https://maven-badges.herokuapp.com/maven-central/com.github.binarywang/weixin-java-parent) ,也可以通过访问链接 [【公众号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-mp%22) 、[【企业号】](http://search.maven.org/#search%7Cgav%7C1%7Cg%3A%22com.github.binarywang%22%20AND%20a%3A%22weixin-java-cp%22)
|
||||
分别查看所有最新的版本。
|
||||
|
||||
|
7
pom.xml
7
pom.xml
@ -5,7 +5,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-parent</artifactId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<version>2.4.4-beta</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>WeiXin Java Tools - Parent</name>
|
||||
<description>微信公众号、企业号上级POM</description>
|
||||
@ -69,6 +69,11 @@
|
||||
<email>dongfuqiang1988@163.com</email>
|
||||
<url>https://github.com/johnnytung</url>
|
||||
</developer>
|
||||
<developer>
|
||||
<name>Jonk</name>
|
||||
<email>aimilin@yeah.net</email>
|
||||
<url>https://github.com/aimilin6688</url>
|
||||
</developer>
|
||||
</developers>
|
||||
|
||||
<scm>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-parent</artifactId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<version>2.4.4-beta</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>weixin-java-common</artifactId>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-parent</artifactId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<version>2.4.4-beta</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>weixin-java-cp</artifactId>
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-parent</artifactId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<version>2.4.4-beta</version>
|
||||
</parent>
|
||||
<artifactId>weixin-java-mp</artifactId>
|
||||
<name>WeiXin Java Tools - MP</name>
|
||||
|
@ -422,8 +422,7 @@ public class WxMpServiceImpl implements WxMpService {
|
||||
}
|
||||
|
||||
if (error.getErrorCode() != 0) {
|
||||
this.log.error("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", uri, data,
|
||||
error);
|
||||
this.log.error("\n[URL]: {}\n[PARAMS]: {}\n[RESPONSE]: {}", uri, data, error);
|
||||
throw new WxErrorException(error);
|
||||
}
|
||||
return null;
|
||||
|
@ -1,11 +1,11 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
/**
|
||||
* openid列表群发的消息
|
||||
*
|
||||
@ -18,6 +18,7 @@ public class WxMpMassOpenIdsMessage implements Serializable {
|
||||
private String msgType;
|
||||
private String content;
|
||||
private String mediaId;
|
||||
private boolean sendIgnoreReprint = false;
|
||||
|
||||
public WxMpMassOpenIdsMessage() {
|
||||
super();
|
||||
@ -86,4 +87,15 @@ public class WxMpMassOpenIdsMessage implements Serializable {
|
||||
this.toUsers = toUsers;
|
||||
}
|
||||
|
||||
public boolean isSendIgnoreReprint() {
|
||||
return sendIgnoreReprint;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sendIgnoreReprint 文章被判定为转载时,是否继续进行群发操作。
|
||||
*/
|
||||
public void setSendIgnoreReprint(boolean sendIgnoreReprint) {
|
||||
this.sendIgnoreReprint = sendIgnoreReprint;
|
||||
}
|
||||
}
|
||||
|
@ -1,9 +1,9 @@
|
||||
package me.chanjar.weixin.mp.bean;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 按标签群发的消息
|
||||
*
|
||||
@ -13,16 +13,17 @@ public class WxMpMassTagMessage implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -6625914040986749286L;
|
||||
private Long tagId;
|
||||
private String msgtype;
|
||||
private String msgType;
|
||||
private String content;
|
||||
private String mediaId;
|
||||
private boolean sendIgnoreReprint = false;
|
||||
|
||||
public WxMpMassTagMessage() {
|
||||
super();
|
||||
}
|
||||
|
||||
public String getMsgtype() {
|
||||
return this.msgtype;
|
||||
public String getMsgType() {
|
||||
return this.msgType;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -35,10 +36,11 @@ public class WxMpMassTagMessage implements Serializable {
|
||||
* {@link me.chanjar.weixin.common.api.WxConsts#MASS_MSG_VOICE}
|
||||
* 如果msgtype和media_id不匹配的话,会返回系统繁忙的错误
|
||||
* </pre>
|
||||
* @param msgtype
|
||||
*
|
||||
* @param msgType 消息类型
|
||||
*/
|
||||
public void setMsgtype(String msgtype) {
|
||||
this.msgtype = msgtype;
|
||||
public void setMsgType(String msgType) {
|
||||
this.msgType = msgType;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
@ -67,10 +69,23 @@ public class WxMpMassTagMessage implements Serializable {
|
||||
|
||||
/**
|
||||
* 如果不设置则就意味着发给所有用户
|
||||
* @param tagId
|
||||
*
|
||||
* @param tagId 标签id
|
||||
*/
|
||||
public void setTagId(Long tagId) {
|
||||
this.tagId = tagId;
|
||||
}
|
||||
|
||||
public boolean isSendIgnoreReprint() {
|
||||
return sendIgnoreReprint;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param sendIgnoreReprint 文章被判定为转载时,是否继续进行群发操作。
|
||||
*/
|
||||
public void setSendIgnoreReprint(boolean sendIgnoreReprint) {
|
||||
this.sendIgnoreReprint = sendIgnoreReprint;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
package me.chanjar.weixin.mp.bean.result;
|
||||
|
||||
import me.chanjar.weixin.common.util.ToStringUtils;
|
||||
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -16,10 +17,6 @@ import java.io.Serializable;
|
||||
*
|
||||
*/
|
||||
public class WxMpMassSendResult implements Serializable {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = -4816336807575562818L;
|
||||
private String errorCode;
|
||||
private String errorMsg;
|
||||
@ -64,7 +61,7 @@ public class WxMpMassSendResult implements Serializable {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WxMassSendResult [errcode=" + this.errorCode + ", errmsg=" + this.errorMsg + ", msg_id=" + this.msgId + "]";
|
||||
return ToStringUtils.toSimpleString(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,16 +1,11 @@
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCard;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* Created by YuJian on 15/11/11.
|
||||
*
|
||||
|
@ -1,18 +1,13 @@
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
import com.google.gson.*;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.WxMpCard;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpCardResult;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
* Created by YuJian on 15/11/11.
|
||||
*
|
||||
|
@ -2,33 +2,12 @@ package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
|
||||
import me.chanjar.weixin.mp.bean.WxMpCard;
|
||||
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassNews;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassPreviewMessage;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassVideo;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialArticleUpdate;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNews;
|
||||
import me.chanjar.weixin.mp.bean.*;
|
||||
import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate;
|
||||
import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMediaImgUploadResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpCardResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialCountResult;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialFileBatchGetResult;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialNewsBatchGetResult;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialUploadResult;
|
||||
import me.chanjar.weixin.mp.bean.material.WxMpMaterialVideoInfoResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUser;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUserBlacklistGetResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUserList;
|
||||
import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage;
|
||||
import me.chanjar.weixin.mp.bean.material.*;
|
||||
import me.chanjar.weixin.mp.bean.result.*;
|
||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateIndustry;
|
||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
||||
|
||||
|
@ -11,6 +11,13 @@ import java.lang.reflect.Type;
|
||||
*/
|
||||
public class WxMpIndustryGsonAdapter
|
||||
implements JsonSerializer<WxMpTemplateIndustry>, JsonDeserializer<WxMpTemplateIndustry> {
|
||||
private static WxMpTemplateIndustry.Industry convertFromJson(JsonObject json) {
|
||||
WxMpTemplateIndustry.Industry industry = new WxMpTemplateIndustry.Industry();
|
||||
industry.setFirstClass(GsonHelper.getString(json, "first_class"));
|
||||
industry.setSecondClass(GsonHelper.getString(json, "second_class"));
|
||||
return industry;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonElement serialize(WxMpTemplateIndustry wxMpIndustry, Type type,
|
||||
JsonSerializationContext jsonSerializationContext) {
|
||||
@ -33,11 +40,4 @@ public class WxMpIndustryGsonAdapter
|
||||
wxMpIndustry.setSecondIndustry(convertFromJson(secondaryIndustry));
|
||||
return wxMpIndustry;
|
||||
}
|
||||
|
||||
private static WxMpTemplateIndustry.Industry convertFromJson(JsonObject json) {
|
||||
WxMpTemplateIndustry.Industry industry = new WxMpTemplateIndustry.Industry();
|
||||
industry.setFirstClass(GsonHelper.getString(json, "first_class"));
|
||||
industry.setSecondClass(GsonHelper.getString(json, "second_class"));
|
||||
return industry;
|
||||
}
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ public class WxMpMassOpenIdsMessageGsonAdapter implements JsonSerializer<WxMpMas
|
||||
messageJson.add(WxConsts.MASS_MSG_VIDEO, sub);
|
||||
}
|
||||
messageJson.addProperty("msgtype", message.getMsgType());
|
||||
messageJson.addProperty("send_ignore_reprint", message.isSendIgnoreReprint() ? 0 : 1);
|
||||
return messageJson;
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxMpMassSendResultAdapter implements JsonDeserializer<WxMpMassSendResult> {
|
||||
|
||||
|
@ -8,16 +8,15 @@
|
||||
*/
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public class WxMpMassTagMessageGsonAdapter implements JsonSerializer<WxMpMassTagMessage> {
|
||||
|
||||
@Override
|
||||
@ -33,32 +32,33 @@ public class WxMpMassTagMessageGsonAdapter implements JsonSerializer<WxMpMassTag
|
||||
}
|
||||
messageJson.add("filter", filter);
|
||||
|
||||
if (WxConsts.MASS_MSG_NEWS.equals(message.getMsgtype())) {
|
||||
if (WxConsts.MASS_MSG_NEWS.equals(message.getMsgType())) {
|
||||
JsonObject sub = new JsonObject();
|
||||
sub.addProperty("media_id", message.getMediaId());
|
||||
messageJson.add(WxConsts.MASS_MSG_NEWS, sub);
|
||||
}
|
||||
if (WxConsts.MASS_MSG_TEXT.equals(message.getMsgtype())) {
|
||||
if (WxConsts.MASS_MSG_TEXT.equals(message.getMsgType())) {
|
||||
JsonObject sub = new JsonObject();
|
||||
sub.addProperty("content", message.getContent());
|
||||
messageJson.add(WxConsts.MASS_MSG_TEXT, sub);
|
||||
}
|
||||
if (WxConsts.MASS_MSG_VOICE.equals(message.getMsgtype())) {
|
||||
if (WxConsts.MASS_MSG_VOICE.equals(message.getMsgType())) {
|
||||
JsonObject sub = new JsonObject();
|
||||
sub.addProperty("media_id", message.getMediaId());
|
||||
messageJson.add(WxConsts.MASS_MSG_VOICE, sub);
|
||||
}
|
||||
if (WxConsts.MASS_MSG_IMAGE.equals(message.getMsgtype())) {
|
||||
if (WxConsts.MASS_MSG_IMAGE.equals(message.getMsgType())) {
|
||||
JsonObject sub = new JsonObject();
|
||||
sub.addProperty("media_id", message.getMediaId());
|
||||
messageJson.add(WxConsts.MASS_MSG_IMAGE, sub);
|
||||
}
|
||||
if (WxConsts.MASS_MSG_VIDEO.equals(message.getMsgtype())) {
|
||||
if (WxConsts.MASS_MSG_VIDEO.equals(message.getMsgType())) {
|
||||
JsonObject sub = new JsonObject();
|
||||
sub.addProperty("media_id", message.getMediaId());
|
||||
messageJson.add(WxConsts.MASS_MSG_VIDEO, sub);
|
||||
}
|
||||
messageJson.addProperty("msgtype", message.getMsgtype());
|
||||
messageJson.addProperty("msgtype", message.getMsgType());
|
||||
messageJson.addProperty("send_ignore_reprint", message.isSendIgnoreReprint() ? 0 : 1);
|
||||
return messageJson;
|
||||
}
|
||||
|
||||
|
@ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxMpMassUploadResultAdapter implements JsonDeserializer<WxMpMassUploadResult> {
|
||||
|
||||
|
@ -17,9 +17,7 @@ import me.chanjar.weixin.mp.bean.WxMpMassVideo;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxMpMassVideoAdapter implements JsonSerializer<WxMpMassVideo> {
|
||||
|
||||
|
@ -1,16 +1,11 @@
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpOAuth2AccessToken;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public class WxMpOAuth2AccessTokenAdapter implements JsonDeserializer<WxMpOAuth2AccessToken> {
|
||||
|
||||
@Override
|
||||
|
@ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpSemanticQueryResult;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxMpSemanticQueryResultAdapter implements JsonDeserializer<WxMpSemanticQueryResult> {
|
||||
|
||||
|
@ -12,7 +12,6 @@ import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonSerializationContext;
|
||||
import com.google.gson.JsonSerializer;
|
||||
|
||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
|
||||
import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
|
||||
|
||||
|
@ -8,24 +8,16 @@
|
||||
*/
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate;
|
||||
import org.apache.commons.lang3.time.FastDateFormat;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParseException;
|
||||
|
||||
import org.apache.commons.lang3.time.FastDateFormat;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserCumulate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxMpUserCumulateGsonAdapter implements JsonDeserializer<WxDataCubeUserCumulate> {
|
||||
|
||||
|
@ -8,17 +8,12 @@
|
||||
*/
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpUser;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
public class WxMpUserGsonAdapter implements JsonDeserializer<WxMpUser> {
|
||||
|
||||
@Override
|
||||
|
@ -8,19 +8,13 @@
|
||||
*/
|
||||
package me.chanjar.weixin.mp.util.json;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParseException;
|
||||
|
||||
import org.apache.commons.lang3.time.FastDateFormat;
|
||||
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonDeserializer;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParseException;
|
||||
|
||||
import com.google.gson.*;
|
||||
import me.chanjar.weixin.common.util.json.GsonHelper;
|
||||
import me.chanjar.weixin.mp.bean.datacube.WxDataCubeUserSummary;
|
||||
import org.apache.commons.lang3.time.FastDateFormat;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.text.ParseException;
|
||||
|
||||
/**
|
||||
* @author Daniel Qian
|
||||
|
@ -15,9 +15,7 @@ import me.chanjar.weixin.mp.bean.result.WxMpQrCodeTicket;
|
||||
import java.lang.reflect.Type;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Daniel Qian
|
||||
*
|
||||
*/
|
||||
public class WxQrCodeTicketAdapter implements JsonDeserializer<WxMpQrCodeTicket> {
|
||||
|
||||
|
@ -1,15 +1,6 @@
|
||||
package me.chanjar.weixin.mp.api;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import com.google.inject.Inject;
|
||||
|
||||
import me.chanjar.weixin.common.api.WxConsts;
|
||||
import me.chanjar.weixin.common.bean.result.WxMediaUploadResult;
|
||||
import me.chanjar.weixin.common.exception.WxErrorException;
|
||||
@ -19,11 +10,18 @@ import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
|
||||
import me.chanjar.weixin.mp.bean.WxMpMassVideo;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpMassSendResult;
|
||||
import me.chanjar.weixin.mp.bean.result.WxMpMassUploadResult;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.DataProvider;
|
||||
import org.testng.annotations.Guice;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
/**
|
||||
* 测试群发消息
|
||||
* @author chanjarster
|
||||
*
|
||||
* @author chanjarster
|
||||
*/
|
||||
@Test(groups = "massAPI", dependsOnGroups = {"baseAPI", "mediaAPI", "groupAPI"})
|
||||
@Guice(modules = ApiTestModule.class)
|
||||
@ -68,7 +66,7 @@ public class WxMpMassMessageAPITest {
|
||||
@Test
|
||||
public void testTextMassGroupMessageSend() throws WxErrorException {
|
||||
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
||||
massMessage.setMsgtype(WxConsts.MASS_MSG_TEXT);
|
||||
massMessage.setMsgType(WxConsts.MASS_MSG_TEXT);
|
||||
massMessage.setContent("测试群发消息\n欢迎欢迎,热烈欢迎\n换行测试\n超链接:<a href=\"http://www.baidu.com\">Hello World</a>");
|
||||
massMessage
|
||||
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
||||
@ -83,7 +81,7 @@ public class WxMpMassMessageAPITest {
|
||||
public void testMediaMassGroupMessageSend(String massMsgType, String mediaId)
|
||||
throws WxErrorException {
|
||||
WxMpMassTagMessage massMessage = new WxMpMassTagMessage();
|
||||
massMessage.setMsgtype(massMsgType);
|
||||
massMessage.setMsgType(massMsgType);
|
||||
massMessage.setMediaId(mediaId);
|
||||
massMessage
|
||||
.setTagId(this.wxService.getUserTagService().tagGet().get(0).getId());
|
||||
|
@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>com.github.binarywang</groupId>
|
||||
<artifactId>weixin-java-parent</artifactId>
|
||||
<version>2.5.0-SNAPSHOT</version>
|
||||
<version>2.4.4-beta</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>weixin-java-osgi</artifactId>
|
||||
|
Loading…
Reference in New Issue
Block a user