|
|
@ -24,10 +24,12 @@ 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;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
|
|
|
|
import org.jsoup.helper.StringUtil;
|
|
|
|
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.data.redis.core.RedisTemplate;
|
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
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;
|
|
|
@ -40,6 +42,8 @@ import java.time.LocalDateTime;
|
|
|
|
import java.time.ZoneOffset;
|
|
|
|
import java.time.ZoneOffset;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
|
import java.util.*;
|
|
|
|
import java.util.*;
|
|
|
|
|
|
|
|
import java.util.regex.Matcher;
|
|
|
|
|
|
|
|
import java.util.regex.Pattern;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* <p>
|
|
|
|
* <p>
|
|
|
@ -161,11 +165,28 @@ public class UtilsController {
|
|
|
|
private IVideoService videoService;
|
|
|
|
private IVideoService videoService;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@PostMapping("/test")
|
|
|
|
@PostMapping("/test")
|
|
|
|
@ResponseBody
|
|
|
|
@ResponseBody
|
|
|
|
public Result test() {
|
|
|
|
public Result test() {
|
|
|
|
return Result.success();
|
|
|
|
String url ="http://www.baidu.com/#wd=%E6%88%91%E6%98%AF%E6%AD%8C%E6%89%8B&rsv_bp=0&tn=baidu&rsv_spt=3&ie=utf-8&rsv_sug3=11&rsv_sug4=643&rsv_sug1=11&inputT=5484&rsv_sug2=0";
|
|
|
|
|
|
|
|
Pattern p = Pattern.compile("(http://|https://)?([^/]*)",Pattern.CASE_INSENSITIVE);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Matcher m = p.matcher(url);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String a= m.find()?m.group(2):url;
|
|
|
|
|
|
|
|
// (https://)+\S*\s
|
|
|
|
|
|
|
|
return Result.success(a);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// public static void main(String[] args) {
|
|
|
|
|
|
|
|
// String url ="9.20 tRK:/ 男人第一天上班就被当成修电脑的,谁知他竟然是总经理%好剧推荐 %全集解说%幸福一家人%关于爱情%宅家dou剧 %持续关注持续精彩 https://v.kuaishou.com/Yh4DwM9/ 复制此链接,打开Dou音搜索,直接观看视频!";
|
|
|
|
|
|
|
|
// Pattern p = Pattern.compile("((https://)+\\S*\\s)",Pattern.CASE_INSENSITIVE);
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Matcher m = p.matcher(url);
|
|
|
|
|
|
|
|
//System.out.println(m);
|
|
|
|
|
|
|
|
// String a= m.find()?m.group(1):url;
|
|
|
|
|
|
|
|
// System.out.println(a);
|
|
|
|
|
|
|
|
// int b = StringUtils.countOccurrencesOf(a,"https://v.douyin");
|
|
|
|
|
|
|
|
// System.out.println(b);
|
|
|
|
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
}
|
|
|
|