1
0
mirror of synced 2025-12-23 18:48:00 +08:00

规范获取应用列表接口方法的相关字段命名

This commit is contained in:
Binary Wang
2018-08-29 00:21:17 +08:00
parent 6f9371dfb7
commit b327724433
4 changed files with 22 additions and 34 deletions

View File

@@ -23,13 +23,11 @@ public class WxCpAgentServiceImpl implements WxCpAgentService {
@Override
public WxCpAgent get(Integer agentId) throws WxErrorException {
String url = "https://qyapi.weixin.qq.com/cgi-bin/agent/get";
if (agentId != null) {
url += "?agentid=" + agentId;
} else {
if (agentId == null) {
throw new IllegalArgumentException("缺少agentid参数");
}
String url = "https://qyapi.weixin.qq.com/cgi-bin/agent/get?agentid=" + agentId;
String responseContent = this.mainService.get(url, null);
return WxCpAgent.fromJson(responseContent);
}

View File

@@ -17,15 +17,16 @@ import java.util.List;
*/
@Data
public class WxCpAgent implements Serializable {
private static final long serialVersionUID = 5002894979081127234L;
@SerializedName("errcode")
private Integer errcode;
private Integer errCode;
@SerializedName("errmsg")
private String errmsg;
private String errMsg;
@SerializedName("agentid")
private Integer agentid;
private Integer agentId;
@SerializedName("name")
private String name;
@@ -37,10 +38,10 @@ public class WxCpAgent implements Serializable {
private String description;
@SerializedName("allow_userinfos")
private Users allowUserinfos;
private Users allowUserInfos;
@SerializedName("allow_partys")
private Partys allowPartys;
private Partys allowParties;
@SerializedName("allow_tags")
private Tags allowTags;
@@ -55,7 +56,7 @@ public class WxCpAgent implements Serializable {
private Integer reportLocationFlag;
@SerializedName("isreportenter")
private Integer isreportenter;
private Integer isReportEnter;
@SerializedName("home_url")
private String homeUrl;
@@ -71,26 +72,25 @@ public class WxCpAgent implements Serializable {
@Data
public static class Users implements Serializable {
@SerializedName("user")
private List<User> user;
private List<User> users;
}
@Data
public class User implements Serializable {
@SerializedName("userid")
private String userid;
private String userId;
}
@Data
public class Partys {
@SerializedName("partyid")
private List<Integer> partyids = null;
private List<Integer> partyIds = null;
}
@Data
public class Tags {
@SerializedName("tagid")
private List<Integer> tagids = null;
private List<Integer> tagIds = null;
}
}