|
@@ -20,7 +20,9 @@ import org.springframework.test.context.junit4.SpringRunner;
|
|
|
import java.io.*;
|
|
|
import java.net.HttpURLConnection;
|
|
|
import java.net.URL;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@SpringBootTest(classes = ZzjsApplication.class)
|
|
|
@RunWith(SpringRunner.class)
|
|
@@ -103,6 +105,73 @@ public class YdtTest {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ @Test
|
|
|
+ public void getSkillInfo2() {
|
|
|
+ Ydt ydt = new Ydt();
|
|
|
+ ydt.setNonceStr("0E1EE833-16AE-4BBE-A3ED-5697E3FC21FF");
|
|
|
+ ydt.setQuestionId(String.valueOf(28110));
|
|
|
+ String jsonObject = JSONObject.toJSONString(ydt);
|
|
|
+ String result = ydtService.getSkillInfo(jsonObject);
|
|
|
+ System.out.println(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getSkillInfo3() {
|
|
|
+ Ydt ydt = new Ydt();
|
|
|
+ ydt.setNonceStr("DA84C605-A06E-4EC6-BC78-0E935E77A80C");
|
|
|
+ ydt.setQuestionId(String.valueOf(24));
|
|
|
+ Map<String,String> map = new HashMap<String,String>();
|
|
|
+ map.put("Cookie","id58=CocGRmRsTOulXZauDNmMAg==");
|
|
|
+ map.put("Cache-Control","no-cache");
|
|
|
+// map.put("Postman-Token","<calculated when request is sent>");
|
|
|
+// map.put("Host","<calculated when request is sent>");
|
|
|
+ map.put("User-Agent","PostmanRuntime/7.32.2");
|
|
|
+ map.put("Accept","*/*");
|
|
|
+ map.put("Accept-Encoding","gzip, deflate, br");
|
|
|
+ map.put("Cookie","id58=CrIbn2RsXIYTjBROEAvkAg==; cityid=1; hpincode=; userid=; cversion=\"12.9.1\"");
|
|
|
+ map.put("hsign","6a6d67acfc0a65e5f08e39b28fc8a94b");
|
|
|
+ map.put("User-Agent","Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148");
|
|
|
+ map.put("hos","ios");
|
|
|
+ map.put("kemutype","1");
|
|
|
+ map.put("learnStage","10");
|
|
|
+ map.put("happver","12.9.1");
|
|
|
+ map.put("htime","1684852266961");
|
|
|
+ map.put("cartype","0");
|
|
|
+ map.put("hurl","https://kaoshiapi.ksedt.com/sns/exam/getQuestionInfo");
|
|
|
+ map.put("hsnssign","8c21a00420324734a631afdbeb8b63e8");
|
|
|
+ map.put("channelCode","");
|
|
|
+ map.put("hpath","https://kaoshiapi.ksedt.com/sns/exam/getQuestionInfo");
|
|
|
+ map.put("hpincode","");
|
|
|
+ map.put("packagename","com.jiaxiao");
|
|
|
+ map.put("hsimplyTourist","false");
|
|
|
+ map.put("Accept-Language","zh-Hans;q=1");
|
|
|
+ map.put("hproductid","3");
|
|
|
+ map.put("productid","3");
|
|
|
+// map.put("happid","201826471087328101");
|
|
|
+// map.put("hsignSuffix","hZLJ3qzMgFK25A2S");
|
|
|
+ map.put("Content-Type","application/x-www-form-urlencoded");
|
|
|
+// map.put("hext-union","812852");
|
|
|
+// map.put("hr","DSZO1c_Kl5_REWx-ZorqECSXFyVXVIBtADp2qW85yp3ZFdPlHZKs8C7JAvCxD8l521hlXjdSDI0RPa9FYlj0k4lyhsejsTtwKxys8XGtVwIcJKgoECPQTiVCSpySXZfsQ5-QUg5d4YSxnRLfvG90mzWeW4x6JczIQ32tqt-b7ESf3poujyCRHZQESmoKD49AezrxFP56v0-aQymZ1ZC6lA");
|
|
|
+// map.put("Connection","close");
|
|
|
+
|
|
|
+
|
|
|
+ String jsonObject = JSONObject.toJSONString(ydt);
|
|
|
+ // String result = ydtService.getQuestionInfo(jsonObject,map);
|
|
|
+ // System.out.println(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getQuestionInfo() {
|
|
|
+ String cookie = "id58=CrIbn2RsXIYTjBROEAvkAg==; cityid=1; hpincode=; userid=; cversion=\"12.9.1\"";
|
|
|
+ String hsign = "6a6d67acfc0a65e5f08e39b28fc8a94b";
|
|
|
+ String userAgent = "Mozilla/5.0 (iPhone; CPU iPhone OS 12_5_7 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148";
|
|
|
+ // Include other header values...
|
|
|
+ String data = "data=%7B%22nonceStr%22%3A%22DA84C605-A06E-4EC6-BC78-0E935E77A80C%22%2C%22questionId%22%3A%2224%22%7D";
|
|
|
+
|
|
|
+ String response = ydtService.getQuestionInfo(cookie, hsign, userAgent, /*other headers...*/ data);
|
|
|
+ System.out.println(response);
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
|
|
|
@Test
|