|
@@ -69,6 +69,7 @@ public class DataService {
|
|
try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
try (Response response = OKHTTP_CLIENT.newCall(request).execute()) {
|
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
if (!response.isSuccessful()) throw new IOException("Unexpected code " + response);
|
|
String content = response.body().string();
|
|
String content = response.body().string();
|
|
|
|
+ System.out.println(content);
|
|
return content;
|
|
return content;
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
@@ -79,9 +80,14 @@ public class DataService {
|
|
|
|
|
|
public static void main(String[] args) {
|
|
public static void main(String[] args) {
|
|
Map <String,String> map = new HashMap<String,String>();
|
|
Map <String,String> map = new HashMap<String,String>();
|
|
- map.put("institution_id", "47600001");
|
|
|
|
- map.put("num", "10");
|
|
|
|
- postWithParameters(GET_EXAM_URL, map);
|
|
|
|
- }
|
|
|
|
|
|
+ map.put("institution_id", "02800001");
|
|
|
|
+ map.put("num", "1");
|
|
|
|
+ String content = postWithParameters(GET_EXAM_URL, map);
|
|
|
|
+ JSONObject jsonObject = JSON.parseObject(content);
|
|
|
|
+ if (!jsonObject.getString("msg").equals("success")) {
|
|
|
|
+ }
|
|
|
|
+ JSONArray jsonArray = JSON.parseArray(jsonObject.getString("data"));
|
|
|
|
+ System.out.println(jsonArray);
|
|
|
|
+}
|
|
|
|
|
|
}
|
|
}
|