| | |
| | | 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; |
| | |
| | | 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()); |
| | | } |
| | | |
| | | } |