mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-08-25 01:14:36 +08:00
🐛 #1699 企业微信模块修复添加企业客户标签接口
* 外部联系人客户详情新增增加字段 增加字段:remark_corp_name,addWay,oper_userid Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改测试类 Signed-off-by: huangxiaoming <huangxm129@163.com> * 客户标签组查询列表功能修改 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改测试类 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改 add_way字段错误 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改添加企业客户标签后无返回信息 Signed-off-by: huangxiaoming <huangxm129@163.com> * 外部联系人客户详情新增增加字段 增加字段:remark_corp_name,addWay,oper_userid Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改测试类 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改测试类 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改 add_way字段错误 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改添加企业客户标签后无返回信息 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改错误 Signed-off-by: huangxiaoming <huangxm129@163.com> * 修改冲突 Signed-off-by: huangxiaoming <huangxm129@163.com>
This commit is contained in:
parent
a776e9cf11
commit
a9f9e30089
@ -239,7 +239,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
public WxCpUserExternalTagGroupInfo addCorpTag(WxCpUserExternalTagGroupInfo tagGroup) throws WxErrorException{
|
public WxCpUserExternalTagGroupInfo addCorpTag(WxCpUserExternalTagGroupInfo tagGroup) throws WxErrorException{
|
||||||
|
|
||||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_CORP_TAG);
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(ADD_CORP_TAG);
|
||||||
final String result = this.mainService.post(url,tagGroup.toJson());
|
final String result = this.mainService.post(url,tagGroup.getTagGroup().toJson());
|
||||||
return WxCpUserExternalTagGroupInfo.fromJson(result);
|
return WxCpUserExternalTagGroupInfo.fromJson(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -262,7 +262,7 @@ public class WxCpExternalContactServiceImpl implements WxCpExternalContactServic
|
|||||||
json.add("tag_id",new Gson().toJsonTree(tagId).getAsJsonArray());
|
json.add("tag_id",new Gson().toJsonTree(tagId).getAsJsonArray());
|
||||||
}
|
}
|
||||||
if(ArrayUtils.isNotEmpty(groupId)){
|
if(ArrayUtils.isNotEmpty(groupId)){
|
||||||
json.add("group_id",new Gson().toJsonTree(tagId).getAsJsonArray());
|
json.add("group_id",new Gson().toJsonTree(groupId).getAsJsonArray());
|
||||||
}
|
}
|
||||||
|
|
||||||
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEL_CORP_TAG);
|
final String url = this.mainService.getWxCpConfigStorage().getApiUrl(DEL_CORP_TAG);
|
||||||
|
@ -15,24 +15,35 @@ import java.util.List;
|
|||||||
@Setter
|
@Setter
|
||||||
public class WxCpUserExternalTagGroupInfo extends WxCpBaseResp {
|
public class WxCpUserExternalTagGroupInfo extends WxCpBaseResp {
|
||||||
|
|
||||||
@SerializedName("group_id")
|
@SerializedName("tag_group")
|
||||||
private String groupId;
|
private TagGroup tagGroup;
|
||||||
|
|
||||||
@SerializedName("group_name")
|
@Getter
|
||||||
private String groupName;
|
@Setter
|
||||||
|
public static class TagGroup {
|
||||||
|
|
||||||
@SerializedName("create_time")
|
@SerializedName("group_id")
|
||||||
private Long createTime;
|
private String groupId;
|
||||||
|
|
||||||
@SerializedName("order")
|
@SerializedName("group_name")
|
||||||
private Integer order;
|
private String groupName;
|
||||||
|
|
||||||
@SerializedName("deleted")
|
@SerializedName("create_time")
|
||||||
private Boolean deleted;
|
private Long createTime;
|
||||||
|
|
||||||
|
@SerializedName("order")
|
||||||
|
private Integer order;
|
||||||
|
|
||||||
@SerializedName("tag")
|
@SerializedName("deleted")
|
||||||
private List<Tag> tag;
|
private Boolean deleted;
|
||||||
|
|
||||||
|
@SerializedName("tag")
|
||||||
|
private List<Tag> tag;
|
||||||
|
|
||||||
|
public String toJson() {
|
||||||
|
return WxGsonBuilder.create().toJson(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
|
@ -117,20 +117,20 @@ public class WxCpExternalContactServiceImplTest {
|
|||||||
|
|
||||||
List<WxCpUserExternalTagGroupInfo.Tag> list = new ArrayList<>();
|
List<WxCpUserExternalTagGroupInfo.Tag> list = new ArrayList<>();
|
||||||
WxCpUserExternalTagGroupInfo.Tag tag = new WxCpUserExternalTagGroupInfo.Tag();
|
WxCpUserExternalTagGroupInfo.Tag tag = new WxCpUserExternalTagGroupInfo.Tag();
|
||||||
tag.setName("测试标签2");
|
tag.setName("测试标签20");
|
||||||
tag.setOrder(1);
|
tag.setOrder(1);
|
||||||
list.add(tag);
|
list.add(tag);
|
||||||
|
|
||||||
WxCpUserExternalTagGroupInfo tagGroup = new WxCpUserExternalTagGroupInfo();
|
WxCpUserExternalTagGroupInfo tagGroupInfo = new WxCpUserExternalTagGroupInfo();
|
||||||
|
WxCpUserExternalTagGroupInfo.TagGroup tagGroup = new WxCpUserExternalTagGroupInfo.TagGroup();
|
||||||
tagGroup.setGroupName("其他");
|
tagGroup.setGroupName("其他");
|
||||||
tagGroup.setOrder(1);
|
tagGroup.setOrder(1);
|
||||||
tagGroup.setTag(list);
|
tagGroup.setTag(list);
|
||||||
|
tagGroupInfo.setTagGroup(tagGroup);
|
||||||
|
|
||||||
WxCpUserExternalTagGroupInfo result = this.wxCpService.getExternalContactService().addCorpTag(tagGroup);
|
WxCpUserExternalTagGroupInfo result = this.wxCpService.getExternalContactService().addCorpTag(tagGroupInfo);
|
||||||
|
|
||||||
|
System.out.println(result.toJson());
|
||||||
|
|
||||||
System.out.println(result);
|
|
||||||
assertNotNull(result);
|
assertNotNull(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,8 +146,8 @@ public class WxCpExternalContactServiceImplTest {
|
|||||||
@Test
|
@Test
|
||||||
public void testDelCorpTag() throws WxErrorException {
|
public void testDelCorpTag() throws WxErrorException {
|
||||||
|
|
||||||
String tagId[] = {"et2omCCwAA6PtGsfeEOQMENl3Ub1FA6A"};
|
String tagId[] = {};
|
||||||
String groupId[] = {};
|
String groupId[] = {"et2omCCwAAM3WzL00QpK9xARab3HGkAg"};
|
||||||
|
|
||||||
WxCpBaseResp result = this.wxCpService.getExternalContactService().delCorpTag(tagId,groupId);
|
WxCpBaseResp result = this.wxCpService.getExternalContactService().delCorpTag(tagId,groupId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user