From 6a07f220e8f855740eee9b9dcae75464d6266380 Mon Sep 17 00:00:00 2001
From: wzy <wzy19931122ai@163.com>
Date: Thu, 20 Oct 2022 22:53:10 +0800
Subject: [PATCH] 修复分页死循环
---
src/test/java/com/xcong/farmer/cms/TemplateTest.java | 45 +++++++++++++++++++++++++++++++++++++--------
1 files changed, 37 insertions(+), 8 deletions(-)
diff --git a/src/test/java/com/xcong/farmer/cms/TemplateTest.java b/src/test/java/com/xcong/farmer/cms/TemplateTest.java
index f072ef2..0452d5b 100644
--- a/src/test/java/com/xcong/farmer/cms/TemplateTest.java
+++ b/src/test/java/com/xcong/farmer/cms/TemplateTest.java
@@ -2,16 +2,21 @@
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.StrUtil;
+import com.xcong.farmer.cms.modules.core.service.ICmsCoreService;
+import com.xcong.farmer.cms.modules.system.service.IReleaseService;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.junit.jupiter.api.Test;
+import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
/**
* @author wzy
@@ -24,16 +29,19 @@
@Test
public void staticFileTest() throws IOException {
- File file = new File("/Users/helius/Desktop/template-online/index-test.html");
+ // /Users/helius/Desktop/template-online/template/ahrnfy/test.html
+ // /Users/helius/Desktop/template-online/template/ahrnfy/test.html
+ File file = new File("/Users/helius/Desktop/template-online/template/ahrnfy/test.html");
Document parse = Jsoup.parse(file, "utf-8");
- staticPathParser(parse, "img", "src");
- staticPathParser(parse, "href", "link");
- staticPathParser(parse, "script", "src");
-
- FileOutputStream outputStream = new FileOutputStream(file);
- outputStream.write(parse.html().getBytes());
- outputStream.close();
+ System.out.println(111);
+// staticPathParser(parse, "img", "src");
+// staticPathParser(parse, "href", "link");
+// staticPathParser(parse, "script", "src");
+//
+// FileOutputStream outputStream = new FileOutputStream(file);
+// outputStream.write(parse.html().getBytes());
+// outputStream.close();
}
public void staticPathParser(Document document, String tagName, String attrKey) {
@@ -49,4 +57,25 @@
}
}
}
+
+ @Autowired
+ private IReleaseService releaseService;
+
+ @Test
+ public void columnTest() {
+ releaseService.releaseColumn(135L, 1, 26L);
+ }
+
+
+ @Autowired
+ private ICmsCoreService cmsCoreService;
+
+ @Test
+ public void parserTest() {
+ Map<String, Object> map = new HashMap<>();
+ map.put("companyId", 24L);
+ map.put("id", 81L);
+ map.put("templateType", "article");
+ cmsCoreService.columnProcess(map, "test.html");
+ }
}
--
Gitblit v1.9.1