拼写更正 Templete to Template
This commit is contained in:
@@ -7,6 +7,7 @@ package com.jeesite.modules.cms.entity;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Serializable;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Objects;
|
||||
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -21,16 +22,16 @@ import com.jeesite.common.lang.ExceptionUtils;
|
||||
* @author 长春叭哥、ThinkGem
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
public class FileTemplete implements Comparable<FileTemplete>, Serializable {
|
||||
public class FileTemplate implements Comparable<FileTemplate>, Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
private Resource resource;
|
||||
private final Resource resource;
|
||||
private String fileName;
|
||||
private String fileExtension;
|
||||
private String filePath;
|
||||
private boolean isDirectory;
|
||||
|
||||
public FileTemplete(Resource resource, String path) {
|
||||
public FileTemplate(Resource resource, String path) {
|
||||
this.resource = resource;
|
||||
this.fileName = resource.getFilename();
|
||||
this.fileExtension = FileUtils.getFileExtension(this.fileName);
|
||||
@@ -41,22 +42,22 @@ public class FileTemplete implements Comparable<FileTemplete>, Serializable {
|
||||
beginIndex = filePath.indexOf(path);
|
||||
}
|
||||
int endIndex = filePath.length();
|
||||
if (this.fileName.contains(".")){
|
||||
if (this.fileName != null && this.fileName.contains(".")) {
|
||||
endIndex = filePath.lastIndexOf('/');
|
||||
}else if (filePath.endsWith("/")) {
|
||||
endIndex -= 1;
|
||||
}
|
||||
}
|
||||
this.filePath = filePath.substring(beginIndex, endIndex);
|
||||
// System.out.println(this.filePath);
|
||||
} catch (IOException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
this.isDirectory = !this.fileName.contains(".");
|
||||
if (this.fileName != null) {
|
||||
this.isDirectory = !this.fileName.contains(".");
|
||||
}
|
||||
// System.out.println(filePath);
|
||||
// System.out.println(fileName);
|
||||
}
|
||||
|
||||
public FileTemplete(FileTemplete source) {
|
||||
public FileTemplate(FileTemplate source) {
|
||||
int index = source.filePath.lastIndexOf('/');
|
||||
this.fileName = source.filePath.substring(index+1);
|
||||
this.filePath = source.filePath.substring(0, index);
|
||||
@@ -109,14 +110,14 @@ public class FileTemplete implements Comparable<FileTemplete>, Serializable {
|
||||
return null;
|
||||
}
|
||||
try(InputStream is = resource.getInputStream()){
|
||||
return IOUtils.toString(is, EncodeUtils.UTF_8);
|
||||
return IOUtils.toString(is, StandardCharsets.UTF_8);
|
||||
}catch (IOException e) {
|
||||
throw ExceptionUtils.unchecked(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(FileTemplete o) {
|
||||
public int compareTo(FileTemplate o) {
|
||||
return this.getFileName().compareTo(o.getFileName());
|
||||
}
|
||||
|
||||
@@ -128,7 +129,7 @@ public class FileTemplete implements Comparable<FileTemplete>, Serializable {
|
||||
if (o == null || getClass() != o.getClass()) {
|
||||
return false;
|
||||
}
|
||||
FileTemplete e = (FileTemplete) o;
|
||||
FileTemplate e = (FileTemplate) o;
|
||||
return Objects.equals(this.fileName, e.fileName)
|
||||
&& Objects.equals(this.fileExtension, e.fileExtension)
|
||||
&& Objects.equals(this.filePath, e.filePath)
|
||||
@@ -16,6 +16,7 @@ import com.jeesite.modules.sys.utils.UserUtils;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -47,7 +48,7 @@ public class Site extends DataEntity<Site> {
|
||||
/**
|
||||
* 模板路径
|
||||
*/
|
||||
public static final String TEMPLETE_BASE_DIRECTION = "views/modules/cmsfront/themes";
|
||||
public static final String TEMPLATE_BASE_DIRECTION = "views/modules/cmsfront/themes";
|
||||
/**
|
||||
* 默认模版
|
||||
*/
|
||||
@@ -189,7 +190,7 @@ public class Site extends DataEntity<Site> {
|
||||
* @return
|
||||
*/
|
||||
public String getSolutionPath() {
|
||||
return TEMPLETE_BASE_DIRECTION + "/" + getTheme();
|
||||
return TEMPLATE_BASE_DIRECTION + "/" + getTheme();
|
||||
}
|
||||
|
||||
public List<String> getCategoryCodes() {
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.modules.cms.entity.FileTemplate;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.cms.utils.FileTemplateUtils;
|
||||
import com.jeesite.modules.sys.entity.DictData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模版文件Service
|
||||
* @author 长春叭哥、ThinkGem
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
@Service
|
||||
public class FileTemplateService {
|
||||
|
||||
/**
|
||||
* 获取对应视图模板列表,兼容 Select 字典
|
||||
* @param prefix
|
||||
*/
|
||||
public List<DictData> getTemplateContentDict(String prefix) throws IOException {
|
||||
List<DictData> listSite = ListUtils.newArrayList();
|
||||
String solutionPath = CmsUtils.getSite(Site.getCurrentSiteCode()).getSolutionPath();
|
||||
List<FileTemplate> tplList = FileTemplateUtils.getFileTemplateListByPath(solutionPath);
|
||||
for (FileTemplate tpl : tplList) {
|
||||
if (tpl.getFileName().startsWith(prefix)) {
|
||||
listSite.add(new DictData(tpl.getFileName()
|
||||
.substring(0, tpl.getFileName().indexOf("."))));
|
||||
}
|
||||
}
|
||||
return listSite;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取编辑文件列表
|
||||
* @param path 模板路径
|
||||
*/
|
||||
public List<FileTemplate> getFileTemplateListForEdit(String path) throws IOException {
|
||||
return FileTemplateUtils.getFileTemplateListForEdit(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模版文件内容
|
||||
* @param fileName 模板文件
|
||||
*/
|
||||
public FileTemplate getFileTemplate(String fileName) throws IOException {
|
||||
return FileTemplateUtils.getFileTemplateByResource(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2013-Now http://jeesite.com All rights reserved.
|
||||
* No deletion without permission, or be held responsible to law.
|
||||
*/
|
||||
package com.jeesite.modules.cms.service;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.modules.cms.entity.FileTemplete;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.cms.utils.FileTempleteUtils;
|
||||
import com.jeesite.modules.sys.entity.DictData;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 模版文件Service
|
||||
* @author 长春叭哥、ThinkGem
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
@Service
|
||||
public class FileTempleteService {
|
||||
|
||||
// public List<String> getTempleteContent(String prefix) throws IOException {
|
||||
// List<String> tplList = getFileTempleteNameListByPrefix(CmsUtils.getSite(Site.getCurrentSiteCode()).getSolutionPath());
|
||||
// tplList = FilesTempleteUtils.templeteTrim(tplList, prefix, "");
|
||||
// return tplList;
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取对应视图模板列表,兼容 Select 字典
|
||||
* @param prefix
|
||||
*/
|
||||
public List<DictData> getTempleteContentDict(String prefix) throws IOException {
|
||||
List<DictData> listSite = ListUtils.newArrayList();
|
||||
String solutionPath = CmsUtils.getSite(Site.getCurrentSiteCode()).getSolutionPath();
|
||||
List<FileTemplete> tplList = FileTempleteUtils.getFileTempleteListByPath(solutionPath);
|
||||
for (FileTemplete tpl : tplList) {
|
||||
if (tpl.getFileName().startsWith(prefix)) {
|
||||
listSite.add(new DictData(tpl.getFileName()
|
||||
.substring(0, tpl.getFileName().indexOf("."))));
|
||||
}
|
||||
}
|
||||
return listSite;
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 通过前缀获取文件名集合
|
||||
// * @param filePath
|
||||
// * @return List<String> 文件名集合
|
||||
// * @author 长春叭哥
|
||||
// * @throws IOException
|
||||
// */
|
||||
// public List<String> getFileTempleteNameListByPrefix(String filePath) throws IOException {
|
||||
// return FilesTempleteUtils.getFileTempleteNameListByPrefix(filePath);
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * 获取模版文件列表
|
||||
// * @param path 路径
|
||||
// * @param directory
|
||||
// * @return List<FileTemplete> 模版文件集合
|
||||
// * @author 长春叭哥
|
||||
// * @throws IOException
|
||||
// */
|
||||
// public List<FileTemplete> getFileTempleteListByPath(String path, boolean directory) throws IOException {
|
||||
// return FilesTempleteUtils.getFileTempleteListByPath(path, directory);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取编辑文件列表
|
||||
* @param path 模板路径
|
||||
*/
|
||||
public List<FileTemplete> getFileTempleteListForEdit(String path) throws IOException {
|
||||
return FileTempleteUtils.getFileTempleteListForEdit(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模版文件内容
|
||||
* @param fileName 模板文件
|
||||
*/
|
||||
public FileTemplete getFileTemplete(String fileName) throws IOException {
|
||||
return FileTempleteUtils.getFileTempleteByResource(fileName);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,7 +8,7 @@ import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.SetUtils;
|
||||
import com.jeesite.common.io.ResourceUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.modules.cms.entity.FileTemplete;
|
||||
import com.jeesite.modules.cms.entity.FileTemplate;
|
||||
import org.springframework.core.io.Resource;
|
||||
|
||||
import java.io.IOException;
|
||||
@@ -20,30 +20,30 @@ import java.util.Set;
|
||||
* @author 长春叭哥、ThinkGem
|
||||
* @version 2020-7-7
|
||||
*/
|
||||
public class FileTempleteUtils {
|
||||
public class FileTemplateUtils {
|
||||
|
||||
/**
|
||||
* 获取模版文件
|
||||
* @param fileName
|
||||
*/
|
||||
public static FileTemplete getFileTempleteByResource(String fileName) {
|
||||
public static FileTemplate getFileTemplateByResource(String fileName) {
|
||||
if (!StringUtils.startsWith(fileName, "views/modules/cmsfront")) {
|
||||
fileName = "views/modules/cmsfront/themes/default/index.html";
|
||||
}
|
||||
Resource resource = ResourceUtils.getResource(fileName);
|
||||
return new FileTemplete(resource, fileName);
|
||||
return new FileTemplate(resource, fileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取模板文件集合
|
||||
* @param path 前缀路径
|
||||
*/
|
||||
public static List<FileTemplete> getFileTempleteListByPath(String path) throws IOException {
|
||||
List<FileTemplete> list = ListUtils.newArrayList();
|
||||
public static List<FileTemplate> getFileTemplateListByPath(String path) throws IOException {
|
||||
List<FileTemplate> list = ListUtils.newArrayList();
|
||||
Resource[] resources = ResourceUtils.getResources("classpath*:" + path + "/**/*.html");
|
||||
for (Resource resource : resources) {
|
||||
if (resource.exists()) {
|
||||
list.add(new FileTemplete(resource, path));
|
||||
list.add(new FileTemplate(resource, path));
|
||||
}
|
||||
}
|
||||
return list;
|
||||
@@ -53,14 +53,14 @@ public class FileTempleteUtils {
|
||||
* 获取模板文件相关属性(含目录)
|
||||
* @param path 前缀路径
|
||||
*/
|
||||
public static List<FileTemplete> getFileTempleteListForEdit(String path) throws IOException {
|
||||
public static List<FileTemplate> getFileTemplateListForEdit(String path) throws IOException {
|
||||
|
||||
List<FileTemplete> list = getFileTempleteListByPath(path);
|
||||
Set<FileTemplete> set = SetUtils.newLinkedHashSet();
|
||||
List<FileTemplate> list = getFileTemplateListByPath(path);
|
||||
Set<FileTemplate> set = SetUtils.newLinkedHashSet();
|
||||
|
||||
// 获取目录
|
||||
list.forEach(e -> {
|
||||
set.add(new FileTemplete(e));
|
||||
set.add(new FileTemplate(e));
|
||||
});
|
||||
set.addAll(list);
|
||||
|
||||
@@ -14,7 +14,7 @@ import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.ArticleService;
|
||||
import com.jeesite.modules.cms.service.CategoryService;
|
||||
import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
import com.jeesite.modules.cms.service.FileTemplateService;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
@@ -46,7 +46,7 @@ public class ArticleController extends BaseController {
|
||||
@Autowired
|
||||
private CategoryService categoryService;
|
||||
@Autowired
|
||||
private FileTempleteService fileTempleteService;
|
||||
private FileTemplateService fileTemplateService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -135,7 +135,7 @@ public class ArticleController extends BaseController {
|
||||
if (StringUtils.isBlank(article.getId())) {
|
||||
article.setStatus(Article.STATUS_DRAFT);
|
||||
}
|
||||
model.addAttribute("contentViewList", fileTempleteService.getTempleteContentDict(Article.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("contentViewList", fileTemplateService.getTemplateContentDict(Article.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("article_DEFAULT_TEMPLATE", Article.DEFAULT_TEMPLATE);
|
||||
model.addAttribute("article", article);
|
||||
CmsUtils.addViewConfigAttribute(model, article.getCategory());
|
||||
|
||||
@@ -14,9 +14,10 @@ import com.jeesite.modules.cms.entity.Article;
|
||||
import com.jeesite.modules.cms.entity.Category;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.CategoryService;
|
||||
import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
import com.jeesite.modules.cms.service.FileTemplateService;
|
||||
import com.jeesite.modules.cms.utils.CmsUtils;
|
||||
import com.jeesite.modules.sys.utils.DictUtils;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import org.apache.shiro.authz.annotation.Logical;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -28,7 +29,6 @@ import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
@@ -46,7 +46,7 @@ public class CategoryController extends BaseController {
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Autowired
|
||||
private FileTempleteService fileTempleteService;
|
||||
private FileTemplateService fileTemplateService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -157,9 +157,9 @@ public class CategoryController extends BaseController {
|
||||
if (category.getIsNeedAudit() == null) {
|
||||
category.setIsNeedAudit(Global.NO);
|
||||
}
|
||||
model.addAttribute("listViewList", fileTempleteService.getTempleteContentDict(Category.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("listViewList", fileTemplateService.getTemplateContentDict(Category.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("category_DEFAULT_TEMPLATE", Category.DEFAULT_TEMPLATE);
|
||||
model.addAttribute("contentViewList", fileTempleteService.getTempleteContentDict(Article.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("contentViewList", fileTemplateService.getTemplateContentDict(Article.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("article_DEFAULT_TEMPLATE", Article.DEFAULT_TEMPLATE);
|
||||
model.addAttribute("category", category);
|
||||
return "modules/cms/categoryForm";
|
||||
|
||||
@@ -4,20 +4,12 @@
|
||||
*/
|
||||
package com.jeesite.modules.cms.web;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.jeesite.common.codec.EncodeUtils;
|
||||
import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.io.FileUtils;
|
||||
import com.jeesite.common.io.ResourceUtils;
|
||||
import com.jeesite.common.lang.DateUtils;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.modules.gen.entity.GenTable;
|
||||
import com.jeesite.modules.gen.utils.GenTableUtils;
|
||||
import com.jeesite.modules.gen.utils.GenUtils;
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.cms.entity.FileTemplate;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.FileTemplateService;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Controller;
|
||||
@@ -25,12 +17,9 @@ import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
|
||||
import com.jeesite.common.collect.ListUtils;
|
||||
import com.jeesite.common.collect.MapUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.modules.cms.entity.FileTemplete;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 模板管理
|
||||
@@ -42,7 +31,7 @@ import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
public class FileTemplateController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private FileTempleteService fileTempleteService;
|
||||
private FileTemplateService fileTemplateService;
|
||||
|
||||
@RequiresPermissions("cms:template:edit")
|
||||
@RequestMapping(value = { "list", "" })
|
||||
@@ -50,19 +39,10 @@ public class FileTemplateController extends BaseController {
|
||||
return "modules/cms/tplIndex";
|
||||
}
|
||||
|
||||
// @RequiresPermissions("cms:template:edit")
|
||||
// @RequestMapping(value = "tree")
|
||||
// public String tree(Model model) throws IOException {
|
||||
// //根据系统默认的主题获取模板地址
|
||||
// model.addAttribute("templateList", fileTempleteService
|
||||
// .getFileTempleteListForEdit(Site.TEMPLETE_BASE_DIRECTION + "/" + "default"));
|
||||
// return "modules/cms/tplTree";
|
||||
// }
|
||||
|
||||
@RequiresPermissions("cms:template:edit")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(String name, Model model) throws IOException {
|
||||
model.addAttribute("template", fileTempleteService.getFileTemplete(name));
|
||||
model.addAttribute("template", fileTemplateService.getFileTemplate(name));
|
||||
return "modules/cms/tplForm";
|
||||
}
|
||||
|
||||
@@ -70,7 +50,7 @@ public class FileTemplateController extends BaseController {
|
||||
@RequestMapping(value = "saveFileTemplate")
|
||||
@ResponseBody
|
||||
public String saveFileTemplate(String fileName, String fileContent) throws IOException {
|
||||
FileTemplete template = fileTempleteService.getFileTemplete(fileName);
|
||||
FileTemplate template = fileTemplateService.getFileTemplate(fileName);
|
||||
String newFileName = FileUtils.path(FileUtils.getWebappPath() + "/WEB-INF/classes/" + fileName);
|
||||
File templateFile = template.resource().getFile();
|
||||
if (templateFile.getAbsoluteFile().exists()) {
|
||||
@@ -86,7 +66,7 @@ public class FileTemplateController extends BaseController {
|
||||
@RequestMapping(value = "deleteFileTemplate")
|
||||
@ResponseBody
|
||||
public String deleteFileTemplate(String fileName) throws IOException {
|
||||
FileTemplete template = fileTempleteService.getFileTemplete(fileName);
|
||||
FileTemplate template = fileTemplateService.getFileTemplate(fileName);
|
||||
File templateFile = template.resource().getFile();
|
||||
if (templateFile.getAbsoluteFile().exists()) {
|
||||
FileUtils.deleteFile(templateFile.getAbsolutePath());
|
||||
@@ -109,9 +89,9 @@ public class FileTemplateController extends BaseController {
|
||||
@ResponseBody
|
||||
public List<Map<String, Object>> treeData() throws IOException {
|
||||
List<Map<String, Object>> mapList = ListUtils.newArrayList();
|
||||
List<FileTemplete> listFileTemplete = fileTempleteService.getFileTempleteListForEdit(Site.TEMPLETE_BASE_DIRECTION);
|
||||
for (int i = 0; i < listFileTemplete.size(); i++) {
|
||||
FileTemplete e = listFileTemplete.get(i);
|
||||
List<FileTemplate> listFileTemplate = fileTemplateService.getFileTemplateListForEdit(Site.TEMPLATE_BASE_DIRECTION);
|
||||
for (int i = 0; i < listFileTemplate.size(); i++) {
|
||||
FileTemplate e = listFileTemplate.get(i);
|
||||
Map<String, Object> map = MapUtils.newHashMap();
|
||||
map.put("id", e.getFilePath() + "/" + e.getFileName());
|
||||
map.put("isDirectory", e.isDirectory());
|
||||
|
||||
@@ -8,11 +8,9 @@ import com.jeesite.common.config.Global;
|
||||
import com.jeesite.common.entity.Page;
|
||||
import com.jeesite.common.lang.StringUtils;
|
||||
import com.jeesite.common.web.BaseController;
|
||||
import com.jeesite.common.web.CookieUtils;
|
||||
import com.jeesite.modules.cms.entity.Site;
|
||||
import com.jeesite.modules.cms.service.FileTempleteService;
|
||||
import com.jeesite.modules.cms.service.FileTemplateService;
|
||||
import com.jeesite.modules.cms.service.SiteService;
|
||||
import com.jeesite.modules.sys.utils.CorpUtils;
|
||||
import com.jeesite.modules.sys.utils.UserUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -41,7 +39,7 @@ public class SiteController extends BaseController {
|
||||
private SiteService siteService;
|
||||
|
||||
@Autowired
|
||||
private FileTempleteService fileTempleteService;
|
||||
private FileTemplateService fileTemplateService;
|
||||
|
||||
/**
|
||||
* 获取数据
|
||||
@@ -81,7 +79,7 @@ public class SiteController extends BaseController {
|
||||
@RequiresPermissions("cms:site:view")
|
||||
@RequestMapping(value = "form")
|
||||
public String form(Site site, Model model) throws IOException {
|
||||
model.addAttribute("indexViewList", fileTempleteService.getTempleteContentDict(Site.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("indexViewList", fileTemplateService.getTemplateContentDict(Site.DEFAULT_TEMPLATE));
|
||||
model.addAttribute("site_DEFAULT_TEMPLATE", Site.DEFAULT_TEMPLATE);
|
||||
model.addAttribute("site", site);
|
||||
model.addAttribute("demos", site);
|
||||
|
||||
Reference in New Issue
Block a user