小么熊🐻 1 rok pred
rodič
commit
3a26c2e9ef

+ 3 - 2
zzjs-admin/src/test/java/com/miaxis/test/Test03.java

@@ -14,7 +14,7 @@ public class Test03 {
 
     public void testExcel() throws Exception {
 
-        File file = new File("G:\\中正\\题库图\\一点通题库图片20221011.xlsx");
+        File file = new File("G:\\中正\\题库图\\一点通题库图片20230509.xlsx");
         InputStream inputStream = new FileInputStream(file);
         ExcelUtil<Test> util = new ExcelUtil<Test>(Test.class);
         List<Test> testList = util.importExcel(inputStream);
@@ -27,7 +27,8 @@ public class Test03 {
                 int index = t.mediaUrl.lastIndexOf("/");
                 String fileName = t.mediaUrl.substring(index+1);
                 System.out.println(i++);
-                downLoadFromUrl(t.mediaUrl,fileName,"G:\\中正\\题库图\\media20221011");
+                //Threads.sleep(200);
+                downLoadFromUrl(t.mediaUrl,fileName,"G:\\中正\\题库图\\media20230509");
 
             }
 

+ 69 - 0
zzjs-admin/src/test/java/com/miaxis/test/YdtTest.java

@@ -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

+ 1 - 0
zzjs-service/src/main/java/com/miaxis/feign/dto/Ydt.java

@@ -9,4 +9,5 @@ public class Ydt {
 
     private String questionId;
 
+
 }

+ 24 - 6
zzjs-service/src/main/java/com/miaxis/feign/service/IYdtService.java

@@ -2,20 +2,26 @@ package com.miaxis.feign.service;
 
 import com.miaxis.common.config.FeignConfig;
 import com.miaxis.feign.dto.Ydt;
+import feign.Headers;
+import feign.RequestLine;
 import org.springframework.cloud.openfeign.FeignClient;
 import org.springframework.stereotype.Component;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestHeader;
 import org.springframework.web.bind.annotation.RequestParam;
 
-@FeignClient(name="ydtService",
-        url = "https://kaoshiapi.jxedt.com/",configuration = FeignConfig.class)
+import java.util.Map;
+
+@FeignClient(name = "ydtService",
+        url = "https://kaoshiapi.jxedt.com/", configuration = FeignConfig.class)
 @Component
 public interface IYdtService {
 
 
     /**
-     *  获取题目
+     * 获取题目
+     *
      * @param kemu
      * @param cartype
      * @return
@@ -26,15 +32,27 @@ public interface IYdtService {
             @RequestParam("cartype") String cartype);
 
 
-
-
     /**
-     *  获取题目解释
+     * 获取题目解释
+     *
      * @return
      */
     @PostMapping(value = "/sns/exam/getSkillInfo")
     String getSkillInfo(@RequestParam("data") String data);
 
+
+    /**
+     * 获取题目解释2
+     *
+     * @return
+     */
+    @PostMapping(value = "/sns/exam/getQuestionInfo")
+    String getQuestionInfo(@RequestHeader("Cookie") String cookie,
+                           @RequestHeader("hsign") String hsign,
+                           @RequestHeader("User-Agent") String userAgent, @RequestParam("data") String data);
+
+
+
 }