|
@@ -9,9 +9,12 @@ import com.miaxis.feign.service.IYdtService;
|
|
|
import com.miaxis.question.domain.QuestionInfoGet;
|
|
|
import com.miaxis.question.domain.QuestionYdtJs;
|
|
|
import com.miaxis.question.domain.WebNoteAll;
|
|
|
+import com.miaxis.question.domain.WebNoteJs;
|
|
|
import com.miaxis.question.service.IQuestionInfoGetService;
|
|
|
import com.miaxis.question.service.IQuestionYdtJsService;
|
|
|
import com.miaxis.question.service.IWebNoteAllService;
|
|
|
+import com.miaxis.question.service.IWebNoteJsService;
|
|
|
+import org.apache.commons.collections.map.HashedMap;
|
|
|
import org.junit.Test;
|
|
|
import org.junit.runner.RunWith;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -43,6 +46,10 @@ public class YdtTest {
|
|
|
@Autowired
|
|
|
private IWebNoteAllService webNoteAllService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private IWebNoteJsService webNoteJsService;
|
|
|
+
|
|
|
+
|
|
|
|
|
|
/**
|
|
|
* 获取一点通题库
|
|
@@ -118,47 +125,19 @@ public class YdtTest {
|
|
|
|
|
|
@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);
|
|
|
+ System.out.println(jsonObject);
|
|
|
+ // String data= "{\"nonceStr\":\"DA84C605-A06E-4EC6-BC78-0E935E77A80C\",\"questionId\":\"24\"}";
|
|
|
|
|
|
|
|
|
- String jsonObject = JSONObject.toJSONString(ydt);
|
|
|
- // String result = ydtService.getQuestionInfo(jsonObject,map);
|
|
|
- // System.out.println(result);
|
|
|
+ String result = ydtService.getQuestionInfo(jsonObject);
|
|
|
+ System.out.println(result);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Test
|
|
@@ -169,8 +148,8 @@ public class YdtTest {
|
|
|
// 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);
|
|
|
+ // String response = ydtService.getQuestionInfo(cookie, hsign, userAgent, /*other headers...*/ data);
|
|
|
+ // System.out.println(response);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -261,7 +240,16 @@ public class YdtTest {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Test
|
|
|
+ public void getVoice2() throws IOException {
|
|
|
+
|
|
|
+ WebNoteJs webNoteJs = new WebNoteJs();
|
|
|
+ webNoteJs.setId(1l);
|
|
|
+ webNoteJs.setQbAnalyse("12312");
|
|
|
+ webNoteJs.setQbReadAnalyse("12312");
|
|
|
+ webNoteJs.setQbSkillAudioLink("https");
|
|
|
+ webNoteJsService.save(webNoteJs);
|
|
|
+ }
|
|
|
|
|
|
@Test
|
|
|
public void getVoice() throws IOException {
|