Commit ff9987b9 authored by sgjj's avatar sgjj
Browse files

Merge branch '5.0.0' of https://gitee.com/mingSoft/MCMS into 5.0.0

 Conflicts:
	src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
	src/main/resources/application.yml
parents 3daa94b1 18c092cd
UPDATE cms_content
SET content_img = concat( '[{"path":"', content_img, '"}]' )
WHERE
content_img IS NOT NULL
AND trim( content_img ) != ''
\ No newline at end of file
INSERT INTO cms_content (
cms_content.id,
cms_content.app_id,
cms_content.content_url,
cms_content.content_details,
cms_content.content_keyword,
cms_content.content_description,
cms_content.content_img,
cms_content.content_sort,
cms_content.content_datetime,
cms_content.content_source,
cms_content.content_author,
cms_content.content_display,
cms_content.content_type,
cms_content.content_category_id,
cms_content.content_title,
cms_content.content_hit
)
SELECT
basic.basic_id,
cms_article.article_webid,
cms_article.article_url,
cms_article.article_content,
cms_article.article_keyword,
basic.basic_description,
basic.basic_thumbnails,
basic.basic_sort,
basic.basic_datetime,
cms_article.article_source,
cms_article.article_author,
basic.basic_display,
cms_article.article_type,
basic.basic_categoryid,
basic.basic_title,
basic.basic_hit
FROM
basic
INNER JOIN cms_article ON cms_article.article_basicid = basic.basic_id
INSERT INTO cms_category (
cms_category.id,
cms_category.category_title,
cms_category.category_sort,
cms_category.category_parent_id,
cms_category.category_path,
cms_category.category_flag,
cms_category.dict_id,
cms_category.app_id,
cms_category.category_manager_id,
cms_category.category_datetime,
cms_category.mdiy_model_id,
cms_category.category_diy_url,
cms_category.category_img,
cms_category.category_descrip,
cms_category.category_keyword,
cms_category.category_url,
cms_category.category_list_url,
cms_category.category_type,
cms_category.category_id
) SELECT
category.category_id,
category.category_title,
category.category_sort,
category.category_parent_id,
basic_column.column_path,
basic_column.column_flag,
category.category_dict_id,
category.category_appid,
category.category_managerid,
category.category_datetime,
basic_column.column_cm_id,
basic_column.column_diy_url,
category.category_smallimg,
basic_column.column_descrip,
basic_column.column_keyword,
basic_column.column_url,
basic_column.column_listurl,
basic_column.column_type,
category.category_categoryid
FROM
basic_column
INNER JOIN category ON basic_column.column_category_id = category.category_id
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
UPDATE `model` SET `model_icon` = 'icon-neirongguanli' WHERE `model_id` = 1;
UPDATE `model` SET `model_icon` = 'icon-huiyuanzhongxin' WHERE `model_id` = 22;
UPDATE `model` SET `model_icon` = 'icon-quanxianguanli' WHERE `model_id` = 23;
UPDATE `model` SET `model_icon` = 'icon-xitongguanli' WHERE `model_id` = 84;
UPDATE `model` SET `model_icon` = 'icon-zidingyiguanli' WHERE `model_id` = 104;
UPDATE `mdiy_tag_sql` SET `tag_sql`='<#assign _typeid=\"\"/>\r\n<#if column?? && column.categoryId gt 0>\r\n <#assign _typeid=\"${column.categoryId}\">\r\n</#if>\r\n<#if typeid??>\r\n <#assign _typeid=\"${typeid}\">\r\n</#if>\r\nselect \r\n @rownum := @rownum + 1 AS typeindex,\r\n category_id as id,\r\n category_id as typeid,\r\n category_title as typetitle,\r\n (select count(*) from category c where c.category_categoryid=typeid and c.del=0) as childsize,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--栏目选中的样式-->\r\n IF(<#if column?? && column.categoryId gt 0>${column.categoryId}<#else>${_typeid}</#if> = category_id ,\"${class!\'\'}\",\"\") as class,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\"/${modelName}/list.do?typeid=\", category_id) as typelink,\r\n <#else>\r\n CONCAT(column_path,\"/index.html\") as typelink,\r\n </#if>\r\n column_keyword as typekeyword,\r\n column_diy_url as typeurl,\r\n column_flag as flag,\r\n column_descrip as typedescrip,\r\n category_smallimg as typelitpic \r\n from (SELECT @rownum := 0) r,category \r\n LEFT JOIN basic_column bc on bc.column_category_id=category.category_id where \r\n category.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and category.category_appid=${appId}\r\n </#if>\r\n <#--根据模块编号查询分类-->\r\n <#if column?? && column.categoryModelId?has_content>\r\n and category_modelid=${column.categoryModelId}\r\n </#if>\r\n <#--栏目属性-->\r\n <#if flag?? && flag != \'\'>\r\n and bc.column_flag like CONCAT(\'%\',\'${flag}\',\'%\') \r\n </#if>\r\n <#if noflag?? && noflag != \'\'>\r\n and bc.column_flag not like CONCAT(\'%\',\'${noflag}\',\'%\') \r\n </#if>\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\"top\">\r\n and category_id=(select left(category_parent_id,LOCATE(\",\",category_parent_id)-1) from category where category_id = ${_typeid})\r\n <#elseif type==\"nav\">\r\n and(category_categoryid=0 or category_categoryid is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\"level\">\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=(select category_categoryid from category where category_id=${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目(单个)-->\r\n <#elseif type==\"self\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\"path\">\r\n and \r\n <#if _typeid?has_content>\r\n category_id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},</#if>${_typeid})\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目(多个)-->\r\n <#elseif type==\"son\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\"parent\">\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryCategoryId?? && column.categoryCategoryId!=0>\r\n category_id=${column.categoryCategoryId}\r\n <#else>\r\n category_id=${_typeid}\r\n </#if>\r\n <#else>\r\n 1=1\r\n </#if>\r\n <#--子栏目或同级栏目(多个)-->\r\n <#elseif type==\"sonOrLevel\">\r\n and \r\n <#if _typeid?has_content>\r\n category_categoryid= if((SELECT count(*) FROM category\r\n LEFT JOIN basic_column bc ON bc.column_category_id = category.category_id \r\n WHERE category_categoryid=${_typeid})>0,${_typeid},(select category_categoryid from category where category_id=${_typeid}))\r\n <#else>\r\n 1=1\r\n </#if>\r\n </#if>\r\n<#else> <#--默认son-->\r\n and\r\n <#if _typeid?has_content>\r\n category_categoryid=${_typeid}\r\n <#else>\r\n (category_categoryid=0 or category_categoryid is null)\r\n </#if>\r\n</#if>\r\n<#if order?? >\r\n <#if order==\"desc\"> desc</#if>\r\n <#if order==\"asc\"> asc</#if>\r\n </#if>' WHERE (`id`='6')
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -44,9 +44,14 @@ ...@@ -44,9 +44,14 @@
<dependency> <dependency>
<groupId>net.mingsoft</groupId> <groupId>net.mingsoft</groupId>
<artifactId>ms-mpeople</artifactId> <artifactId>ms-mpeople</artifactId>
<version>1.0.13-SNAPSHOT</version> <version>1.0.13</version>
</dependency> </dependency>
<dependency>
<groupId>net.mingsoft</groupId>
<artifactId>ms-upgrader</artifactId>
<version>1.0.14</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
<finalName>ms-mcms</finalName> <finalName>ms-mcms</finalName>
......
package net.mingsoft.cms.action; 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.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; 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 springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* 分类管理控制层 * 分类管理控制层
* @author 铭飞开发团队 * @author 铭飞开发团队
......
package net.mingsoft.cms.action; 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.Api;
import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams; import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation; 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 springfox.documentation.annotations.ApiIgnore;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/** /**
* 文章管理控制层 * 文章管理控制层
* @author 铭飞开发团队 * @author 铭飞开发团队
......
...@@ -49,9 +49,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -49,9 +49,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import net.mingsoft.basic.action.BaseAction; import net.mingsoft.basic.action.BaseAction;
import net.mingsoft.basic.biz.IModelBiz; import net.mingsoft.basic.biz.IModelBiz;
import net.mingsoft.basic.entity.AppEntity; import net.mingsoft.basic.entity.AppEntity;
import net.mingsoft.cms.bean.ColumnArticleIdBean;
import net.mingsoft.cms.util.CmsParserUtil; import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.biz.IContentModelFieldBiz; import net.mingsoft.mdiy.biz.IContentModelFieldBiz;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
......
...@@ -59,14 +59,6 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ ...@@ -59,14 +59,6 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@Autowired @Autowired
private ICategoryBiz categoryBiz; private ICategoryBiz categoryBiz;
/**
* 返回主界面index
*/
@GetMapping("/index")
public String index(HttpServletResponse response,HttpServletRequest request){
return "/cms/category/index";
}
/** /**
* 查询分类列表 * 查询分类列表
* @param category 分类实体 * @param category 分类实体
...@@ -106,17 +98,6 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{ ...@@ -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())); 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{ ...@@ -133,132 +114,5 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
CategoryEntity _category = (CategoryEntity)categoryBiz.getEntity(Integer.parseInt(category.getId())); CategoryEntity _category = (CategoryEntity)categoryBiz.getEntity(Integer.parseInt(category.getId()));
return ResultData.build().success(_category); 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<CategoryEntity> categorys,HttpServletResponse response, HttpServletRequest request) {
int[] ids = new int[categorys.size()];
for(int i = 0;i<categorys.size();i++){
ids[i] =Integer.parseInt(categorys.get(i).getId()) ;
}
categoryBiz.delete(ids);
return ResultData.build().success();
}
/**
* 更新分类列表
* @param category 分类实体
*/
@ApiOperation(value = "更新分类列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query"),
@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"),
})
@PostMapping("/update")
@ResponseBody
public ResultData update(@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.updateEntity(category);
return ResultData.build().success(category);
}
} }
\ No newline at end of file
...@@ -45,14 +45,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ ...@@ -45,14 +45,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@Autowired @Autowired
private IContentBiz contentBiz; private IContentBiz contentBiz;
/**
* 返回主界面index
*/
@GetMapping("/index")
public String index(HttpServletResponse response,HttpServletRequest request){
return "/cms/content/index";
}
/** /**
* 查询文章列表 * 查询文章列表
* @param content 文章实体 * @param content 文章实体
...@@ -88,17 +80,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ ...@@ -88,17 +80,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
return ResultData.build().success(new EUListBean(contentList,(int)BasicUtil.endPage(contentList).getTotal())); return ResultData.build().success(new EUListBean(contentList,(int)BasicUtil.endPage(contentList).getTotal()));
} }
/**
* 返回编辑界面content_form
*/
@GetMapping("/form")
public String form(@ModelAttribute ContentEntity content,HttpServletResponse response,HttpServletRequest request,ModelMap model){
if(content.getId()!=null){
BaseEntity contentEntity = contentBiz.getEntity(Integer.parseInt(content.getId()));
model.addAttribute("contentEntity",contentEntity);
}
return "/cms/content/form";
}
/** /**
* 获取文章 * 获取文章
...@@ -115,131 +96,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ ...@@ -115,131 +96,6 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
ContentEntity _content = (ContentEntity)contentBiz.getEntity(Integer.parseInt(content.getId())); ContentEntity _content = (ContentEntity)contentBiz.getEntity(Integer.parseInt(content.getId()));
return ResultData.build().success(_content); return ResultData.build().success(_content);
} }
@ApiOperation(value = "保存文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "contentTitle", value = "文章标题", required =true,paramType="query"),
@ApiImplicitParam(name = "contentCategoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "contentType", value = "文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDisplay", value = "是否显示", required =false,paramType="query"),
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =true,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", 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 content 文章实体
*/
@PostMapping("/save")
@ResponseBody
public ResultData save(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response, HttpServletRequest request) {
//验证文章标题的值是否合法
if(StringUtil.isBlank(content.getContentTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));
}
if(!StringUtil.checkLength(content.getContentTitle()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.title"), "0", "200"));
}
if(!StringUtil.checkLength(content.getContentAuthor()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.author"), "0", "200"));
}
if(!StringUtil.checkLength(content.getContentSource()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.source"), "0", "200"));
}
//验证发布时间的值是否合法
if(StringUtil.isBlank(content.getContentDatetime())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
}
if(!StringUtil.checkLength(content.getContentUrl()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.url"), "0", "200"));
}
contentBiz.saveEntity(content);
return ResultData.build().success(content);
}
/**
* @param contents 文章实体
*/
@ApiOperation(value = "批量删除文章列表接口")
@PostMapping("/delete")
@ResponseBody
public ResultData delete(@RequestBody List<ContentEntity> contents,HttpServletResponse response, HttpServletRequest request) {
int[] ids = new int[contents.size()];
for(int i = 0;i<contents.size();i++){
ids[i] =Integer.parseInt(contents.get(i).getId()) ;
}
contentBiz.delete(ids);
return ResultData.build().success();
}
/**
* 更新文章列表
* @param content 文章实体
*/
@ApiOperation(value = "更新文章列表接口")
@ApiImplicitParams({
@ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query"),
@ApiImplicitParam(name = "contentTitle", value = "文章标题", required =true,paramType="query"),
@ApiImplicitParam(name = "contentCategoryId", value = "所属栏目", required =false,paramType="query"),
@ApiImplicitParam(name = "contentType", value = "文章类型", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDisplay", value = "是否显示", required =false,paramType="query"),
@ApiImplicitParam(name = "contentAuthor", value = "文章作者", required =false,paramType="query"),
@ApiImplicitParam(name = "contentSource", value = "文章来源", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDatetime", value = "发布时间", required =true,paramType="query"),
@ApiImplicitParam(name = "contentSort", value = "自定义顺序", required =false,paramType="query"),
@ApiImplicitParam(name = "contentImg", value = "文章缩略图", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDescription", value = "描述", required =false,paramType="query"),
@ApiImplicitParam(name = "contentKeyword", value = "关键字", required =false,paramType="query"),
@ApiImplicitParam(name = "contentDetails", value = "文章内容", required =false,paramType="query"),
@ApiImplicitParam(name = "contentUrl", value = "文章跳转链接地址", required =false,paramType="query"),
@ApiImplicitParam(name = "appid", value = "文章管理的应用id", 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"),
})
@PostMapping("/update")
@ResponseBody
public ResultData update(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response,
HttpServletRequest request) {
//验证文章标题的值是否合法
if(StringUtil.isBlank(content.getContentTitle())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.title")));
}
if(!StringUtil.checkLength(content.getContentTitle()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.title"), "0", "200"));
}
if(!StringUtil.checkLength(content.getContentAuthor()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.author"), "0", "200"));
}
if(!StringUtil.checkLength(content.getContentSource()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.source"), "0", "200"));
}
//验证发布时间的值是否合法
if(StringUtil.isBlank(content.getContentDatetime())){
return ResultData.build().error(getResString("err.empty", this.getResString("content.datetime")));
}
if(!StringUtil.checkLength(content.getContentUrl()+"", 0, 200)){
return ResultData.build().error(getResString("err.length", this.getResString("content.url"), "0", "200"));
}
contentBiz.updateEntity(content);
return ResultData.build().success(content);
}
@ApiOperation(value = "查看文章点击数") @ApiOperation(value = "查看文章点击数")
@ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path") @ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path")
......
...@@ -21,51 +21,29 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net) ...@@ -21,51 +21,29 @@ The MIT License (MIT) * Copyright (c) 2016 铭飞科技(mingsoft.net)
package net.mingsoft.cms.action.web; package net.mingsoft.cms.action.web;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import net.mingsoft.base.action.BaseAction;
import net.mingsoft.basic.biz.IColumnBiz; import net.mingsoft.basic.biz.IColumnBiz;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.mdiy.biz.IContentModelBiz; import net.mingsoft.mdiy.biz.IContentModelBiz;
import net.mingsoft.mdiy.biz.IContentModelFieldBiz; import net.mingsoft.mdiy.biz.IContentModelFieldBiz;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.ContentModelEntity;
import net.mingsoft.mdiy.entity.ContentModelFieldEntity; import net.mingsoft.mdiy.entity.ContentModelFieldEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import net.mingsoft.base.action.BaseAction;
import net.mingsoft.basic.util.BasicUtil;
/** /**
* * 供前端页面获取自定义模型中字段实体信息
* * @author 铭飞开发团队
* * 创建日期:2019-11-28 15:12:32<br/>
* <p> * 历史修订:<br/>
* <b>铭飞科技</b>
* </p>
*
* <p>
* Copyright: Copyright (c) 2014 - 2015
* </p>
*
* @author 史爱华
*
* <p>
* Comments: 供前端页面获取自定义模型中字段实体信息
* </p>
*
* <p>
* Create Date:2015-07-11
* </p>
*
* <p>
* Modification history:
* </p>
*/ */
@Controller("webField") @Controller("webField")
@RequestMapping("/field") @RequestMapping("/field")
...@@ -98,9 +76,6 @@ public class FieldAction extends BaseAction{ ...@@ -98,9 +76,6 @@ public class FieldAction extends BaseAction{
@RequestMapping("/{columId}/getEntity") @RequestMapping("/{columId}/getEntity")
@ResponseBody @ResponseBody
public void getEntity(@PathVariable int columId,HttpServletRequest request, HttpServletResponse response) { 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"); String fieldFieldName = request.getParameter("fieldFieldName");
//根据栏目id获取栏目实体 //根据栏目id获取栏目实体
......
...@@ -21,44 +21,38 @@ ...@@ -21,44 +21,38 @@
package net.mingsoft.cms.action.web; package net.mingsoft.cms.action.web;
import java.io.IOException; import cn.hutool.core.util.ObjectUtil;
import java.io.UnsupportedEncodingException; import cn.hutool.core.util.PageUtil;
import java.util.*; import freemarker.core.ParseException;
import freemarker.template.MalformedTemplateNameException;
import javax.servlet.http.HttpServletRequest; import freemarker.template.TemplateNotFoundException;
import javax.servlet.http.HttpServletResponse; import net.mingsoft.basic.util.BasicUtil;
import com.alibaba.fastjson.JSONArray;
import net.mingsoft.base.constant.Const;
import net.mingsoft.basic.util.SpringUtil; import net.mingsoft.basic.util.SpringUtil;
import net.mingsoft.basic.util.StringUtil;
import net.mingsoft.cms.bean.ContentBean; import net.mingsoft.cms.bean.ContentBean;
import net.mingsoft.cms.biz.ICategoryBiz; import net.mingsoft.cms.biz.ICategoryBiz;
import net.mingsoft.cms.biz.IContentBiz; import net.mingsoft.cms.biz.IContentBiz;
import net.mingsoft.cms.entity.CategoryEntity; import net.mingsoft.cms.entity.CategoryEntity;
import net.mingsoft.cms.entity.ContentEntity; 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.IContentModelBiz;
import net.mingsoft.mdiy.biz.IModelBiz; import net.mingsoft.mdiy.biz.IModelBiz;
import net.mingsoft.mdiy.biz.IPageBiz;
import net.mingsoft.mdiy.entity.ContentModelEntity; import net.mingsoft.mdiy.entity.ContentModelEntity;
import net.mingsoft.mdiy.entity.ModelEntity; import net.mingsoft.mdiy.entity.PageEntity;
import net.mingsoft.mdiy.parser.TagParser; import net.mingsoft.mdiy.util.ParserUtil;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*; 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 cn.hutool.core.util.ObjectUtil; import javax.servlet.http.HttpServletRequest;
import cn.hutool.core.util.PageUtil; import javax.servlet.http.HttpServletResponse;
import freemarker.core.ParseException; import java.io.IOException;
import freemarker.template.MalformedTemplateNameException; import java.util.*;
import freemarker.template.TemplateNotFoundException;
import net.mingsoft.basic.entity.ColumnEntity;
import net.mingsoft.basic.util.BasicUtil;
import net.mingsoft.cms.util.CmsParserUtil;
import net.mingsoft.mdiy.bean.PageBean;
import net.mingsoft.mdiy.biz.IPageBiz;
import net.mingsoft.mdiy.entity.PageEntity;
import net.mingsoft.mdiy.util.ParserUtil;
/** /**
* 动态生成页面,需要后台配置自定义页数据 * 动态生成页面,需要后台配置自定义页数据
......
/**
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
/**
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment