From bc43681f185af1edf833cf6c94833cb1cdd44a8e Mon Sep 17 00:00:00 2001
From: xiaoyong931011 <15274802129@163.com>
Date: Thu, 07 Jul 2022 17:42:18 +0800
Subject: [PATCH] 20220606
---
src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java | 30 ++++++++++++++++++++++++++++++
1 files changed, 30 insertions(+), 0 deletions(-)
diff --git a/src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java b/src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java
index 87f25ee..efa9df4 100644
--- a/src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java
+++ b/src/test/java/com/xcong/farmer/cms/KssframeworkApplicationTests.java
@@ -2,9 +2,12 @@
import cn.hutool.core.util.ObjectUtil;
import com.xcong.farmer.cms.common.response.Result;
+import com.xcong.farmer.cms.common.utils.FileUtils;
import com.xcong.farmer.cms.configurations.properties.CmsProperties;
+import com.xcong.farmer.cms.modules.system.dto.WebArticleInPageDto;
import com.xcong.farmer.cms.modules.system.entity.CmsTemplateEntity;
import com.xcong.farmer.cms.modules.system.mapper.CmsTemplateMapper;
+import com.xcong.farmer.cms.modules.system.util.LoginUserUtil;
import com.xcong.farmer.cms.modules.test.dao.TestUserDao;
import com.xcong.farmer.cms.modules.test.entity.TestUserEntity;
import org.jsoup.Jsoup;
@@ -80,4 +83,31 @@
System.out.println(content);
}
+ @Test
+ public void path(){
+ Long id = 6L;
+ CmsTemplateEntity cmsTemplateEntity = cmsTemplateMapper.selectById(id);
+ String templatePath = cmsProperties.getTemplatePath();
+ String pathName = FileUtils.path(templatePath, cmsTemplateEntity.getPath());
+ System.out.println(templatePath);
+ System.out.println(pathName);
+ byte[] bytes = new byte[0];
+ try {
+ bytes = Files.readAllBytes(Paths.get(pathName));
+ } catch (IOException e) {
+ e.printStackTrace();
+ System.out.println("未找到模板");
+ }
+
+ String content = new String(bytes, StandardCharsets.UTF_8);
+ System.out.println(content);
+ }
+
+ @Test
+ public void dateTest(){
+ WebArticleInPageDto webArticleInPageDto = new WebArticleInPageDto();
+ webArticleInPageDto.setTimeType("一周内");
+ System.out.println(webArticleInPageDto.getTimeType());
+ }
+
}
--
Gitblit v1.9.1