mirror of
https://github.com/qaiu/netdisk-fast-download.git
synced 2025-12-17 21:03:03 +00:00
1. 缓存优化
This commit is contained in:
@@ -19,15 +19,15 @@ public class PanDomainTemplateTest {
|
||||
// 准备测试数据
|
||||
String testShareUrl = "https://test.lanzoux.com/s/someShareKey";
|
||||
|
||||
PanDomainTemplate template = PanDomainTemplate.fromShareUrl(testShareUrl); // 假设使用LZ网盘模板
|
||||
ParserCreate parserCreate = ParserCreate.fromShareUrl(testShareUrl); // 假设使用LZ网盘模板
|
||||
|
||||
// 调用normalizeShareLink方法
|
||||
ShareLinkInfo result = template.getShareLinkInfo();
|
||||
ShareLinkInfo result = parserCreate.getShareLinkInfo();
|
||||
System.out.println(result);
|
||||
// 断言结果是否符合预期
|
||||
assertNotNull("Result should not be null", result);
|
||||
assertEquals("Share key should match", "someShareKey", result.getShareKey());
|
||||
assertEquals("Standard URL should be generated correctly", template.getStandardUrlTemplate().replace("{shareKey}", "someShareKey"), result.getStandardUrl());
|
||||
assertEquals("Standard URL should be generated correctly", parserCreate.getStandardUrlTemplate().replace("{shareKey}", "someShareKey"), result.getStandardUrl());
|
||||
// 可以添加更多的断言来验证其他字段
|
||||
}
|
||||
|
||||
@@ -38,25 +38,25 @@ public class PanDomainTemplateTest {
|
||||
String cowUrl = "https://cowtransfer.com/s/9a644fe3e3a748";
|
||||
String ceUrl = "https://pan.huang1111.cn/s/g31PcQ";
|
||||
String wsUrl = "https://f.ws59.cn/f/f25625rv6p6";
|
||||
PanDomainTemplate.fromShareUrl(wsUrl).createTool()
|
||||
.parse().onSuccess(System.out::println);
|
||||
PanDomainTemplate.fromShareUrl(lzUrl).createTool()
|
||||
.parse().onSuccess(System.out::println);
|
||||
PanDomainTemplate.fromShareUrl(cowUrl).createTool()
|
||||
.parse().onSuccess(System.out::println);
|
||||
PanDomainTemplate.fromShareUrl(lzUrl).createTool()
|
||||
// ParserCreate.fromShareUrl(wsUrl).createTool()
|
||||
// .parse().onSuccess(System.out::println);
|
||||
// ParserCreate.fromShareUrl(lzUrl).createTool()
|
||||
// .parse().onSuccess(System.out::println);
|
||||
// ParserCreate.fromShareUrl(cowUrl).createTool()
|
||||
// .parse().onSuccess(System.out::println);
|
||||
ParserCreate.fromShareUrl(lzUrl).createTool()
|
||||
.parse().onSuccess(System.out::println);
|
||||
|
||||
// PanDomainTemplate.fromShortName("lz").generateShareLink("ihLkw1gezutg")
|
||||
// ParserCreate.fromType("lz").shareKey("ihLkw1gezutg")
|
||||
// .createTool().parse().onSuccess(System.out::println);
|
||||
// PanDomainTemplate.LZ.generateShareLink("ihLkw1gezutg")
|
||||
// ParserCreate.LZ.shareKey("ihLkw1gezutg")
|
||||
// .createTool().parse().onSuccess(System.out::println);
|
||||
|
||||
|
||||
// 调用fromShareUrl方法
|
||||
// PanDomainTemplate resultTemplate = PanDomainTemplate.fromShareUrl(testShareUrl);
|
||||
// PanDomainTemplate resultTemplate = ParserCreate.fromShareUrl(testShareUrl);
|
||||
// System.out.println(resultTemplate.normalizeShareLink(testShareUrl));
|
||||
// System.out.println(resultTemplate.generateShareLink("xxx"));
|
||||
// System.out.println(resultTemplate.shareKey("xxx"));
|
||||
// System.out.println(resultTemplate.createTool("xxx",null).parse()
|
||||
// .onSuccess(System.out::println));
|
||||
// System.out.println(resultTemplate.getDisplayName());
|
||||
@@ -65,7 +65,7 @@ public class PanDomainTemplateTest {
|
||||
//
|
||||
// // 断言结果是否符合预期
|
||||
// assertNotNull("Result should not be null", resultTemplate);
|
||||
// assertEquals("Should return the correct template", PanDomainTemplate.LZ, resultTemplate);
|
||||
// assertEquals("Should return the correct template", ParserCreate.LZ, resultTemplate);
|
||||
// // 可以添加更多的断言来验证正则表达式匹配逻辑
|
||||
// new Scanner(System.in).nextLine();
|
||||
TimeUnit.SECONDS.sleep(5);
|
||||
|
||||
Reference in New Issue
Block a user