| | |
| | | return strBuilder.toString(); |
| | | } |
| | | |
| | | // public static void main(String[] args) { |
| | | //Get |
| | | /*Long time = new Date().getTime(); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("client_id","f168c651bf86f2c1"); |
| | | map.put("timestamp",time); |
| | | map.put("longitude","120.10"); |
| | | map.put("latitude","30.19"); |
| | | String url = "https://sandbox-cop.caocaokeji.cn/v2/common/queryCity"; |
| | | String response = PlatformUtil.doGet(url,"client_id=f168c651bf86f2c1×tamp="+time+"&sign="+SignUtil.sign(map)+"&longitude=120.10&latitude=30.19",null,100000); |
| | | com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response); |
| | | System.out.println(jsonObject.toJSONString());*/ |
| | | //Post |
| | | /* Map<String,Object> map = new HashMap<>(); |
| | | map.put("client_id","f168c651bf86f2c1"); |
| | | map.put("timestamp",new Date().getTime()); |
| | | map.put("order_id",1); |
| | | map.put("score","3"); |
| | | map.put("content","测试数据"); |
| | | map.put("sign",SignUtil.sign(map)); |
| | | String jsonMsg =JSONObject.toJSONString(map); |
| | | String url = "/v2/common/evaluateOrder"; |
| | | TokenUtil.RequestEntity req = new TokenUtil.RequestEntity(); |
| | | req.setReqMethod(TokenUtil.REQ_METHOD_POST); |
| | | req.setUri(url); |
| | | req.setContent(jsonMsg); |
| | | DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | req.setReqTime(dateFormat.format(new Date())); |
| | | String response = PlatformUtil.doPostJson1("https://sandbox-cop.caocaokeji.cn"+url,req.getContent(),null); |
| | | System.out.println(JSONObject.parseObject(response));*/ |
| | | |
| | | // System.out.println(new Date().getTime()); |
| | | // |
| | | // } |
| | | |
| | | } |