We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
更新员工自定义字段时,序列化失败
WxCpUserGsonAdapter中 JsonElement serialize(WxCpUser user, Type typeOfSrc, JsonSerializationContext context)方法中网页类型没有设置type以及name的值
if (user.getExtAttrs().size() > 0) { attrsJsonArray = new JsonArray(); Iterator var14 = user.getExtAttrs().iterator(); while(var14.hasNext()) { Attr attr = (Attr)var14.next(); JsonObject attrJson = new JsonObject(); attrsJsonArray.add(attrJson); if (attr.getType() == null) { attrJson.addProperty("name", attr.getName()); attrJson.addProperty("value", attr.getTextValue()); } else { switch(attr.getType()) { case 0: attrJson = new JsonObject(); attrJson.addProperty("value", attr.getTextValue()); attrJson.add("text", attrJson); break; case 1: attrJson = new JsonObject(); attrJson.addProperty("url", attr.getWebUrl()); attrJson.addProperty("title", attr.getWebTitle()); attrJson.add("web", attrJson); } } }
转换后的json如下: "extattr":{"attrs":[{"text":{"value":"01482"}},{"web":{"url":"https://www.baidu.com","title":"3-103"}}]},
The text was updated successfully, but these errors were encountered:
你说的这个问题早已修复,建议你看真正的最新的源码,而不是反编译的代码。
Sorry, something went wrong.
参考 #1738
No branches or pull requests
简要描述
更新员工自定义字段时,序列化失败
模块版本情况
详细描述
WxCpUserGsonAdapter中 JsonElement serialize(WxCpUser user, Type typeOfSrc, JsonSerializationContext context)方法中网页类型没有设置type以及name的值
if (user.getExtAttrs().size() > 0) {
attrsJsonArray = new JsonArray();
Iterator var14 = user.getExtAttrs().iterator();
while(var14.hasNext()) {
Attr attr = (Attr)var14.next();
JsonObject attrJson = new JsonObject();
attrsJsonArray.add(attrJson);
if (attr.getType() == null) {
attrJson.addProperty("name", attr.getName());
attrJson.addProperty("value", attr.getTextValue());
} else {
switch(attr.getType()) {
case 0:
attrJson = new JsonObject();
attrJson.addProperty("value", attr.getTextValue());
attrJson.add("text", attrJson);
break;
case 1:
attrJson = new JsonObject();
attrJson.addProperty("url", attr.getWebUrl());
attrJson.addProperty("title", attr.getWebTitle());
attrJson.add("web", attrJson);
}
}
}
日志
转换后的json如下:
"extattr":{"attrs":[{"text":{"value":"01482"}},{"web":{"url":"https://www.baidu.com","title":"3-103"}}]},
The text was updated successfully, but these errors were encountered: