Visitar URL original
修改添加企业客户标签后无返回信息 by huangxm129 · Pull Request #1699 · binarywang/WxJava · GitHub
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
修改添加企业客户标签后无返回信息
Signed-off-by: huangxiaoming <huangxm129@163.com>
  • Loading branch information
huangxm129 committed Aug 3, 2020
commit 2faa8704c2cad17cc7400d5dfd08a2873c0a6473
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public WxCpUserExternalTagGroupList getCorpTagList(String[] tagId) throws WxErro
public WxCpUserExternalTagGroupInfo addCorpTag(WxCpUserExternalTagGroupInfo tagGroup) throws WxErrorException{

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);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,35 @@
@Setter
public class WxCpUserExternalTagGroupInfo extends WxCpBaseResp {

@SerializedName("group_id")
private String groupId;
@SerializedName("tag_group")
private TagGroup tagGroup;

@SerializedName("group_name")
private String groupName;
@Getter
@Setter
public static class TagGroup {

@SerializedName("group_id")
private String groupId;

@SerializedName("group_name")
private String groupName;

@SerializedName("create_time")
private Long createTime;
@SerializedName("create_time")
private Long createTime;

@SerializedName("order")
private Integer order;
@SerializedName("order")
private Integer order;

@SerializedName("deleted")
private Boolean deleted;
@SerializedName("deleted")
private Boolean deleted;

@SerializedName("tag")
private List<Tag> tag;

@SerializedName("tag")
private List<Tag> tag;
public String toJson() {
return WxGsonBuilder.create().toJson(this);
}
}

@Getter
@Setter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ public void testAddCorpTag() throws WxErrorException {

List<WxCpUserExternalTagGroupInfo.Tag> list = new ArrayList<>();
WxCpUserExternalTagGroupInfo.Tag tag = new WxCpUserExternalTagGroupInfo.Tag();
tag.setName("测试标签2");
tag.setName("测试标签9");
tag.setOrder(1);
list.add(tag);

WxCpUserExternalTagGroupInfo tagGroup = new WxCpUserExternalTagGroupInfo();
WxCpUserExternalTagGroupInfo tagGroupInfo = new WxCpUserExternalTagGroupInfo();
WxCpUserExternalTagGroupInfo.TagGroup tagGroup = new WxCpUserExternalTagGroupInfo.TagGroup();
tagGroup.setGroupName("其他");
tagGroup.setOrder(1);
tagGroup.setTag(list);
tagGroupInfo.setTagGroup(tagGroup);

WxCpUserExternalTagGroupInfo result = this.wxCpService.getExternalContactService().addCorpTag(tagGroup);
WxCpUserExternalTagGroupInfo result = this.wxCpService.getExternalContactService().addCorpTag(tagGroupInfo);



System.out.println(result);
System.out.println(result.toJson());
assertNotNull(result);
}

Expand Down