mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2025-10-29 09:38:19 +08:00
🆕 #1675 企业微信增加更新、查询和删除日历的接口
This commit is contained in:
@ -0,0 +1,15 @@
|
||||
package me.chanjar.weixin.common.bean;
|
||||
|
||||
/**
|
||||
* 包含toJson()方法的接口.
|
||||
*
|
||||
* @author <a href="https://github.com/binarywang">Binary Wang</a>
|
||||
* @date 2020-10-05
|
||||
*/
|
||||
public interface ToJson {
|
||||
/**
|
||||
* 转换为json字符串
|
||||
* @return json字符串
|
||||
*/
|
||||
String toJson();
|
||||
}
|
||||
@ -193,6 +193,10 @@ public class GsonHelper {
|
||||
jsonObject.addProperty(key.toString(), (Number) value);
|
||||
} else if (value instanceof JsonElement) {
|
||||
jsonObject.add(key.toString(), (JsonElement) value);
|
||||
} else if (value instanceof List) {
|
||||
JsonArray array = new JsonArray();
|
||||
((List<?>) value).forEach(a -> array.add(a.toString()));
|
||||
jsonObject.add(key.toString(), array);
|
||||
} else {
|
||||
jsonObject.addProperty(key.toString(), value.toString());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user