mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-07-18 04:33:17 +08:00
issue #138 tagAddUsers 接口少了一个参数
This commit is contained in:
parent
29cc3f6558
commit
ab916ddd71
@ -399,7 +399,7 @@ public interface WxCpService {
|
|||||||
* @param tagId
|
* @param tagId
|
||||||
* @param userIds
|
* @param userIds
|
||||||
*/
|
*/
|
||||||
void tagAddUsers(String tagId, List<String> userIds) throws WxErrorException;
|
void tagAddUsers(String tagId, List<String> userIds, List<String> partyIds) throws WxErrorException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <pre>
|
* <pre>
|
||||||
|
@ -271,7 +271,8 @@ public class WxCpServiceImpl implements WxCpService {
|
|||||||
return WxCpGsonBuilder.INSTANCE.create()
|
return WxCpGsonBuilder.INSTANCE.create()
|
||||||
.fromJson(
|
.fromJson(
|
||||||
tmpJsonElement.getAsJsonObject().get("department"),
|
tmpJsonElement.getAsJsonObject().get("department"),
|
||||||
new TypeToken<List<WxCpDepart>>() { }.getType()
|
new TypeToken<List<WxCpDepart>>() {
|
||||||
|
}.getType()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -389,7 +390,8 @@ public class WxCpServiceImpl implements WxCpService {
|
|||||||
return WxCpGsonBuilder.INSTANCE.create()
|
return WxCpGsonBuilder.INSTANCE.create()
|
||||||
.fromJson(
|
.fromJson(
|
||||||
tmpJsonElement.getAsJsonObject().get("taglist"),
|
tmpJsonElement.getAsJsonObject().get("taglist"),
|
||||||
new TypeToken<List<WxCpTag>>() { }.getType()
|
new TypeToken<List<WxCpTag>>() {
|
||||||
|
}.getType()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -406,15 +408,24 @@ public class WxCpServiceImpl implements WxCpService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tagAddUsers(String tagId, List<String> userIds) throws WxErrorException {
|
public void tagAddUsers(String tagId, List<String> userIds, List<String> partyIds) throws WxErrorException {
|
||||||
String url = "https://qyapi.weixin.qq.com/cgi-bin/tag/addtagusers";
|
String url = "https://qyapi.weixin.qq.com/cgi-bin/tag/addtagusers";
|
||||||
JsonObject jsonObject = new JsonObject();
|
JsonObject jsonObject = new JsonObject();
|
||||||
jsonObject.addProperty("tagid", tagId);
|
jsonObject.addProperty("tagid", tagId);
|
||||||
|
if (userIds != null) {
|
||||||
JsonArray jsonArray = new JsonArray();
|
JsonArray jsonArray = new JsonArray();
|
||||||
for (String userId : userIds) {
|
for (String userId : userIds) {
|
||||||
jsonArray.add(new JsonPrimitive(userId));
|
jsonArray.add(new JsonPrimitive(userId));
|
||||||
}
|
}
|
||||||
jsonObject.add("userlist", jsonArray);
|
jsonObject.add("userlist", jsonArray);
|
||||||
|
}
|
||||||
|
if (partyIds != null) {
|
||||||
|
JsonArray jsonArray = new JsonArray();
|
||||||
|
for (String userId : partyIds) {
|
||||||
|
jsonArray.add(new JsonPrimitive(userId));
|
||||||
|
}
|
||||||
|
jsonObject.add("partylist", jsonArray);
|
||||||
|
}
|
||||||
post(url, jsonObject.toString());
|
post(url, jsonObject.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user