判断json对象时JSONArray还是JSONObject 使用的fastjson Object object = js.get("guid"); if (object instanceof JSONArray) { System.out.println("JSONArray"); }else{ ...
分类:
Web程序 时间:
2020-11-27 11:30:51
阅读次数:
13
package com.smil.gws.wbd.labor;import com.alibaba.fastjson.JSON;import com.alibaba.fastjson.JSONObject;import com.smil.gws.common.utils.GwsReportUtils ...
分类:
Web程序 时间:
2020-11-26 15:05:39
阅读次数:
9
在微信中,发送httpclient请求 使用了apache的组件 /** * post请求 * @param url * @param json * @return */ public static JSONObject doPost(String url,JSONObject json){ Clo ...
分类:
微信 时间:
2020-11-11 15:44:03
阅读次数:
19
import com.alibaba.fastjson.JSON; import redis.clients.jedis.Jedis; import com.alibaba.fastjson.JSONObject; import java.util.HashMap; import com.googl ...
分类:
数据库 时间:
2020-09-18 02:52:16
阅读次数:
46
在进行对接第三方接口时,进行参数组装成json的过程中出现参数传递格式错误以及json格式化错误。 在拼接json时,如果json中有对象,则以map的方式组装好所有参数。最后map转成json,不然直接用jsonObject对象put参数,会自动在json中的json那里帮我们添加转义符以及把{} ...
分类:
Web程序 时间:
2020-09-08 20:48:31
阅读次数:
66
文件夹数据库处理逻辑 public class DbFolder { JSONObject root; public DbFolder() { this.root = new JSONObject(); this.root.put("f_id", ""); this.root.put("f_name ...
分类:
Web程序 时间:
2020-08-11 10:43:49
阅读次数:
72
package com.sundear.demo; import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; import org.json.JSONObject; import org.junit.jupiter.api.Test ...
分类:
其他好文 时间:
2020-08-03 23:08:20
阅读次数:
68
1:核心代码 JSONObject json=(JSONObject) JSON.parse(responseContent); byte [] compress=Base64.decodeBase64((json.getString("result").getBytes("UTF-8"))); ( ...
分类:
其他好文 时间:
2020-07-22 20:26:49
阅读次数:
74
public static JSONObject getToken(String appId,String appSecret){ String url="https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&app ...
分类:
微信 时间:
2020-07-17 14:05:12
阅读次数:
111
1.new JSONObject().toJSONString(rootEntity) 2. JSONObject jsonObject = JSONObject.fromObject(emp);3.String s= JSONArray.fromObject(user).toString(); j ...
分类:
Web程序 时间:
2020-07-16 18:16:37
阅读次数:
103