|
@@ -3,6 +3,7 @@ package com.miaxis.test;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.miaxis.ZzjsApplication;
|
|
|
+import com.miaxis.common.utils.StringUtils;
|
|
|
import com.miaxis.feign.dto.Ydt;
|
|
|
import com.miaxis.feign.service.IYdtService;
|
|
|
import com.miaxis.question.domain.QuestionInfoGet;
|
|
@@ -263,8 +264,56 @@ public class YdtTest {
|
|
|
|
|
|
|
|
|
@Test
|
|
|
- public void getShortVideo() throws IOException {
|
|
|
+ public void getVoice() throws IOException {
|
|
|
+
|
|
|
+ List<WebNoteAll> list = webNoteAllService.selectWebNoteAllList(null);
|
|
|
+ System.out.println(list.size());
|
|
|
+ for (int i = 0; i < list.size(); i++) {
|
|
|
+ WebNoteAll webNoteAll = list.get(i);
|
|
|
+ if(!StringUtils.isEmpty(webNoteAll.getMediaUrl())) {
|
|
|
+ String savePath = "G:\\中正\\题库\\20230809\\media";
|
|
|
+ int index = webNoteAll.getMediaUrl().lastIndexOf("/");
|
|
|
+ int index2 = webNoteAll.getMediaUrl().lastIndexOf(".");
|
|
|
+ String lastName = webNoteAll.getMediaUrl().substring(index2);
|
|
|
+ String fileName = webNoteAll.getMediaUrl().substring(index+1,index2);
|
|
|
+ System.out.println(lastName);
|
|
|
+ System.out.println(fileName);
|
|
|
+ System.out.println(fileName+lastName);
|
|
|
+ String allName = fileName+lastName;
|
|
|
+ downLoadFromUrl(webNoteAll.getMediaUrl(),allName,savePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!StringUtils.isEmpty(webNoteAll.getQuestionAudio())) {
|
|
|
+ String savePath = "G:\\中正\\题库\\20230809\\question_audio";
|
|
|
+ int index = webNoteAll.getQuestionAudio().lastIndexOf("/");
|
|
|
+ int index2 = webNoteAll.getQuestionAudio().lastIndexOf(".");
|
|
|
+ String lastName = webNoteAll.getQuestionAudio().substring(index2);
|
|
|
+ String fileName = webNoteAll.getQuestionAudio().substring(index+1,index2);
|
|
|
+ System.out.println(lastName);
|
|
|
+ System.out.println(fileName);
|
|
|
+ System.out.println(fileName+lastName);
|
|
|
+ String allName = fileName+lastName;
|
|
|
+ downLoadFromUrl(webNoteAll.getQuestionAudio(),allName,savePath);
|
|
|
+ }
|
|
|
|
|
|
+ if(!StringUtils.isEmpty(webNoteAll.getAnswerAudio())) {
|
|
|
+ String savePath = "G:\\中正\\题库\\20230809\\answer_audio";
|
|
|
+ int index = webNoteAll.getAnswerAudio().lastIndexOf("/");
|
|
|
+ int index2 = webNoteAll.getAnswerAudio().lastIndexOf(".");
|
|
|
+ String lastName = webNoteAll.getAnswerAudio().substring(index2);
|
|
|
+ String fileName = webNoteAll.getAnswerAudio().substring(index+1,index2);
|
|
|
+ System.out.println(lastName);
|
|
|
+ System.out.println(fileName);
|
|
|
+ System.out.println(fileName+lastName);
|
|
|
+ String allName = fileName+lastName;
|
|
|
+ downLoadFromUrl(webNoteAll.getAnswerAudio(),allName,savePath);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ @Test
|
|
|
+ public void getShortVideo() throws IOException {
|
|
|
String savePath = "G:\\中正\\一点通\\题库短视频";
|
|
|
List<QuestionYdtJs> list = questionYdtJsService.selectQuestionYdtJsList2(null);
|
|
|
|
|
@@ -280,9 +329,9 @@ public class YdtTest {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
+
|
|
|
public static void downLoadFromUrl(String urlStr, String fileName, String savePath) throws IOException {
|
|
|
URL url = new URL(urlStr);
|
|
|
HttpURLConnection conn = (HttpURLConnection) url.openConnection();
|