调整移除group相关接口后的代码

This commit is contained in:
BinaryWang
2016-09-28 19:00:46 +08:00
parent 1352385328
commit f2a858db7a
12 changed files with 89 additions and 161 deletions

View File

@@ -4,7 +4,7 @@ import me.chanjar.weixin.common.bean.WxJsapiSignature;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.common.util.http.RequestExecutor;
import me.chanjar.weixin.mp.bean.WxMpIndustry;
import me.chanjar.weixin.mp.bean.WxMpMassGroupMessage;
import me.chanjar.weixin.mp.bean.WxMpMassTagMessage;
import me.chanjar.weixin.mp.bean.WxMpMassNews;
import me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage;
import me.chanjar.weixin.mp.bean.WxMpMassPreviewMessage;
@@ -88,7 +88,7 @@ public interface WxMpService {
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
* </pre>
*
* @see #massGroupMessageSend(me.chanjar.weixin.mp.bean.WxMpMassGroupMessage)
* @see #massGroupMessageSend(me.chanjar.weixin.mp.bean.WxMpMassTagMessage)
* @see #massOpenIdsMessageSend(me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage)
*/
WxMpMassUploadResult massNewsUpload(WxMpMassNews news) throws WxErrorException;
@@ -99,7 +99,7 @@ public interface WxMpService {
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
* </pre>
*
* @see #massGroupMessageSend(me.chanjar.weixin.mp.bean.WxMpMassGroupMessage)
* @see #massGroupMessageSend(me.chanjar.weixin.mp.bean.WxMpMassTagMessage)
* @see #massOpenIdsMessageSend(me.chanjar.weixin.mp.bean.WxMpMassOpenIdsMessage)
*/
WxMpMassUploadResult massVideoUpload(WxMpMassVideo video) throws WxErrorException;
@@ -112,7 +112,7 @@ public interface WxMpService {
* 详情请见: http://mp.weixin.qq.com/wiki/index.php?title=高级群发接口
* </pre>
*/
WxMpMassSendResult massGroupMessageSend(WxMpMassGroupMessage message) throws WxErrorException;
WxMpMassSendResult massGroupMessageSend(WxMpMassTagMessage message) throws WxErrorException;
/**
* <pre>

View File

@@ -1,11 +1,11 @@
package me.chanjar.weixin.mp.api;
import java.util.List;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.bean.tag.WxTagListUser;
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
import java.util.List;
/**
* 用户标签管理相关接口
* Created by Binary Wang on 2016/9/2.
@@ -44,7 +44,7 @@ public interface WxMpUserTagService {
* </pre>
*
*/
Boolean tagUpdate(Integer id, String name) throws WxErrorException;
Boolean tagUpdate(Long tagId, String name) throws WxErrorException;
/**
* <pre>
@@ -54,7 +54,7 @@ public interface WxMpUserTagService {
* </pre>
*
*/
Boolean tagDelete(Integer id) throws WxErrorException;
Boolean tagDelete(Long tagId) throws WxErrorException;
/**
* <pre>
@@ -64,7 +64,8 @@ public interface WxMpUserTagService {
* </pre>
*
*/
WxTagListUser tagListUser(Integer tagId, String nextOpenid) throws WxErrorException;
WxTagListUser tagListUser(Long tagId, String nextOpenid)
throws WxErrorException;
/**
* <pre>
@@ -74,7 +75,7 @@ public interface WxMpUserTagService {
* </pre>
*
*/
boolean batchTagging(Integer tagId, String[] openids) throws WxErrorException;
boolean batchTagging(Long tagId, String[] openids) throws WxErrorException;
/**
* <pre>
@@ -84,7 +85,7 @@ public interface WxMpUserTagService {
* </pre>
*
*/
boolean batchUntagging(Integer tagId, String[] openids) throws WxErrorException;
boolean batchUntagging(Long tagId, String[] openids) throws WxErrorException;
/**

View File

@@ -190,7 +190,7 @@ public class WxMpServiceImpl implements WxMpService {
}
@Override
public WxMpMassSendResult massGroupMessageSend(WxMpMassGroupMessage message) throws WxErrorException {
public WxMpMassSendResult massGroupMessageSend(WxMpMassTagMessage message) throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/message/mass/sendall";
String responseContent = execute(new SimplePostRequestExecutor(), url, message.toJson());
return WxMpMassSendResult.fromJson(responseContent);

View File

@@ -1,9 +1,16 @@
package me.chanjar.weixin.mp.api.impl;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.reflect.TypeToken;
import me.chanjar.weixin.common.bean.result.WxError;
import me.chanjar.weixin.common.exception.WxErrorException;
import me.chanjar.weixin.mp.api.WxMpService;
@@ -11,11 +18,6 @@ import me.chanjar.weixin.mp.api.WxMpUserTagService;
import me.chanjar.weixin.mp.bean.tag.WxTagListUser;
import me.chanjar.weixin.mp.bean.tag.WxUserTag;
import me.chanjar.weixin.mp.util.json.WxMpGsonBuilder;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.List;
/**
*
@@ -58,7 +60,7 @@ public class WxMpUserTagServiceImpl implements WxMpUserTagService {
}
@Override
public Boolean tagUpdate(Integer id, String name) throws WxErrorException {
public Boolean tagUpdate(Long id, String name) throws WxErrorException {
String url = API_URL_PREFIX + "/update";
JsonObject json = new JsonObject();
@@ -78,7 +80,7 @@ public class WxMpUserTagServiceImpl implements WxMpUserTagService {
}
@Override
public Boolean tagDelete(Integer id) throws WxErrorException {
public Boolean tagDelete(Long id) throws WxErrorException {
String url = API_URL_PREFIX + "/delete";
JsonObject json = new JsonObject();
@@ -98,7 +100,8 @@ public class WxMpUserTagServiceImpl implements WxMpUserTagService {
}
@Override
public WxTagListUser tagListUser(Integer tagId, String nextOpenid) throws WxErrorException {
public WxTagListUser tagListUser(Long tagId, String nextOpenid)
throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/user/tag/get";
JsonObject json = new JsonObject();
@@ -112,7 +115,8 @@ public class WxMpUserTagServiceImpl implements WxMpUserTagService {
}
@Override
public boolean batchTagging(Integer tagId, String[] openids) throws WxErrorException {
public boolean batchTagging(Long tagId, String[] openids)
throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/tags/members/batchtagging";
JsonObject json = new JsonObject();
@@ -135,7 +139,8 @@ public class WxMpUserTagServiceImpl implements WxMpUserTagService {
}
@Override
public boolean batchUntagging(Integer tagId, String[] openids) throws WxErrorException {
public boolean batchUntagging(Long tagId, String[] openids)
throws WxErrorException {
String url = "https://api.weixin.qq.com/cgi-bin/tags/members/batchuntagging";
JsonObject json = new JsonObject();