1、swagger接口文档
parent
1950343e20
commit
ea9215e134
@ -0,0 +1,45 @@
|
|||||||
|
package com.ibeetl.jlw.util;
|
||||||
|
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.BufferedReader;
|
||||||
|
import java.io.InputStreamReader;
|
||||||
|
import java.net.HttpURLConnection;
|
||||||
|
import java.net.URL;
|
||||||
|
|
||||||
|
public class HttpJsonRequest {
|
||||||
|
|
||||||
|
|
||||||
|
public static String sendGetRequest(String urlString, String authorizationHeader) {
|
||||||
|
StringBuilder response = new StringBuilder();
|
||||||
|
try {
|
||||||
|
URL url = new URL(urlString);
|
||||||
|
HttpURLConnection con = (HttpURLConnection) url.openConnection();
|
||||||
|
con.setRequestMethod("GET");
|
||||||
|
con.setRequestProperty("Authorization", authorizationHeader);
|
||||||
|
|
||||||
|
int responseCode = con.getResponseCode();
|
||||||
|
if (responseCode == HttpURLConnection.HTTP_OK) {
|
||||||
|
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
|
||||||
|
String inputLine;
|
||||||
|
|
||||||
|
while ((inputLine = in.readLine()) != null) {
|
||||||
|
response.append(inputLine);
|
||||||
|
}
|
||||||
|
in.close();
|
||||||
|
} else {
|
||||||
|
System.out.println("HTTP GET request failed with response code: " + responseCode);
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return response.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static JSONArray extractDataArray(String jsonResponse) throws JSONException {
|
||||||
|
JSONObject jsonObject = new JSONObject(jsonResponse);
|
||||||
|
return jsonObject.getJSONArray("data");
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,8 @@
|
|||||||
findByCreateTime
|
findByCreateTime
|
||||||
===
|
===
|
||||||
select * from hs_values where DATE_FORMAT(create_time, '%Y-%m-%d') = #createTime#
|
select * from hs_values where DATE_FORMAT(create_time, '%Y-%m-%d') = #createTime#
|
||||||
|
|
||||||
|
|
||||||
|
findByTimeStr
|
||||||
|
===
|
||||||
|
select * from hs_values where create_time_str = #timeStr#
|
Loading…
Reference in New Issue