diff --git a/src/main/java/net/mingsoft/cms/action/CategoryAction.java b/src/main/java/net/mingsoft/cms/action/CategoryAction.java index 729253ea..e19633f5 100644 --- a/src/main/java/net/mingsoft/cms/action/CategoryAction.java +++ b/src/main/java/net/mingsoft/cms/action/CategoryAction.java @@ -1,47 +1,29 @@ package net.mingsoft.cms.action; -import java.util.List; -import java.io.File; -import java.util.ArrayList; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson.JSON; -import net.mingsoft.base.entity.ResultData; -import org.apache.commons.lang3.StringUtils; -import org.springframework.validation.BindingResult; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.ui.ModelMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import net.mingsoft.cms.biz.ICategoryBiz; -import net.mingsoft.cms.entity.CategoryEntity; -import net.mingsoft.base.util.JSONObject; -import net.mingsoft.base.entity.BaseEntity; -import net.mingsoft.basic.util.BasicUtil; -import net.mingsoft.basic.util.StringUtil; -import net.mingsoft.base.filter.DateValueFilter; -import net.mingsoft.base.filter.DoubleValueFilter; -import net.mingsoft.basic.bean.EUListBean; -import net.mingsoft.basic.annotation.LogAnn; -import net.mingsoft.basic.constant.e.BusinessTypeEnum; - import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import net.mingsoft.base.entity.BaseEntity; +import net.mingsoft.base.entity.ResultData; +import net.mingsoft.basic.annotation.LogAnn; +import net.mingsoft.basic.bean.EUListBean; +import net.mingsoft.basic.constant.e.BusinessTypeEnum; +import net.mingsoft.basic.util.BasicUtil; +import net.mingsoft.basic.util.StringUtil; +import net.mingsoft.cms.biz.ICategoryBiz; +import net.mingsoft.cms.entity.CategoryEntity; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 分类管理控制层 * @author 铭飞开发团队 diff --git a/src/main/java/net/mingsoft/cms/action/ContentAction.java b/src/main/java/net/mingsoft/cms/action/ContentAction.java index 3d6356a0..ddab9a5c 100644 --- a/src/main/java/net/mingsoft/cms/action/ContentAction.java +++ b/src/main/java/net/mingsoft/cms/action/ContentAction.java @@ -1,36 +1,29 @@ package net.mingsoft.cms.action; -import java.util.List; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import net.mingsoft.base.entity.ResultData; -import org.springframework.validation.BindingResult; -import org.apache.shiro.authz.annotation.RequiresPermissions; -import org.springframework.ui.ModelMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.ModelAttribute; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.RequestBody; - -import net.mingsoft.cms.biz.IContentBiz; -import net.mingsoft.cms.entity.ContentEntity; -import net.mingsoft.base.entity.BaseEntity; -import net.mingsoft.basic.util.BasicUtil; -import net.mingsoft.basic.util.StringUtil; -import net.mingsoft.basic.bean.EUListBean; -import net.mingsoft.basic.annotation.LogAnn; -import net.mingsoft.basic.constant.e.BusinessTypeEnum; - import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiOperation; +import net.mingsoft.base.entity.BaseEntity; +import net.mingsoft.base.entity.ResultData; +import net.mingsoft.basic.annotation.LogAnn; +import net.mingsoft.basic.bean.EUListBean; +import net.mingsoft.basic.constant.e.BusinessTypeEnum; +import net.mingsoft.basic.util.BasicUtil; +import net.mingsoft.basic.util.StringUtil; +import net.mingsoft.cms.biz.IContentBiz; +import net.mingsoft.cms.entity.ContentEntity; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.validation.BindingResult; +import org.springframework.web.bind.annotation.*; import springfox.documentation.annotations.ApiIgnore; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; /** * 文章管理控制层 * @author 铭飞开发团队 diff --git a/src/main/java/net/mingsoft/cms/action/GeneraterAction.java b/src/main/java/net/mingsoft/cms/action/GeneraterAction.java index 19d85752..7f98b209 100644 --- a/src/main/java/net/mingsoft/cms/action/GeneraterAction.java +++ b/src/main/java/net/mingsoft/cms/action/GeneraterAction.java @@ -49,9 +49,7 @@ import org.springframework.web.bind.annotation.ResponseBody; import net.mingsoft.basic.action.BaseAction; import net.mingsoft.basic.biz.IModelBiz; import net.mingsoft.basic.entity.AppEntity; -import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.util.CmsParserUtil; -import net.mingsoft.mdiy.biz.IContentModelBiz; import net.mingsoft.mdiy.biz.IContentModelFieldBiz; import cn.hutool.core.io.FileUtil; diff --git a/src/main/java/net/mingsoft/cms/action/web/CategoryAction.java b/src/main/java/net/mingsoft/cms/action/web/CategoryAction.java index da4cdd90..fe2e781a 100644 --- a/src/main/java/net/mingsoft/cms/action/web/CategoryAction.java +++ b/src/main/java/net/mingsoft/cms/action/web/CategoryAction.java @@ -59,14 +59,6 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ @Autowired private ICategoryBiz categoryBiz; - /** - * 返回主界面index - */ - @GetMapping("/index") - public String index(HttpServletResponse response,HttpServletRequest request){ - return "/cms/category/index"; - } - /** * 查询分类列表 * @param category 分类实体 @@ -106,17 +98,6 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ return ResultData.build().success(new EUListBean(categoryList,(int)BasicUtil.endPage(categoryList).getTotal())); } - /** - * 返回编辑界面category_form - */ - @GetMapping("/form") - public String form(@ModelAttribute CategoryEntity category,HttpServletResponse response,HttpServletRequest request,ModelMap model){ - if(category.getId()!=null){ - BaseEntity categoryEntity = categoryBiz.getEntity(Integer.parseInt(category.getId())); - model.addAttribute("categoryEntity",categoryEntity); - } - return "/cms/category/form"; - } /** * 获取分类 @@ -133,132 +114,5 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ CategoryEntity _category = (CategoryEntity)categoryBiz.getEntity(Integer.parseInt(category.getId())); return ResultData.build().success(_category); } - - @ApiOperation(value = "保存分类列表接口") - @ApiImplicitParams({ - @ApiImplicitParam(name = "categoryTitle", value = "栏目管理名称", required =true,paramType="query"), - @ApiImplicitParam(name = "categoryId", value = "所属栏目", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryType", value = "栏目管理属性", required =false,paramType="query"), - @ApiImplicitParam(name = "categorySort", value = "自定义顺序", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryListUrl", value = "列表模板", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryUrl", value = "内容模板", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryKeyword", value = "栏目管理关键字", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryDescrip", value = "栏目管理描述", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryImg", value = "缩略图", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryDiyUrl", value = "自定义链接", required =false,paramType="query"), - @ApiImplicitParam(name = "mdiyModelId", value = "栏目管理的内容模型id", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryDatetime", value = "类别发布时间", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryManagerId", value = "发布用户id", required =false,paramType="query"), - @ApiImplicitParam(name = "appId", value = "应用编号", required =false,paramType="query"), - @ApiImplicitParam(name = "dictId", value = "字典对应编号", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryFlag", value = "栏目属性", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryPath", value = "栏目路径", required =false,paramType="query"), - @ApiImplicitParam(name = "categoryParentId", value = "父类型编号", required =false,paramType="query"), - @ApiImplicitParam(name = "createBy", value = "创建人", required =false,paramType="query"), - @ApiImplicitParam(name = "createDate", value = "创建时间", required =false,paramType="query"), - @ApiImplicitParam(name = "updateBy", value = "修改人", required =false,paramType="query"), - @ApiImplicitParam(name = "updateDate", value = "修改时间", required =false,paramType="query"), - @ApiImplicitParam(name = "del", value = "删除标记", required =false,paramType="query"), - @ApiImplicitParam(name = "id", value = "编号", required =false,paramType="query"), - }) - /** - * 保存分类 - * @param category 分类实体 - */ - @PostMapping("/save") - @ResponseBody - public ResultData save(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request) { - //验证栏目管理名称的值是否合法 - if(StringUtil.isBlank(category.getCategoryTitle())){ - return ResultData.build().error(getResString("err.empty", this.getResString("category.title"))); - } - if(!StringUtil.checkLength(category.getCategoryTitle()+"", 1, 100)){ - return ResultData.build().error(getResString("err.length", this.getResString("category.title"), "1", "100")); - } - if(!StringUtil.checkLength(category.getCategoryFlag()+"", 1, 100)){ - return ResultData.build().error(getResString("err.length", this.getResString("category.flag"), "1", "100")); - } - if(!StringUtil.checkLength(category.getCategoryPath()+"", 1, 100)){ - return ResultData.build().error(getResString("err.length", this.getResString("category.path"), "1", "100")); - } - if(!StringUtil.checkLength(category.getCategoryParentId()+"", 1, 100)){ - return ResultData.build().error(getResString("err.length", this.getResString("category.parent.id"), "1", "100")); - } - categoryBiz.saveEntity(category); - return ResultData.build().success(category); - } - - /** - * @param category 分类实体 - */ - @ApiOperation(value = "批量删除分类列表接口") - @PostMapping("/delete") - @ResponseBody - public ResultData delete(@RequestBody List categorys,HttpServletResponse response, HttpServletRequest request) { - int[] ids = new int[categorys.size()]; - for(int i = 0;i contents,HttpServletResponse response, HttpServletRequest request) { - int[] ids = new int[contents.size()]; - for(int i = 0;i - * 铭飞科技 - *

- * - *

- * Copyright: Copyright (c) 2014 - 2015 - *

- * - * @author 史爱华 - * - *

- * Comments: 供前端页面获取自定义模型中字段实体信息 - *

- * - *

- * Create Date:2015-07-11 - *

- * - *

- * Modification history: - *

+ * 供前端页面获取自定义模型中字段实体信息 + * @author 铭飞开发团队 + * 创建日期:2019-11-28 15:12:32
+ * 历史修订:
*/ @Controller("webField") @RequestMapping("/field") @@ -98,9 +76,6 @@ public class FieldAction extends BaseAction{ @RequestMapping("/{columId}/getEntity") @ResponseBody public void getEntity(@PathVariable int columId,HttpServletRequest request, HttpServletResponse response) { - System.out.println("111"); - BasicUtil.setSession("xxx", "888"); - System.err.println("session:"+BasicUtil.getSession("xxx")); //获取字段名称 String fieldFieldName = request.getParameter("fieldFieldName"); //根据栏目id获取栏目实体 diff --git a/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java b/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java index 3d87b7b5..62c631dd 100644 --- a/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java +++ b/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java @@ -21,44 +21,38 @@ package net.mingsoft.cms.action.web; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.util.*; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import com.alibaba.fastjson.JSONArray; -import net.mingsoft.base.constant.Const; -import net.mingsoft.basic.util.SpringUtil; -import net.mingsoft.basic.util.StringUtil; -import net.mingsoft.cms.bean.ContentBean; -import net.mingsoft.cms.biz.ICategoryBiz; -import net.mingsoft.cms.biz.IContentBiz; -import net.mingsoft.cms.entity.CategoryEntity; -import net.mingsoft.cms.entity.ContentEntity; -import net.mingsoft.mdiy.biz.IContentModelBiz; -import net.mingsoft.mdiy.biz.IModelBiz; -import net.mingsoft.mdiy.entity.ContentModelEntity; -import net.mingsoft.mdiy.entity.ModelEntity; -import net.mingsoft.mdiy.parser.TagParser; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.*; - import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.PageUtil; import freemarker.core.ParseException; import freemarker.template.MalformedTemplateNameException; import freemarker.template.TemplateNotFoundException; -import net.mingsoft.basic.entity.ColumnEntity; import net.mingsoft.basic.util.BasicUtil; +import net.mingsoft.basic.util.SpringUtil; +import net.mingsoft.cms.bean.ContentBean; +import net.mingsoft.cms.biz.ICategoryBiz; +import net.mingsoft.cms.biz.IContentBiz; +import net.mingsoft.cms.entity.CategoryEntity; +import net.mingsoft.cms.entity.ContentEntity; import net.mingsoft.cms.util.CmsParserUtil; import net.mingsoft.mdiy.bean.PageBean; +import net.mingsoft.mdiy.biz.IContentModelBiz; +import net.mingsoft.mdiy.biz.IModelBiz; import net.mingsoft.mdiy.biz.IPageBiz; +import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.PageEntity; import net.mingsoft.mdiy.util.ParserUtil; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.ExceptionHandler; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.util.*; /** * 动态生成页面,需要后台配置自定义页数据 diff --git a/src/main/java/net/mingsoft/cms/bean/ColumnArticleIdBean.java b/src/main/java/net/mingsoft/cms/bean/ColumnArticleIdBean.java deleted file mode 100644 index e0ba5327..00000000 --- a/src/main/java/net/mingsoft/cms/bean/ColumnArticleIdBean.java +++ /dev/null @@ -1,46 +0,0 @@ -/** -The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) - - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.mingsoft.cms.bean; - -import net.mingsoft.basic.entity.ColumnEntity; -import net.mingsoft.cms.entity.CategoryEntity; - -/** - * 文章解析生成 - * @author 铭飞开源团队 - * @date 2018年12月13日 - */ -public class ColumnArticleIdBean extends CategoryEntity { - /** - * 文章编号 - */ - private int articleId; - - public int getArticleId() { - return articleId; - } - - public void setArticleId(int articleId) { - this.articleId = articleId; - } - -} \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/constant/ModelCode.java b/src/main/java/net/mingsoft/cms/constant/ModelCode.java deleted file mode 100644 index 46353872..00000000 --- a/src/main/java/net/mingsoft/cms/constant/ModelCode.java +++ /dev/null @@ -1,115 +0,0 @@ -/** -The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) - - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.mingsoft.cms.constant; - -import net.mingsoft.base.constant.e.BaseEnum; - -public enum ModelCode implements BaseEnum{ - /** - * 内容:栏目模块编号 - */ - CMS_COLUMN("02990000"), - - /** - * 内容:文章模块编号 - */ - CMS_ARTICLE("02980100"), - /** - * 内容:文章列表 - */ - CMS_ARTICLE_BASIC("02980000"), - /** - * 内容:自定义搜索 - */ - CMS_SEARCH("02050000"), - - /** - * 内容:自定义模型 - */ - CMS_CONTENT_MODEL("02060000"), - - /** - * 内容:一键更新 - */ - CMS_GENERATE_ALL("02070100"), - - /** - * 内容:更新主页 - */ - CMS_GENERATE_INDEX("02070200"), - - /** - * 内容:更新文档 - */ - CMS_GENERATE_ARTICLE("02070300"), - - /** - * 内容: 更新栏目 - */ - CMS_GENERATE_COLUMN("02070400"), - - /** - * 内容:模版 - */ - CMS_TEMPLETSKIN("02080000"), - - - - /** - * 内容:织梦数据导入 - */ - COM_DEDE_DATA_IMPORT("02090100"), - - /** - * 内容:栏目属性管理模块 - */ - CMS_COLUMN_TYPE("02090200"); - /** - * 设置modelCode的常量 - * @param code 常量 - */ - ModelCode(String code) { - this.code = code; - } - - private String code; - - /** - * 返回该modelCode常量的字符串表示 - * @return 字符串 - */ - @Override - public String toString() { - // TODO Auto-generated method stub - return code; - } - - /** - * 返回该modelCode常量的整型表示 - * @return 整型 - */ - public int toInt() { - // TODO Auto-generated method stub - return Integer.parseInt(code); - } - -} \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/constant/e/ColumnTypeEnum.java b/src/main/java/net/mingsoft/cms/constant/e/ColumnTypeEnum.java deleted file mode 100644 index aa763119..00000000 --- a/src/main/java/net/mingsoft/cms/constant/e/ColumnTypeEnum.java +++ /dev/null @@ -1,59 +0,0 @@ -/** -The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) - - * Permission is hereby granted, free of charge, to any person obtaining a copy of - * this software and associated documentation files (the "Software"), to deal in - * the Software without restriction, including without limitation the rights to - * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do so, - * subject to the following conditions: - - * The above copyright notice and this permission notice shall be included in all - * copies or substantial portions of the Software. - - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS - * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR - * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER - * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -package net.mingsoft.cms.constant.e; - -import net.mingsoft.base.constant.e.BaseEnum; - -/** - * - * @ClassName: ColumnTypeEnum - * @Description:TODO(文章栏目分类类型) - * @author: 铭飞开发团队 - * @date: 2018年1月31日 下午2:55:18 - * - * @Copyright: 2018 www.mingsoft.net Inc. All rights reserved. - */ -public enum ColumnTypeEnum implements BaseEnum { - /** - * 列表 - */ - COLUMN_TYPE_LIST(1), - /** - * 单页 - */ - COLUMN_TYPE_COVER(2), - /** - * 跳转地址 - */ - COLUMN_TYPE_URL(3); - ColumnTypeEnum(Object code) { - this.code = code; - } - - private Object code; - @Override - public int toInt() { - // TODO Auto-generated method stub - return Integer.valueOf(code+""); - } - -} \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java b/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java index 608ed55c..8b4f24f3 100644 --- a/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java +++ b/src/main/java/net/mingsoft/cms/util/CmsParserUtil.java @@ -1,13 +1,5 @@ package net.mingsoft.cms.util; -import java.io.File; -import java.io.IOException; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - import cn.hutool.core.io.FileUtil; import cn.hutool.core.util.PageUtil; import freemarker.cache.FileTemplateLoader; @@ -17,25 +9,33 @@ import freemarker.template.Template; import freemarker.template.TemplateException; import freemarker.template.TemplateNotFoundException; import net.mingsoft.base.constant.Const; -import net.mingsoft.basic.entity.ColumnEntity; import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.SpringUtil; -import net.mingsoft.cms.bean.ColumnArticleIdBean; import net.mingsoft.cms.bean.ContentBean; -import net.mingsoft.cms.constant.e.ColumnTypeEnum; import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.mdiy.bean.PageBean; -import net.mingsoft.mdiy.biz.IContentModelBiz; import net.mingsoft.mdiy.biz.IModelBiz; import net.mingsoft.mdiy.biz.impl.ModelBizImpl; -import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.ModelEntity; import net.mingsoft.mdiy.parser.TagParser; import net.mingsoft.mdiy.util.ParserUtil; import org.apache.commons.lang3.StringUtils; +import java.io.File; +import java.io.IOException; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + public class CmsParserUtil extends ParserUtil { + /** + * 封面 + */ + private static int COLUMN_TYPE_COVER = 2; + /** * 指定模板,指定路径进行生成静态页面,会自定识别pc与移动端 * @@ -236,7 +236,7 @@ public class CmsParserUtil extends ParserUtil { // 组合文章路径如:html/站点id/栏目id/文章id.html writePath = ParserUtil.buildHtmlPath(articleColumnPath + File.separator + articleId); //如果是封面就生成index.html - if(Integer.parseInt(articleIdList.get(artId).getCategoryType()) == ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) { + if(Integer.parseInt(articleIdList.get(artId).getCategoryType()) == COLUMN_TYPE_COVER) { writePath = ParserUtil.buildHtmlPath(articleColumnPath + File.separator + ParserUtil.INDEX); } Map parserParams = new HashMap(); @@ -282,7 +282,7 @@ public class CmsParserUtil extends ParserUtil { if (ParserUtil.hasMobileFile(columnUrl)) { writePath = ParserUtil.buildMobileHtmlPath(articleColumnPath + File.separator + articleId); //如果是封面就生成index.html - if(Integer.parseInt(articleIdList.get(artId).getCategoryType()) == ColumnTypeEnum.COLUMN_TYPE_COVER.toInt()) { + if(Integer.parseInt(articleIdList.get(artId).getCategoryType()) == COLUMN_TYPE_COVER) { writePath = ParserUtil.buildMobileHtmlPath(articleColumnPath + File.separator + ParserUtil.INDEX); } // 判断文件是否存在,若不存在弹出返回信息 diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 1e97e243..ebf77c77 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -1,5 +1,5 @@ server: - port: 4027 + port: 8080 servlet.context-path: /ms-mcms servlet.session.timeout: 60M