zhangjinli 3 years ago
parent 8497d9e47f
commit 5b26481f82

@ -8,6 +8,7 @@ import com.zh.project0512.mapper.RankMapper;
import com.zh.project0512.service.ITaskService; import com.zh.project0512.service.ITaskService;
import com.zh.project0512.service.IVideoService; import com.zh.project0512.service.IVideoService;
import com.zh.project0512.utils.FileTypeUtil; import com.zh.project0512.utils.FileTypeUtil;
import com.zh.project0512.utils.RegexUtil;
import com.zh.project0512.utils.result.HttpStatusEnum; import com.zh.project0512.utils.result.HttpStatusEnum;
import com.zh.project0512.utils.result.Result; import com.zh.project0512.utils.result.Result;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
@ -15,6 +16,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import net.coobird.thumbnailator.Thumbnails; import net.coobird.thumbnailator.Thumbnails;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
@ -97,7 +99,7 @@ public class UtilsController {
// if (!dest.getParentFile().exists()) { // if (!dest.getParentFile().exists()) {
// dest.getParentFile().mkdirs(); // dest.getParentFile().mkdirs();
// } // }
// file.transferTo(dest); file.transferTo(dest);
res.put("fileUrl", "/upload/" + newFileName); res.put("fileUrl", "/upload/" + newFileName);
res.put("fileName", fileName); res.put("fileName", fileName);
@ -197,9 +199,9 @@ public class UtilsController {
} }
public static void main(String[] args) { public static void main(String[] args) {
// String url = "9.20 tRK:/ 男人第一天上班就被当成修电脑的,谁知他竟然是总经理%好剧推荐 %全集解说%幸福一家人%关于爱情%宅家dou剧 %持续关注持续精彩 https://v.kuaishou.com/Yh4DwM9/ 复制此链接打开Dou音搜索直接观看视频"; String url = "4.38 wfb:/ 复制打开抖音,看看【酸味真火的作品】坚持总会有收获的# 意想不到的情侣健身 https://v.douyin.com/YT982Sf/";
// Pattern p = Pattern.compile("((https://)+\\S*\\s)", Pattern.CASE_INSENSITIVE); Pattern p = Pattern.compile("((https://)+\\S*(/)\\S*(/))", Pattern.CASE_INSENSITIVE);
// System.out.println(new RegexUtil().httpReg(url));
// Matcher m = p.matcher(url); // Matcher m = p.matcher(url);
// System.out.println(m); // System.out.println(m);
// String a = m.find() ? m.group(1) : url; // String a = m.find() ? m.group(1) : url;
@ -208,45 +210,42 @@ public class UtilsController {
// System.out.println(b); // System.out.println(b);
List<String> list1 = new ArrayList<String>(); // List<String> list1 = new ArrayList<String>();
list1.add("1"); // list1.add("1");
list1.add("2"); // list1.add("2");
list1.add("3"); // list1.add("3");
list1.add("5"); // list1.add("5");
list1.add("6"); // list1.add("6");
List<String> list2 = new ArrayList<String>(); // List<String> list2 = new ArrayList<String>();
list2.add("2"); // list2.add("2");
list2.add("3"); // list2.add("3");
list2.add("7"); // list2.add("7");
list2.add("8"); // list2.add("8");
// 交集 //// 交集
List<String> intersection = list1.stream().filter(item -> list2.contains(item)).collect(Collectors.toList()); // List<String> intersection = list1.stream().filter(item -> list2.contains(item)).collect(Collectors.toList());
System.out.println("---交集 intersection---"); // System.out.println("---交集 intersection---");
intersection.parallelStream().forEach(System.out::println); // intersection.parallelStream().forEach(System.out::println);
// 差集 (list1 - list2) //// 差集 (list1 - list2)
List<String> reduce1 = list1.stream().filter(item -> !list2.contains(item)).collect(Collectors.toList()); // List<String> reduce1 = list1.stream().filter(item -> !list2.contains(item)).collect(Collectors.toList());
System.out.println("---差集 reduce1 (list1 - list2)---"); // System.out.println("---差集 reduce1 (list1 - list2)---");
reduce1.parallelStream().forEach(System.out::println); // reduce1.parallelStream().forEach(System.out::println);
// 差集 (list2 - list1) //// 差集 (list2 - list1)
List<String> reduce2 = list2.stream().filter(item -> !list1.contains(item)).collect(Collectors.toList()); // List<String> reduce2 = list2.stream().filter(item -> !list1.contains(item)).collect(Collectors.toList());
System.out.println("---差集 reduce2 (list2 - list1)---"); // System.out.println("---差集 reduce2 (list2 - list1)---");
reduce2.parallelStream().forEach(System.out::println); // reduce2.parallelStream().forEach(System.out::println);
// 并集 //// 并集
List<String> listAll = list1.parallelStream().collect(Collectors.toList()); // List<String> listAll = list1.parallelStream().collect(Collectors.toList());
List<String> listAll2 = list2.parallelStream().collect(Collectors.toList()); // List<String> listAll2 = list2.parallelStream().collect(Collectors.toList());
listAll.addAll(listAll2); // listAll.addAll(listAll2);
System.out.println("---并集 listAll---"); // System.out.println("---并集 listAll---");
listAll.parallelStream().forEachOrdered(System.out::println); // listAll.parallelStream().forEachOrdered(System.out::println);
// 去重并集 //// 去重并集
List<String> listAllDistinct = listAll.stream().distinct().collect(Collectors.toList()); // List<String> listAllDistinct = listAll.stream().distinct().collect(Collectors.toList());
System.out.println("---得到去重并集 listAllDistinct---"); // System.out.println("---得到去重并集 listAllDistinct---");
listAllDistinct.parallelStream().forEachOrdered(System.out::println); // listAllDistinct.parallelStream().forEachOrdered(System.out::println);
System.out.println("---原来的List1---"); // System.out.println("---原来的List1---");
list1.parallelStream().forEachOrdered(System.out::println); // list1.parallelStream().forEachOrdered(System.out::println);
System.out.println("---原来的List2---"); // System.out.println("---原来的List2---");
list2.parallelStream().forEachOrdered(System.out::println); // list2.parallelStream().forEachOrdered(System.out::println);
}
private class LogUtil {
} }
} }

Loading…
Cancel
Save