From a98077a206242fa3bd013ffeadb5c03caf2132a0 Mon Sep 17 00:00:00 2001 From: zkr_liushenlu Date: Sun, 25 Apr 2021 09:44:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=87=E7=AB=A0=E6=A8=A1=E7=89=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../constants/PropertiesConstants.java | 14 +- .../service/impl/ArticleServiceImpl.java | 4 +- .../freemarker/{create.flt => createedit.flt} | 0 .../static/freemarker/createview.flt | 152 ++++++++++++++++++ 4 files changed, 164 insertions(+), 6 deletions(-) rename ruoyi-content/src/main/resources/static/freemarker/{create.flt => createedit.flt} (100%) create mode 100644 ruoyi-content/src/main/resources/static/freemarker/createview.flt diff --git a/ruoyi-content/src/main/java/com/ruoyi/content/constants/PropertiesConstants.java b/ruoyi-content/src/main/java/com/ruoyi/content/constants/PropertiesConstants.java index 9abf1ddaa..b4155a0df 100644 --- a/ruoyi-content/src/main/java/com/ruoyi/content/constants/PropertiesConstants.java +++ b/ruoyi-content/src/main/java/com/ruoyi/content/constants/PropertiesConstants.java @@ -12,11 +12,17 @@ public class PropertiesConstants { // // public static final String FILE_PATH = "/app/contentMKTCms/webapp/WEB-INF/static/"; // public static final String PROJECT_LOCALPATH = "/app/contentMKTCms/webapp"; - public static final String TEMPLATE_VIEW_PATH = "view.flt"; - public static final String TEMPLATE_EDIT_PATH = "edit.flt"; - public static final String FILE_PATH = "/Users/liushenlu/Desktop/"; - public static final String PROJECT_LOCALPATH = "/Users/liushenlu/Desktop"; + //public static final String FILE_PATH = "/Users/liushenlu/Desktop/"; + //public static final String PROJECT_LOCALPATH = "/Users/liushenlu/Desktop"; + public static final String FILE_PATH = "/app/contentMKTCms/"; + public static final String PROJECT_LOCALPATH = "/app/contentMKTCms"; + + public static final String TEMPLATE_VIEW_PATH = "template/view.flt"; + public static final String TEMPLATE_EDIT_PATH = "template/edit.flt"; + public static final String TEMPLATE_CREATE_EDIT_PATH = "template/createedit.flt"; + public static final String TEMPLATE_CREATE_VIEW_PATH = "template/createview.flt"; + public static final String ONLINE_IMG_PATH = "network/article/"; public static final String OSS_URL = "http://cdn.sinosoftec.com/"; public static final String OSS_URL_HTTPS = "https://cdn.sinosoftec.com/"; diff --git a/ruoyi-content/src/main/java/com/ruoyi/content/service/impl/ArticleServiceImpl.java b/ruoyi-content/src/main/java/com/ruoyi/content/service/impl/ArticleServiceImpl.java index 08a62cef7..7b1fbef6f 100644 --- a/ruoyi-content/src/main/java/com/ruoyi/content/service/impl/ArticleServiceImpl.java +++ b/ruoyi-content/src/main/java/com/ruoyi/content/service/impl/ArticleServiceImpl.java @@ -1256,9 +1256,9 @@ public class ArticleServiceImpl implements ArticleService { // 静态页生成路径 String viewPath = PathUtil.getArticleViewUrl(versionNumber, String.valueOf(articleId)); String createPath = PathUtil.getArticleCreateUrl(versionNumber, articleId + versionNumber.substring(8, 14)); - FreemakerUtil.generateStaticPage(conf, PropertiesConstants.TEMPLATE_VIEW_PATH, + FreemakerUtil.generateStaticPage(conf, PropertiesConstants.TEMPLATE_CREATE_VIEW_PATH, PropertiesConstants.FILE_PATH + viewPath, pageData); - FreemakerUtil.generateStaticPage(conf, PropertiesConstants.TEMPLATE_CREATE_PATH, + FreemakerUtil.generateStaticPage(conf, PropertiesConstants.TEMPLATE_CREATE_EDIT_PATH, PropertiesConstants.FILE_PATH + createPath, pageData); // 把静态页上传到oss OSSUtil.uploadFileHtml(PropertiesConstants.OSSENDPOINT, PropertiesConstants.OSSID, diff --git a/ruoyi-content/src/main/resources/static/freemarker/create.flt b/ruoyi-content/src/main/resources/static/freemarker/createedit.flt similarity index 100% rename from ruoyi-content/src/main/resources/static/freemarker/create.flt rename to ruoyi-content/src/main/resources/static/freemarker/createedit.flt diff --git a/ruoyi-content/src/main/resources/static/freemarker/createview.flt b/ruoyi-content/src/main/resources/static/freemarker/createview.flt new file mode 100644 index 000000000..783a27bd2 --- /dev/null +++ b/ruoyi-content/src/main/resources/static/freemarker/createview.flt @@ -0,0 +1,152 @@ + + + + + + + + 文章编辑 + + + + + + + + + + + <#--分享标题--> + <#--分享图片--> + <#--分享描述--> + <#--文章id--> + <#--广告id--> + <#--公司id--> + <#--发布id--> + <#--是否授权 0未授权 1授权--> + <#--是否预约 0不预约 1预约--> + <#--自定义名称--> + <#--介绍--> +
+ +

文章编辑

+ +
+

点击文章段落,可删除不需要的内容

+
+ + +
+ +
 可编辑区域 
+
+ ${articleInfo.articleContent} +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file