diff --git a/doc/5.2-patch.sql b/doc/5.2-patch.sql new file mode 100644 index 0000000000000000000000000000000000000000..f3fbb715acd8dcc431b1657d51707837665ddaeb --- /dev/null +++ b/doc/5.2-patch.sql @@ -0,0 +1,39 @@ + +ALTER TABLE `cms_category` ADD COLUMN `leaf` bigint(1) NULL DEFAULT NULL COMMENT '是否是叶子节点' AFTER `category_pinyin`; +ALTER TABLE `cms_category` ADD COLUMN `top_id` bigint(20) NULL DEFAULT NULL COMMENT '顶级id' AFTER `leaf`; +ALTER TABLE `cms_category` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; +ALTER TABLE `cms_content` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; +ALTER TABLE `manager` ADD COLUMN `create_date` datetime NULL DEFAULT NULL AFTER `manager_admin`; +ALTER TABLE `manager` ADD COLUMN `update_date` datetime NULL DEFAULT NULL AFTER `create_date`; +ALTER TABLE `manager` ADD COLUMN `update_by` int(11) NULL DEFAULT NULL AFTER `update_date`; +ALTER TABLE `manager` ADD COLUMN `create_by` int(11) NULL DEFAULT NULL AFTER `update_by`; +ALTER TABLE `manager` ADD COLUMN `del` int(11) NULL DEFAULT NULL AFTER `create_by`; +ALTER TABLE `manager` MODIFY COLUMN `manager_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '管理员id(主键)' FIRST ; +ALTER TABLE `mdiy_dict` ADD COLUMN `dict_enable` varchar(11) CHARACTER SET utf8 COLLATE utf8_bin NULL DEFAULT '1' COMMENT '启用状态' AFTER `is_child`; +ALTER TABLE `mdiy_model` ADD COLUMN `app_id` int(11) NULL DEFAULT NULL COMMENT '应用编号' AFTER `model_json`; +ALTER TABLE `mdiy_model` DROP COLUMN `model_app_id`; +ALTER TABLE `mdiy_page` DROP FOREIGN KEY `mdiy_page_ibfk_1`; +ALTER TABLE `mdiy_page` ADD COLUMN `app_id` int(11) NOT NULL COMMENT '应用id' AFTER `page_id`; +ALTER TABLE `mdiy_page` DROP COLUMN `page_app_id`; +ALTER TABLE `mdiy_page` ADD CONSTRAINT `mdiy_page_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT; +DROP INDEX `index_page_app_id` ON `mdiy_page`; +CREATE INDEX `index_page_app_id` ON `mdiy_page`(`app_id`) USING BTREE ; +ALTER TABLE `people` DROP FOREIGN KEY `people_ibfk_1`; +ALTER TABLE `people` ADD COLUMN `app_id` int(11) NOT NULL COMMENT '应用编号' AFTER `people_datetime`; +ALTER TABLE `people` DROP COLUMN `people_app_id`; +ALTER TABLE `people` ADD CONSTRAINT `people_ibfk_1` FOREIGN KEY (`app_id`) REFERENCES `app` (`id`) ON DELETE CASCADE ON UPDATE NO ACTION; +DROP INDEX `fk_people` ON `people`; +CREATE INDEX `fk_people` ON `people`(`app_id`) USING BTREE ; +ALTER TABLE `people_address` ADD COLUMN `APP_ID` int(11) NOT NULL COMMENT '对应的站点id' AFTER `PA_DEFAULT`; +ALTER TABLE `people_address` DROP COLUMN `PA_APP_ID`; +DROP INDEX `PA_APP_ID` ON `people_address`; +CREATE INDEX `PA_APP_ID` ON `people_address`(`APP_ID`) USING BTREE ; +ALTER TABLE `system_log` MODIFY COLUMN `id` bigint(20) UNSIGNED NOT NULL FIRST ; + +UPDATE `mdiy_tag_sql` SET `id`='5', `tag_id`='3', `tag_sql`='<#assign _typeid=\'\'/>\r\n<#assign _size=\'20\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n\r\n<#if size??>\r\n <#assign _size=\'${size}\'>\r\n\r\n<#if orderby?? >\r\n <#if orderby==\'date\'> \r\n <#assign _orderby=\'content_datetime\'>\r\n <#elseif orderby==\'updatedate\'>\r\n <#assign _orderby=\'content_updatetime\'>\r\n <#elseif orderby==\'hit\'> \r\n <#assign _orderby=\'content_hit\'>\r\n <#elseif orderby==\'sort\'>\r\n <#assign _orderby=\'content_sort\'>\r\n <#else><#assign _orderby=\'cms_content.id\'>\r\n <#else>\r\n <#assign _orderby=\'cms_content.id\'>\r\n \r\nSELECT\r\n cms_content.id AS id,\r\n content_title AS title,\r\n content_title AS fulltitle,\r\n content_author AS author,\r\n content_source AS source,\r\n content_details AS content,\r\n category.category_title AS typename,\r\n category.id AS typeid,\r\n category.category_img AS typelitpic,\r\n <#--列表页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', category.category_id) as typelink,\r\n <#else>\r\n (SELECT \'index.html\') AS typelink,\r\n \r\n content_img AS litpic,\r\n <#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/view.do?id=\', cms_content.id,\'&orderby=${_orderby}\',\'&order=${order!\'ASC\'}\',\'&typeid=${typeid}\') as \"link\",\r\n <#else>\r\n\r\n CONCAT(category.category_path,\'/\',cms_content.id,\'.html\') AS \"link\",\r\n \r\n content_datetime AS \"date\",<#if tableName??>${tableName}.*,\r\n content_description AS descrip,\r\n content_hit AS hit,\r\n content_type AS flag,\r\n category_title AS typetitle,\r\n cms_content.content_keyword AS keyword \r\nFROM\r\n cms_content\r\n LEFT JOIN cms_category as category ON content_category_id = category.id\r\n <#--判断是否有自定义模型表-->\r\n <#if tableName??>LEFT JOIN ${tableName} ON ${tableName}.link_id=cms_content.id \r\nWHERE \r\n content_display=0 \r\n and cms_content.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and cms_content.app_id=${appId}\r\n and cms_content.id>0\r\n \r\n <#--判断是否有搜索分类集合-->\r\n <#if search??>\r\n <#if search.categoryIds??>and FIND_IN_SET(category.id,\'${search.categoryIds}\')\r\n <#--标题-->\r\n <#if search.content_title??> and content_title like CONCAT(\'%\',\'${search.content_title}\',\'%\')\r\n <#--作者-->\r\n <#if search.content_author??> and content_author like CONCAT(\'%\',\'${search.content_author}\',\'%\')\r\n <#--来源-->\r\n <#if search.content_source??> and content_source like CONCAT(\'%\',\'${search.content_source}\',\'%\')\r\n <#--属性-->\r\n <#if search.content_type??> and (\r\n <#list search.content_type?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n )\r\n <#--描述-->\r\n <#if search.content_description??> and content_description like CONCAT(\'%\',\'${search.content_description}\',\'%\')\r\n <#--关键字-->\r\n <#if search.content_keyword??> and content_keyword like CONCAT(\'%\',\'${search.content_keyword}\',\'%\')\r\n <#--内容-->\r\n <#if search.content_details??> and content_details like CONCAT(\'%\',\'${search.content_details}\',\'%\')\r\n \r\n<#--自定义顺序-->\r\n <#if search.content_sort??> and content_sort=${search.content_sort} \r\n<#--时间范围-->\r\n <#if search.content_datetime_start??&&search.content_datetime_end??> and content_datetime between \'${search.content_datetime_start}\' and \'${search.content_datetime_end}\'\r\n <#else><#--查询栏目-->\r\n <#if _typeid?has_content> and (content_category_id=${_typeid} or content_category_id in \r\n (select id FROM cms_category where cms_category.del=0 and FIND_IN_SET(${_typeid},CATEGORY_PARENT_ID))) \r\n \r\n <#--标题-->\r\n <#if content_title??> and content_title like CONCAT(\'%\',\'${content_title}\',\'%\')\r\n <#--作者-->\r\n <#if content_author??> and content_author like CONCAT(\'%\',\'${content_author}\',\'%\')\r\n <#--来源-->\r\n <#if content_source??> and content_source like CONCAT(\'%\',\'${content_source}\',\'%\')\r\n <#--属性-->\r\n <#if content_type??> and content_type like CONCAT(\'%\',\'${content_type}\',\'%\')\r\n <#--描述-->\r\n <#if content_description??> and content_description like CONCAT(\'%\',\'${content_description}\',\'%\')\r\n <#--关键字-->\r\n <#if content_keyword??> and content_keyword like CONCAT(\'%\',\'${content_keyword}\',\'%\')\r\n <#--内容-->\r\n <#if content_details??> and content_details like CONCAT(\'%\',\'${content_details}\',\'%\')\r\n <#--自定义顺序-->\r\n <#if content_sort??> and content_sort=${content_sort}\r\n <#--自定义模型-->\r\n <#if diyModel??> \r\n <#list diyModel as dm>\r\n and ${tableName}.${dm.key} like CONCAT(\'%\',\'${dm.value}\',\'%\') \r\n \r\n \r\n <#--文章属性-->\r\n <#if flag?? >\r\n and(\r\n <#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)\r\n )\r\n \r\n <#if noflag??>\r\n and(\r\n <#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and\r\n FIND_IN_SET(\'${item}\',cms_content.content_type)=0\r\n or cms_content.content_type is null)\r\n \r\n <#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\'date\'> content_datetime\r\n <#elseif orderby==\'updatedate\'> content_updatetime\r\n <#elseif orderby==\'hit\'> content_hit\r\n <#elseif orderby==\'sort\'> content_sort\r\n <#else>cms_content.id\r\n <#else>\r\n ORDER BY cms_content.id\r\n \r\n <#if order?? >\r\n <#if order==\'desc\'> desc\r\n <#if order==\'asc\'> asc\r\n \r\n LIMIT \r\n <#--判断是否分页-->\r\n <#if ispaging?? && (pageTag.pageNo)??>${((pageTag.pageNo-1)*_size?eval)?c},${_size?default(20)}\r\n <#else>${_size?default(20)}', `sort`='1' WHERE (`id`='5'); +UPDATE `mdiy_tag_sql` SET `id`='6', `tag_id`='4', `tag_sql`='<#assign _typeid=\'0\'/>\r\n<#if column?? && column.id?? && column.id?number gt 0>\r\n <#assign _typeid=\'${column.id}\'>\r\n <#assign selfid=\'${column.id}\'>\r\n\r\n<#if typeid??>\r\n <#assign _typeid=\'${typeid}\'>\r\n\r\nselect \r\n id,\r\n id as typeid,\r\n category_title as typetitle,\r\n <#--返回父id集合-->\r\n category_parent_id as pids,\r\n <#--动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/list.do?typeid=\', id) as typelink,\r\n <#else>\r\n <#--栏目类型为链接-->\r\n CONCAT(category_path,\'/index.html\') as typelink,\r\n \r\n category_keyword as typekeyword,\r\n category_diy_url as typeurl,\r\n category_flag as flag,\r\n category_parent_id as parentid,\r\ncategory_descrip as typedescrip,\r\n category_img as typelitpic ,\r\n(select count(*) from cms_category c where c.category_id=id and c.del=0) as childsize\r\n from cms_category \r\n where \r\n cms_category.del=0 \r\n <#--根据站点编号查询-->\r\n <#if appId?? >\r\n and cms_category.app_id=${appId}\r\n \r\n <#--栏目属性-->\r\n <#if flag?? >\r\n and\r\n ( <#list flag?split(\',\') as item>\r\n <#if item?index gt 0> or\r\n FIND_IN_SET(\'${item}\',category_flag)\r\n )\r\n \r\n <#if noflag?? >\r\n and\r\n (\r\n <#list noflag?split(\',\') as item>\r\n <#if item?index gt 0> and\r\n FIND_IN_SET(\'${item}\',category_flag)=0\r\n or category_flag is null)\r\n \r\n <#--type默认son-->\r\n<#if !type??||!type?has_content>\r\n<#assign type=\'son\'/>\r\n\r\n<#if type?has_content>\r\n <#--顶级栏目(单个)-->\r\n <#if type==\'top\'>\r\n <#if _typeid != \'0\'>\r\n and (id = top_id or top_id = 0)\r\n \r\n <#elseif type==\'nav\'>\r\n and(category_id=0 or category_id is null)\r\n <#--同级栏目(多个)-->\r\n <#elseif type==\'level\'>\r\n and\r\n <#if _typeid?has_content>\r\n category_id=(select category_id from cms_category where id=${_typeid})\r\n <#else>\r\n 1=1\r\n \r\n <#--当前栏目(单个)-->\r\n <#elseif type==\'self\'>\r\n and \r\n <#if _typeid?has_content>\r\n id=${_typeid}\r\n <#else>\r\n 1=1\r\n \r\n <#--当前栏目的所属栏目(多个)-->\r\n <#elseif type==\'path\'>\r\n and \r\n <#if _typeid?has_content>\r\n id in (<#if column?? && column.categoryParentId??>${column.categoryParentId},${_typeid})\r\n <#else>\r\n 1=1\r\n \r\n <#--子栏目(多个)-->\r\n <#elseif type==\'son\'>\r\n and \r\n <#if _typeid?has_content>\r\n category_id=${_typeid}\r\n <#else>\r\n 1=1\r\n \r\n <#--上一级栏目没有则取当前栏目(单个)-->\r\n <#elseif type==\'parent\'>\r\n and \r\n <#if _typeid?has_content>\r\n <#if column?? && column.categoryId??>\r\n id=${column.categoryId}\r\n <#else>\r\n id=${_typeid}\r\n \r\n <#else>\r\n 1=1\r\n \r\n \r\n<#else> <#--默认顶级栏目-->\r\n and\r\n <#if _typeid?has_content>\r\n id=${_typeid}\r\n <#else>\r\n (category_id=0 or category_id is null)\r\n \r\n\r\n<#--字段排序-->\r\n <#if orderby?? >\r\n ORDER BY \r\n <#if orderby==\'date\'> category_datetime\r\n <#elseif orderby==\'sort\'> category_sort\r\n <#else>cms_content.id\r\n\r\n \r\n <#if order?? >\r\n <#if order==\'desc\'> desc\r\n <#if order==\'asc\'> asc\r\n ', `sort`='1' WHERE (`id`='6'); +UPDATE `mdiy_tag_sql` SET `id`='7', `tag_id`='5', `tag_sql`='select \r\nAPP_NAME as name,\r\napp_logo as logo ,\r\napp_keyword as keyword,\r\napp_description as descrip,\r\napp_copyright as copyright,\r\n<#--动态解析 -->\r\n<#if isDo?? && isDo>\r\nCONCAT(\'${url}\',\'/${html}/\',id) as url,\r\n\'${url}\' as host,\r\n<#--使用地址栏的域名 -->\r\n<#elseif url??>\r\nCONCAT(\'${url}\',\'/${html}/\',id,\'/<#if m??>${m}\') as url,\r\n\'${url}\' as host,\r\n<#else>\r\nCONCAT(REPLACE(REPLACE(TRIM(substring_index(app_url,\'\\n\',1)), CHAR(10),\'\'), CHAR(13),\'\'),\'/html/\',id,\'/<#if m??>${m}\') as url,\r\nREPLACE(REPLACE(TRIM(substring_index(app_url,\'\\n\',1)), CHAR(10),\'\'), CHAR(13),\'\') as host,\r\n\r\nCONCAT(\'templets/\',id,\'/\',<#if m??>CONCAT(app_style,\'/${m}\')<#else>app_style) as \"style\" <#-- 判断是否为手机端 -->\r\nfrom app where id = ${appId} limit 1', `sort`='1' WHERE (`id`='7'); +UPDATE `mdiy_tag_sql` SET `id`='8', `tag_id`='7', `tag_sql`='SELECT \r\ncms_content.id as id,\r\nleft(content_title,${titlelen?default(40)}) as title,\r\ncontent_title as fulltitle,\r\ncontent_author as author, \r\ncontent_source as source, \r\ncontent_details as content,\r\ncategory_title as typetitle,\r\ncms_category.id as typeid,\r\n cms_category.category_img AS typelitpic,\r\n<#--动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\'/${modelName}/list.do?typeid=\', cms_category.id) as typelink,\r\n<#else>\r\n(SELECT \'index.html\') as typelink,\r\n\r\ncms_content.content_img AS litpic,\r\n<#--内容页动态链接-->\r\n<#if isDo?? && isDo>\r\nCONCAT(\'/mcms/view.do?id=\', cms_content.id) as \"link\",\r\n<#else>\r\ncontent_url AS \"link\",\r\n\r\ncontent_datetime as \"date\",\r\ncontent_description as descrip,\r\nCONCAT(\'\') as hit,\r\ncontent_type as flag,\r\ncategory_title as typetitle,\r\n<#if tableName??>${tableName}.*,\r\ncontent_keyword as keyword\r\nFROM cms_content\r\nLEFT JOIN cms_category ON \r\n<#--如果是栏目列表页没有文章id所以只取栏目id-->\r\n<#if column??&&column.id??&&!id??> \r\n cms_category.id=${column.id}\r\n<#else>\r\ncms_category.id = content_category_id\r\n\r\n<#--判断是否有自定义模型表-->\r\n<#if tableName??>left join ${tableName} on ${tableName}.link_id=cms_content.id\r\nWHERE \r\n cms_content.del=0\r\n<#if id??> and cms_content.id=${id}', `sort`='1' WHERE (`id`='8'); +UPDATE `mdiy_tag_sql` SET `id`='9', `tag_id`='8', `tag_sql`='<#assign select=\"(SELECT \'\')\"/>\r\n<#if orderby?? >\r\n <#if orderby==\"date\"> \r\n <#assign _orderby=\"content_datetime\">\r\n <#elseif orderby==\"updatedate\">\r\n <#assign _orderby=\"content_updatetime\">\r\n <#elseif orderby==\"hit\"> \r\n <#assign _orderby=\"content_hit\">\r\n <#elseif orderby==\"sort\">\r\n <#assign _orderby=\"content_sort\">\r\n <#else><#assign _orderby=\"cms_content.id\">\r\n <#else>\r\n <#assign _orderby=\"cms_content.id\">\r\n \r\n<#if pageTag.preId??>\r\nSELECT \r\ncms_content.id as id,\r\nleft(content_title,${titlelen?default(40)}) as title,\r\ncontent_title as fulltitle,\r\ncontent_author as author, \r\ncontent_source as source, \r\ncontent_details as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \'index.html\') as typelink,\r\ncontent_img as litpic,\r\n<#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/view.do?id=\', cms_content.id,\'&orderby=${_orderby}\',\'&order=${order!\'ASC\'}\',\'&typeid=${typeid}\') as \"link\",\r\n <#else>\r\n CONCAT(category_path,\'/\',cms_content.id,\'.html\') AS \"link\",\r\n \r\ncontent_datetime as \"date\",\r\ncontent_description as descrip,\r\ncontent_hit as hit,\r\ncontent_type as flag,\r\ncontent_keyword as keyword \r\nFROM cms_content \r\nLEFT JOIN cms_category as category ON content_category_id=category.id \r\nWHERE cms_content.id=${pageTag.preId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as \"link\",\r\n${select} as \"date\",\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM cms_content\r\n', `sort`=NULL WHERE (`id`='9'); +UPDATE `mdiy_tag_sql` SET `id`='10', `tag_id`='9', `tag_sql`=' select\r\n <#if !(pageTag.indexUrl??)>\r\n <#--判断是否有栏目对象,用于搜索不传栏目-->\r\n <#if column??>\r\n <#assign path=column.categoryPath/>\r\n <#else>\r\n <#assign path=\"\"/>\r\n \r\n <#--总记录数、总页数-->\r\n (SELECT ${pageTag.total}) as \"total\",\r\n <#--记录总数-->\r\n (SELECT ${pageTag.size}) as \"rcount\",\r\n <#--当前页码-->\r\n (SELECT ${pageTag.pageNo}) as \"cur\",\r\n <#--首页-->\r\n CONCAT(\'${path}\', \'/index.html\') as \"index\",\r\n <#--上一页-->\r\n <#if (pageTag.pageNo?eval-1) gt 1>\r\n CONCAT(\'${path}\',\'/list-${pageTag.pageNo?eval-1}.html\') as \"pre\",\r\n <#else>\r\n CONCAT(\'${path}\',\'/index.html\') as \"pre\",\r\n \r\n <#--下一页-->\r\n <#if pageTag.total==1>\r\n CONCAT(\'${path}\', \'/index.html\') as \"next\",\r\n CONCAT(\'${path}\', \'/index.html\') as \"last\"\r\n <#else>\r\n <#if pageTag.pageNo?eval gte pageTag.total>\r\n CONCAT(\'${path}\',\'/list-${pageTag.total}.html\') as \"next\",\r\n <#else>\r\n CONCAT(\'${path}\',\'/list-${pageTag.pageNo?eval+1}.html\') as \"next\",\r\n \r\n <#--最后一页-->\r\n CONCAT(\'${path}\',\'/list-${pageTag.total}.html\') as \"last\"\r\n \r\n<#else><#--判断是否是搜索页面-->\r\n \'${pageTag.indexUrl}\' as \"index\",\'${pageTag.lastUrl}\' as \"last\",\'${pageTag.preUrl}\' as \"pre\",\'${pageTag.nextUrl}\' as \"next\",\'${pageTag.total}\' as \"total\",\'${pageTag.size}\' as \"rcount\",\'${pageTag.pageNo}\' as \"cur\"\r\n', `sort`=NULL WHERE (`id`='10'); +UPDATE `mdiy_tag_sql` SET `id`='11', `tag_id`='10', `tag_sql`='<#assign select=\"(SELECT \'\')\"/>\r\n<#if orderby?? >\r\n <#if orderby==\"date\"> \r\n <#assign _orderby=\"content_datetime\">\r\n <#elseif orderby==\"updatedate\">\r\n <#assign _orderby=\"content_updatetime\">\r\n <#elseif orderby==\"hit\"> \r\n <#assign _orderby=\"content_hit\">\r\n <#elseif orderby==\"sort\">\r\n <#assign _orderby=\"content_sort\">\r\n <#else><#assign _orderby=\"cms_content.id\">\r\n <#else>\r\n <#assign _orderby=\"cms_content.id\">\r\n \r\n<#if pageTag.nextId??>\r\nSELECT \r\ncms_content.id as id,\r\nleft(content_title,${titlelen?default(40)}) as title,\r\ncontent_title as fulltitle,\r\ncontent_author as author, \r\ncontent_source as source, \r\ncontent_details as content,\r\ncategory.category_title as typename,\r\ncategory.category_id as typeid,\r\n(SELECT \'index.html\') as typelink,\r\ncontent_img as litpic,\r\n<#--内容页动态链接-->\r\n <#if isDo?? && isDo>\r\n CONCAT(\'/${modelName}/view.do?id=\', cms_content.id,\'&orderby=${_orderby}\',\'&order=${order!\'ASC\'}\',\'&typeid=${typeid}\') as \"link\",\r\n <#else>\r\n CONCAT(category_path,\'/\',cms_content.id,\'.html\') AS \"link\",\r\n \r\ncontent_datetime as \"date\",\r\ncontent_description as descrip,\r\ncontent_hit as hit,\r\ncontent_type as flag,\r\ncontent_keyword as keyword \r\nFROM cms_content \r\nLEFT JOIN cms_category as category ON content_category_id=category.id \r\nWHERE cms_content.id=${pageTag.nextId}\r\n<#else>\r\nSELECT \r\n${select} as id,\r\n${select} as title,\r\n${select} as fulltitle,\r\n${select} as author, \r\n${select} as source, \r\n${select} as content,\r\n${select} as typename,\r\n${select} as typeid,\r\n${select} as typelink,\r\n${select} as litpic,\r\n${select} as \"link\",\r\n${select} as \"date\",\r\n${select} as descrip,\r\n${select} as hit,\r\n${select} as flag,\r\n${select} as keyword FROM cms_content\r\n', `sort`=NULL WHERE (`id`='11'); diff --git a/pom.xml b/pom.xml index 432baaec23df8afc87793f2102b9a28d83952e90..63f88b1dd7c901d7ff27b6a9c475494d9c4192f9 100644 --- a/pom.xml +++ b/pom.xml @@ -1,84 +1,158 @@  + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + + net.mingsoft + ms-pom + 2.0.0-SNAPSHOT + + 4.0.0 + net.mingsoft + ms-mcms + 5.2-SNAPSHOT + ms-mcms + + jar + + + + 1.8 + - 4.0.0 - net.mingsoft - ms-mcms - 5.1 - ms-mcms - - jar - - - - 1.8 - - - - alimaven - aliyun maven - https://maven.aliyun.com/nexus/content/groups/public/ - - true - - - true - - - - - - net.mingsoft - ms-mpeople - 1.0.28 - + - - - net.mingsoft - store-client - 5.1 - - - org.springframework.boot - spring-boot-starter - 2.2.2.RELEASE + + dm + dm.jdbc.driver + 8.0.0 + + + net.mingsoft + ms-mpeople + + + net.mingsoft + ms-db + + + + + net.mingsoft + store-client + 5.1 + + + org.springframework.boot + spring-boot-starter + 2.2.2.RELEASE - - org.springframework.boot - spring-boot-starter-logging - - - - + + org.springframework.boot + spring-boot-starter-logging + + + + - - ms-mcms - - - org.apache.maven.plugins - maven-compiler-plugin - - ${java.version} - ${java.version} - - - - org.springframework.boot - spring-boot-maven-plugin - - - - repackage - - - - - true + + ms-mcms + + + org.apache.maven.plugins + maven-jar-plugin + 3.1.2 + + + **/static/plugins/ + **/static/skin/ + **/*.yml + **/Dockerfile + **/ehcache.xml + **/upgrade/ + **/MSApplication.* + **/MSServletInitializer.* + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + **/static/plugins/ + **/static/skin/ + **/*.yml + **/Dockerfile + **/ehcache.xml + **/upgrade/ + **/config/ + **/MSApplication.java + **/MSServletInitializer.java + + + + + attach-sources + + jar-no-fork + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + 2.9.1 + + UTF-8 + UTF-8 + UTF-8 + ${java.home}/../bin/javadoc + -Xdoclint:none + + + + attach-javadocs + + jar + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + 3.1 + + ${java.version} + ${java.version} + ${project.build.sourceEncoding} + true + true + + + ${java.home}/lib/rt.jar${path.separator}${java.home}/lib/jce.jar + + + + + org.codehaus.plexus + plexus-compiler-eclipse + 2.1 + + + + + + org.apache.maven.plugins + maven-release-plugin + + -Dgpg.passphrase=${gpg.passphrase} @@ -95,7 +169,7 @@ - true + src/main/webapp @@ -104,14 +178,24 @@ - - - src/main/resources - - - src/main/java - - - compile - + + + static/ + html/ + upload/ + template/ + + + + src/main/resources + + + src/main/java + + **/*.java + + + + compile + \ No newline at end of file diff --git a/src/main/java/net/mingsoft/MSApplication.java b/src/main/java/net/mingsoft/MSApplication.java index 8e38561641ec47e9289cb5fa0a3eccfc517577ea..7ac61580b8425a2a0714a66895efadcc507eb8f6 100644 --- a/src/main/java/net/mingsoft/MSApplication.java +++ b/src/main/java/net/mingsoft/MSApplication.java @@ -13,7 +13,7 @@ import java.util.Locale; @SpringBootApplication @ComponentScan(basePackages = {"net.mingsoft"}) -@MapperScan(basePackages={"**.dao"}) +@MapperScan(basePackages={"**.dao","**.mapper"}) @ServletComponentScan(basePackages = {"net.mingsoft"}) public class MSApplication { public static void main(String[] args) { diff --git a/src/main/java/net/mingsoft/cms/action/CategoryAction.java b/src/main/java/net/mingsoft/cms/action/CategoryAction.java index e79c3eb8fda7edbff808fc1e2d7a2e3a82e30962..a8dd7bb6758aa8ef1585698b640bf5863ffa64ad 100644 --- a/src/main/java/net/mingsoft/cms/action/CategoryAction.java +++ b/src/main/java/net/mingsoft/cms/action/CategoryAction.java @@ -1,19 +1,19 @@ package net.mingsoft.cms.action; +import cn.hutool.core.util.StrUtil; 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.PinYinUtil; import net.mingsoft.basic.util.StringUtil; import net.mingsoft.cms.biz.ICategoryBiz; import net.mingsoft.cms.entity.CategoryEntity; -import net.mingsoft.basic.util.PinYinUtil; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -25,6 +25,7 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.util.List; + /** * 分类管理控制层 * @author 铭飞开发团队 @@ -34,7 +35,7 @@ import java.util.List; @Api(value = "分类接口") @Controller("cmsCategoryAction") @RequestMapping("/${ms.manager.path}/cms/category") -public class CategoryAction extends BaseAction{ +public class CategoryAction extends BaseAction { /** @@ -84,23 +85,18 @@ public class CategoryAction extends BaseAction{ }) @RequestMapping("/list") @ResponseBody - public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) { - category.setAppId(BasicUtil.getAppId()); + public ResultData list(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) { BasicUtil.startPage(); List categoryList = categoryBiz.query(category); - 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); - } - model.addAttribute("appId",BasicUtil.getAppId()); + public String form(@ModelAttribute CategoryEntity category, HttpServletResponse response, HttpServletRequest request, ModelMap model){ + model.addAttribute("appId", BasicUtil.getAppId()); return "/cms/category/form"; } @@ -112,12 +108,11 @@ public class CategoryAction extends BaseAction{ @ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query") @GetMapping("/get") @ResponseBody - public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){ + public ResultData get(@ModelAttribute @ApiIgnore CategoryEntity category, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){ if(category.getId()==null) { return ResultData.build().error(); } - category.setAppId(BasicUtil.getAppId()); - CategoryEntity _category = (CategoryEntity)categoryBiz.getEntity(Integer.parseInt(category.getId())); + CategoryEntity _category = (CategoryEntity)categoryBiz.getById(category.getId()); return ResultData.build().success(_category); } @@ -172,9 +167,16 @@ public class CategoryAction extends BaseAction{ if(!StringUtil.checkLength(category.getCategoryParentId()+"", 1, 100)){ return ResultData.build().error(getResString("err.length", this.getResString("category.parent.id"), "1", "100")); } - //获取拼音 + //判断拼音是否重复 + if(StrUtil.isNotBlank(category.getCategoryPinyin())) { + CategoryEntity _category = new CategoryEntity(); + _category.setCategoryPinyin(category.getCategoryPinyin()); + List query = categoryBiz.query(_category); + if (query.size() > 0) { + return ResultData.build().error(getResString("err.exist", this.getResString("category.pinyin"))); + } + } - category.setAppId(BasicUtil.getAppId()); categoryBiz.saveEntity(category); return ResultData.build().success(category); } @@ -187,9 +189,9 @@ public class CategoryAction extends BaseAction{ @ResponseBody @LogAnn(title = "删除分类", businessType = BusinessTypeEnum.DELETE) @RequiresPermissions("cms:category:del") - public ResultData delete(@RequestBody List categorys,HttpServletResponse response, HttpServletRequest request) { + public ResultData delete(@RequestBody List categorys, HttpServletResponse response, HttpServletRequest request) { for(int i = 0;i query = categoryBiz.query(_category); + if (query.size() > 0) { + return ResultData.build().error(getResString("err.exist", this.getResString("category.pinyin"))); + } + } String pingYin = PinYinUtil.getPingYin(category.getCategoryTitle()); + //如果用户填写了拼音则使用用户填写的 + if (StrUtil.isNotBlank(category.getCategoryPinyin())) { + pingYin = category.getCategoryPinyin(); + } CategoryEntity categoryEntity=new CategoryEntity(); categoryEntity.setCategoryPinyin(pingYin); - categoryEntity.setAppId(BasicUtil.getAppId()); CategoryEntity categoryBizEntity = (CategoryEntity)categoryBiz.getEntity(categoryEntity); category.setCategoryPinyin(pingYin); //如果存在此拼音栏目则拼接上id @@ -258,14 +272,12 @@ public class CategoryAction extends BaseAction{ //判断是否选择子级为所属栏目 CategoryEntity _category = new CategoryEntity(); _category.setCategoryParentId(category.getId()); - _category.setAppId(BasicUtil.getAppId()); List categoryList = categoryBiz.queryChilds(_category); for(CategoryEntity item:categoryList){ if(item.getId().equals(category.getCategoryId())){ return ResultData.build().error(getResString("cannot.select.child")); } } - category.setAppId(BasicUtil.getAppId()); categoryBiz.updateEntity(category); return ResultData.build().success(category); } diff --git a/src/main/java/net/mingsoft/cms/action/ContentAction.java b/src/main/java/net/mingsoft/cms/action/ContentAction.java index d2818ebbea6c29cd977bf81108976e55b01b324f..9c9c5b210b70c28139c8ea60af4dd2027b35c62c 100644 --- a/src/main/java/net/mingsoft/cms/action/ContentAction.java +++ b/src/main/java/net/mingsoft/cms/action/ContentAction.java @@ -4,7 +4,6 @@ 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; @@ -23,7 +22,9 @@ import springfox.documentation.annotations.ApiIgnore; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; import java.util.List; + /** * 文章管理控制层 * @author 铭飞开发团队 @@ -33,7 +34,7 @@ import java.util.List; @Api(value = "文章接口") @Controller("cmsContentAction") @RequestMapping("/${ms.manager.path}/cms/content") -public class ContentAction extends BaseAction{ +public class ContentAction extends BaseAction { /** @@ -86,23 +87,18 @@ public class ContentAction extends BaseAction{ }) @RequestMapping("/list") @ResponseBody - public ResultData list(@ModelAttribute @ApiIgnore ContentEntity content,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model,BindingResult result) { - content.setAppId(BasicUtil.getAppId()); + public ResultData list(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model, BindingResult result) { BasicUtil.startPage(); List contentList = contentBiz.query(content); - 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); - } - model.addAttribute("appId",BasicUtil.getAppId()); + public String form(@ModelAttribute ContentEntity content, HttpServletResponse response, HttpServletRequest request, ModelMap model){ + model.addAttribute("appId", BasicUtil.getAppId()); return "/cms/content/form"; } @@ -114,12 +110,11 @@ public class ContentAction extends BaseAction{ @ApiImplicitParam(name = "id", value = "编号", required =true,paramType="query") @GetMapping("/get") @ResponseBody - public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content,HttpServletResponse response, HttpServletRequest request,@ApiIgnore ModelMap model){ + public ResultData get(@ModelAttribute @ApiIgnore ContentEntity content, HttpServletResponse response, HttpServletRequest request, @ApiIgnore ModelMap model){ if(content.getId()==null) { return ResultData.build().error(); } - content.setAppId(BasicUtil.getAppId()); - ContentEntity _content = (ContentEntity)contentBiz.getEntity(Integer.parseInt(content.getId())); + ContentEntity _content = contentBiz.getById(content.getId()); return ResultData.build().success(_content); } @@ -176,8 +171,7 @@ public class ContentAction extends BaseAction{ if(!StringUtil.checkLength(content.getContentUrl()+"", 0, 200)){ return ResultData.build().error(getResString("err.length", this.getResString("content.url"), "0", "200")); } - content.setAppId(BasicUtil.getAppId()); - contentBiz.saveEntity(content); + contentBiz.save(content); return ResultData.build().success(content); } @@ -189,12 +183,12 @@ public class ContentAction extends BaseAction{ @ResponseBody @LogAnn(title = "删除文章", businessType = BusinessTypeEnum.DELETE) @RequiresPermissions("cms:content:del") - public ResultData delete(@RequestBody List contents,HttpServletResponse response, HttpServletRequest request) { - int[] ids = new int[contents.size()]; + public ResultData delete(@RequestBody List contents, HttpServletResponse response, HttpServletRequest request) { + List ids = new ArrayList<>(); for(int i = 0;i0) { CategoryEntity categoryEntity = new CategoryEntity(); categoryEntity.setId(CategoryId+""); - categoryEntity.setAppId(app.getAppId()); columns = categoryBiz.queryChilds(categoryEntity); } else { // 获取所有的内容管理栏目 CategoryEntity categoryEntity=new CategoryEntity(); - categoryEntity.setAppId(app.getAppId()); columns = categoryBiz.query(categoryEntity); } List articleIdList = null; diff --git a/src/main/java/net/mingsoft/cms/action/web/ContentAction.java b/src/main/java/net/mingsoft/cms/action/web/ContentAction.java index 5aeddc6fe7f0c498059600e750b7d8a93c7be62e..078a9f90bebe00ef35be21e072fdd7b0247857a1 100644 --- a/src/main/java/net/mingsoft/cms/action/web/ContentAction.java +++ b/src/main/java/net/mingsoft/cms/action/web/ContentAction.java @@ -1,5 +1,6 @@ package net.mingsoft.cms.action.web; +import cn.hutool.core.util.ObjectUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -103,10 +104,9 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ @ApiImplicitParam(name = "contentId", value = "文章编号", required = true,paramType="path") @GetMapping(value = "/{contentId}/hit") @ResponseBody - public void hit(@PathVariable @ApiIgnore int contentId, HttpServletRequest request, HttpServletResponse response){ + public String hit(@PathVariable @ApiIgnore int contentId, HttpServletRequest request, HttpServletResponse response){ if(contentId<=0){ - this.outString(response, "document.write(0)"); - return; + return "document.write(0)"; } //获取ip String ip = BasicUtil.getIp(); @@ -114,11 +114,17 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ boolean isMobileDevice = BasicUtil.isMobileDevice(); ContentEntity content = (ContentEntity)contentBiz.getEntity(contentId); + if(content == null){ + return "document.write(0)"; + } //浏览数+1 - content.setContentHit(content.getContentHit()+1); + if(ObjectUtil.isNotEmpty(content.getContentHit())){ + content.setContentHit(content.getContentHit()+1); + }else { + content.setContentHit(1); + } contentBiz.updateEntity(content); - // cms_history 增加相应记录 HistoryLogEntity entity = new HistoryLogEntity(); entity.setHlIsMobile(isMobileDevice); @@ -126,17 +132,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{ entity.setContentId(content.getId()); entity.setCreateDate(new Date()); historyLogBiz.saveEntity(entity); - - if(content == null){ - this.outString(response, "document.write(0)"); - return; - } if(content.getAppId() == null || content.getAppId() != BasicUtil.getAppId()){ - this.outString(response, "document.write(0)"); - return; + return "document.write(0)"; } - this.outString(response, "document.write(" + content.getContentHit() + ")"); - return; + return "document.write(" + content.getContentHit() + ")"; } } 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 2aec809f5e683c4b39dfbcb59d5614cfb986adc8..3850700a932c99cf1c7ea21b2abff34116f5c495 100644 --- a/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java +++ b/src/main/java/net/mingsoft/cms/action/web/MCmsAction.java @@ -26,7 +26,9 @@ import cn.hutool.core.util.PageUtil; import freemarker.core.ParseException; import freemarker.template.MalformedTemplateNameException; import freemarker.template.TemplateNotFoundException; +import net.bytebuddy.implementation.bytecode.Throw; import net.mingsoft.base.constant.Const; +import net.mingsoft.basic.exception.BusinessException; import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.basic.util.StringUtil; import net.mingsoft.cms.bean.CategoryBean; @@ -105,7 +107,8 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { * 动态列表页 */ @GetMapping("/index.do") - public void index(HttpServletRequest req, HttpServletResponse resp) { + @ResponseBody + public String index(HttpServletRequest req, HttpServletResponse resp) { Map map = BasicUtil.assemblyRequestMap(); map.forEach((k,v)->{ map.put(k,v.toString().replaceAll("('|\"|\\\\)","\\\\$1")); @@ -129,7 +132,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { } catch (IOException e) { e.printStackTrace(); } - this.outString(resp, content); + return content; } /** @@ -137,8 +140,9 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { * @param req * @param resp */ + @ResponseBody @GetMapping("/list.do") - public void list(HttpServletRequest req, HttpServletResponse resp) { + public String list(HttpServletRequest req, HttpServletResponse resp) { Map map = BasicUtil.assemblyRequestMap(); map.forEach((k,v)->{ map.put(k,v.toString().replaceAll("('|\"|\\\\)","\\\\$1")); @@ -152,7 +156,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { List columnArticles = contentBiz.queryIdsByCategoryIdForParser(contentBean); //判断栏目下是否有文章 if(columnArticles.size()==0){ - this.outJson(resp, false); + return ""; } //设置分页类 PageBean page = new PageBean(); @@ -185,7 +189,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { } catch (IOException e) { e.printStackTrace(); } - this.outString(resp, content); + return content; } /** @@ -193,18 +197,17 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { * @param id 文章编号 */ @GetMapping("/view.do") - public void view(String orderby,String order,HttpServletRequest req, HttpServletResponse resp) { + @ResponseBody + public String view(String orderby,String order,HttpServletRequest req, HttpServletResponse resp) { //参数文章编号 ContentEntity article = (ContentEntity) contentBiz.getEntity(BasicUtil.getInt(ParserUtil.ID)); if(ObjectUtil.isNull(article)){ - this.outJson(resp, null,false,getResString("err.empty", this.getResString("id"))); - return; + throw new BusinessException(this.getResString("err.empty", this.getResString("id"))) ; } if(StringUtils.isNotBlank(order)){ //防注入 if(!order.toLowerCase().equals("asc")&&!order.toLowerCase().equals("desc")){ - this.outJson(resp, null,false,getResString("err.error", this.getResString("order"))); - return; + throw new BusinessException(this.getResString("err.error", this.getResString("order"))); } } @@ -239,7 +242,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { ModelEntity contentModel = null; for (int artId = 0; artId < articleIdList.size();) { //如果不是当前文章则跳过 - if(articleIdList.get(artId).getArticleId() != Integer.parseInt(article.getId())){ + if(articleIdList.get(artId).getArticleId().equals(article.getId())){ artId++; continue; } @@ -289,7 +292,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { } catch (IOException e) { e.printStackTrace(); } - this.outString(resp, content); + return content; } @@ -303,7 +306,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { */ @RequestMapping(value = "search") @ResponseBody - public void search(HttpServletRequest request, HttpServletResponse response) throws IOException { + public String search(HttpServletRequest request, HttpServletResponse response) throws IOException { Map map = new HashMap<>(); // 读取请求字段 @@ -447,7 +450,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction { } catch (IOException e) { e.printStackTrace(); } - this.outString(response, content); + return content; } // 清除路径中的转义字符 diff --git a/src/main/java/net/mingsoft/cms/bean/CategoryBean.java b/src/main/java/net/mingsoft/cms/bean/CategoryBean.java index 1c402a02118d98766b0d2a98efbb77640f144560..6ee3c4f4c5320e60d65e5d0b40ecbc3fee96db4e 100644 --- a/src/main/java/net/mingsoft/cms/bean/CategoryBean.java +++ b/src/main/java/net/mingsoft/cms/bean/CategoryBean.java @@ -13,16 +13,16 @@ public class CategoryBean extends CategoryEntity { /** * 文章编号 */ - private int articleId; + private String articleId; - public int getArticleId() { + public String getArticleId() { return articleId; } - public void setArticleId(int articleId) { + public void setArticleId(String articleId) { this.articleId = articleId; } } \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java b/src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java index 8fb299534f5acab4d0adbe90ef20d7df72445dcb..834667c5b8c98cdb29097ffec768329ae8afb6ce 100644 --- a/src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java +++ b/src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java @@ -12,7 +12,7 @@ import java.util.List; * 创建日期:2019-11-28 15:12:32
* 历史修订:
*/ -public interface ICategoryBiz extends IBaseBiz { +public interface ICategoryBiz extends IBaseBiz { /** * 查询当前分类下的所有子分类 @@ -33,5 +33,5 @@ public interface ICategoryBiz extends IBaseBiz { */ void update(CategoryEntity entity); - void delete(int categoryId); + void delete(String categoryId); } diff --git a/src/main/java/net/mingsoft/cms/biz/IContentBiz.java b/src/main/java/net/mingsoft/cms/biz/IContentBiz.java index 2873c7ce91fc88b59759653c2d95d55bd2272d35..341e79b9b7bb969b6a2eeb7280c8c7a22ac873f1 100644 --- a/src/main/java/net/mingsoft/cms/biz/IContentBiz.java +++ b/src/main/java/net/mingsoft/cms/biz/IContentBiz.java @@ -3,6 +3,7 @@ package net.mingsoft.cms.biz; import net.mingsoft.base.biz.IBaseBiz; import net.mingsoft.cms.bean.CategoryBean; import net.mingsoft.cms.bean.ContentBean; +import net.mingsoft.cms.entity.ContentEntity; import net.mingsoft.mdiy.entity.ModelEntity; import java.util.List; @@ -15,7 +16,7 @@ import java.util.Map; * 创建日期:2019-11-28 15:12:32
* 历史修订:
*/ -public interface IContentBiz extends IBaseBiz { +public interface IContentBiz extends IBaseBiz { /** * 根据文章属性查询 diff --git a/src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java b/src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java index 7986a27b625fe11bef79a0c7a77c71a2c690ac2d..32a32c9a9da1455f63904e789535cb2bebe4f129 100644 --- a/src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java +++ b/src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java @@ -21,19 +21,23 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技 package net.mingsoft.cms.biz.impl; +import cn.hutool.core.lang.Assert; import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import net.mingsoft.base.biz.impl.BaseBizImpl; import net.mingsoft.base.dao.IBaseDao; -import net.mingsoft.basic.util.BasicUtil; +import net.mingsoft.basic.util.PinYinUtil; import net.mingsoft.cms.biz.ICategoryBiz; import net.mingsoft.cms.dao.ICategoryDao; import net.mingsoft.cms.dao.IContentDao; import net.mingsoft.cms.entity.CategoryEntity; -import net.mingsoft.basic.util.PinYinUtil; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import java.util.ArrayList; import java.util.List; /** @@ -43,7 +47,8 @@ import java.util.List; * 历史修订:
*/ @Service("cmscategoryBizImpl") -public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { + @Transactional(rollbackFor = RuntimeException.class) +public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { @Autowired @@ -68,31 +73,49 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { public void saveEntity(CategoryEntity categoryEntity) { // TODO Auto-generated method stub String pingYin = PinYinUtil.getPingYin(categoryEntity.getCategoryTitle()); + //如果用户自己填入了拼音则使用用户的 + if (StrUtil.isNotBlank(categoryEntity.getCategoryPinyin())) { + pingYin = categoryEntity.getCategoryPinyin(); + } CategoryEntity category=new CategoryEntity(); category.setCategoryPinyin(pingYin); - category.setAppId(BasicUtil.getAppId()); Object categoryBizEntity = getEntity(category); setParentId(categoryEntity); categoryEntity.setCategoryPinyin(pingYin); - super.saveEntity(categoryEntity); + //更新新的父级 + if(StrUtil.isNotBlank(categoryEntity.getCategoryId())&&!"0".equals(categoryEntity.getCategoryId())){ + CategoryEntity parent = getById(categoryEntity.getCategoryId()); + //如果之前是叶子节点就更新 + if(parent.getLeaf()){ + parent.setLeaf(false); + updateById(parent); + } + } + categoryEntity.setLeaf(false); + //如果是新增栏目一定是叶子节点 + if (StrUtil.isEmpty(categoryEntity.getId())) { + categoryEntity.setLeaf(true); + } + super.save(categoryEntity); //拼音存在则拼接id if(categoryBizEntity!=null){ categoryEntity.setCategoryPinyin(pingYin+categoryEntity.getId()); } CategoryEntity parentCategory = null; if (StringUtils.isNotBlank(categoryEntity.getCategoryId())) { - parentCategory = (CategoryEntity)categoryDao.getEntity(Integer.parseInt(categoryEntity.getCategoryId())); + parentCategory = (CategoryEntity)getById(categoryEntity.getCategoryId()); } //保存链接地址 String path=ObjectUtil.isNotNull(parentCategory)?parentCategory.getCategoryPath():""; categoryEntity.setCategoryPath( path+"/" + categoryEntity.getCategoryPinyin()); - super.updateEntity(categoryEntity); + setTopId(categoryEntity); + super.updateById(categoryEntity); } private void setParentId(CategoryEntity categoryEntity) { String path = ""; - if(StringUtils.isNotEmpty(categoryEntity.getCategoryId())&&Integer.parseInt(categoryEntity.getCategoryId())>0) { - CategoryEntity category = (CategoryEntity)categoryDao.getEntity(Integer.parseInt(categoryEntity.getCategoryId())); + if(StringUtils.isNotEmpty(categoryEntity.getCategoryId())&&Long.parseLong(categoryEntity.getCategoryId())>0) { + CategoryEntity category = (CategoryEntity)getById(categoryEntity.getCategoryId()); path = category.getCategoryPath(); if(StringUtils.isEmpty(category.getCategoryParentId())) { categoryEntity.setCategoryParentId(category.getId()); @@ -132,13 +155,14 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { String pingYin = PinYinUtil.getPingYin(entity.getCategoryTitle()); CategoryEntity category=new CategoryEntity(); category.setCategoryPinyin(pingYin); - category.setAppId(BasicUtil.getAppId()); CategoryEntity categoryBizEntity = (CategoryEntity)getEntity(category); //拼音存在则拼接id if(categoryBizEntity!=null&&!categoryBizEntity.getId().equals(entity.getId())){ entity.setCategoryPinyin(pingYin+entity.getId()); } - super.updateEntity(entity); + setParentLeaf(entity); + setTopId(entity); + super.updateById(entity); setChildParentId(entity); } @@ -148,21 +172,72 @@ public class CategoryBizImpl extends BaseBizImpl implements ICategoryBiz { } @Override - public void delete(int categoryId) { + public void delete(String categoryId) { // TODO Auto-generated method stub - CategoryEntity category = (CategoryEntity) categoryDao.getEntity(categoryId); + CategoryEntity category = (CategoryEntity) categoryDao.selectById(categoryId); //删除父类 if(category != null){ category.setCategoryParentId(null); List childrenList = categoryDao.queryChildren(category); - int[] ids = new int[childrenList.size()]; + List ids = new ArrayList<>(); for(int i = 0; i < childrenList.size(); i++){ //删除子类 - ids[i] = Integer.parseInt(childrenList.get(i).getId()); + ids.add(childrenList.get(i).getId()); } - categoryDao.delete(ids); + categoryDao.deleteBatchIds(ids); // 删除文章 - contentDao.deleteEntityByCategoryIds(ids); + contentDao.deleteEntityByCategoryIds(ids.toArray(new String[ids.size()])); + } + } + + /** + * 设置父级叶子节点 + * @param entity + */ + private void setParentLeaf(CategoryEntity entity){ + Assert.notNull(entity); + CategoryEntity categoryEntity = getById(entity.getId()); + //如果父级不为空并且修改了父级则需要更新父级 + if(!entity.getCategoryId().equals(categoryEntity.getCategoryId())){ + //更新旧的父级 + if(StrUtil.isNotBlank(categoryEntity.getCategoryId())&&!"0".equals(categoryEntity.getCategoryId())){ + CategoryEntity parent = getById(categoryEntity.getCategoryId()); + //如果修改了父级则需要判断父级是否还有子节点 + boolean leaf = parent.getLeaf(); + //查找不等于当前更新的分类子集,有则不是叶子节点 + QueryWrapper queryWrapper = new QueryWrapper<>(); + parent.setLeaf(count(queryWrapper.eq("category_id",parent.getId()).ne("id",entity.getId()))==0); + if(leaf!=parent.getLeaf()){ + updateById(parent); + } + + } + //更新新的父级 + if(StrUtil.isNotBlank(entity.getCategoryId())&&!"0".equals(entity.getCategoryId())){ + CategoryEntity parent = getById(entity.getCategoryId()); + //如果之前是叶子节点就更新 + if(parent.getLeaf()){ + parent.setLeaf(false); + updateById(parent); + } + } + } + } + + /** + * 设置顶级id + * @param entity + */ + private void setTopId(CategoryEntity entity){ + String categoryParentId = entity.getCategoryParentId(); + if(StrUtil.isNotBlank(categoryParentId)){ + String[] ids = categoryParentId.split(","); + //如果有ParentId就取第一个 + if(ids.length>0){ + entity.setTopId(ids[0]); + return; + } } + entity.setTopId("0"); } } diff --git a/src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java b/src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java index 0039304ceca15df6307591427e9ad6239ba802ef..7b77cbd2d580850222db80faed7b6c669fc7e3c6 100644 --- a/src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java +++ b/src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java @@ -21,14 +21,32 @@ The MIT License (MIT) * Copyright (c) 2019 铭飞科技 package net.mingsoft.cms.biz.impl; +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.io.FileUtil; +import net.mingsoft.basic.constant.Const; +import net.mingsoft.basic.holder.DataHolder; import net.mingsoft.basic.util.BasicUtil; import net.mingsoft.cms.bean.CategoryBean; import net.mingsoft.cms.bean.ContentBean; +import net.mingsoft.cms.dao.ICategoryDao; +import net.mingsoft.cms.entity.CategoryEntity; +import net.mingsoft.cms.entity.ContentEntity; +import net.mingsoft.cms.util.CmsParserUtil; +import net.mingsoft.mdiy.bean.AttributeBean; +import net.mingsoft.mdiy.bean.PageBean; import net.mingsoft.mdiy.entity.ModelEntity; +import net.mingsoft.mdiy.util.ParserUtil; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import net.mingsoft.base.biz.impl.BaseBizImpl; import net.mingsoft.base.dao.IBaseDao; + +import java.io.IOException; import java.util.*; import net.mingsoft.cms.biz.IContentBiz; @@ -41,13 +59,22 @@ import net.mingsoft.cms.dao.IContentDao; * 历史修订:
*/ @Service("cmscontentBizImpl") -public class ContentBizImpl extends BaseBizImpl implements IContentBiz { +public class ContentBizImpl extends BaseBizImpl implements IContentBiz { + + /* + * log4j日志记录 + */ + protected final Logger LOG = LoggerFactory.getLogger(this.getClass()); - @Autowired private IContentDao contentDao; - - + /** + * 栏目管理业务层 + */ + @Autowired + private ICategoryDao categoryDao; + + @Override protected IBaseDao getDao() { // TODO Auto-generated method stub @@ -67,4 +94,152 @@ public class ContentBizImpl extends BaseBizImpl implements IContentBiz { } return contentDao.getSearchCount(null,null,whereMap, appId,categoryIds); } + + /* + * 任务调度静态化任务 + */ + public void staticizeTask(Integer appId, String tmpFileName, String generateFileName) { + LOG.info("定时静态化任务", new Date()); + try { + //将任务采集传过来的appId导入到线程变量中 + //当前线程使用appId时优先使用此数据 + DataHolder.set(net.mingsoft.basic.constant.Const.APP_ID, appId); + //调用三种静态化 + genernateColumn(); + generaterIndex(tmpFileName, generateFileName); + //生成文章日期默认为执行日期的上一天 + generateArticle(DateUtil.format(DateUtil.yesterday(), "yyyy-MM-dd")); + LOG.info("静态化完成", new Date()); + } catch (IOException e) { + LOG.info("静态化失败", new Date()); + e.printStackTrace(); + } + } + + /* + * 生成文章逻辑 + */ + private void generateArticle(String dateTime) throws IOException { + // 网站风格物理路径 + List articleIdList = null; + List categoryList = null; + AttributeBean attributeBean = new AttributeBean(); + ContentBean contentBean = new ContentBean(); + contentBean.setBeginTime(dateTime); + Map map = new HashMap<>(); + map.put(net.mingsoft.basic.constant.Const.APP_ID, BasicUtil.getAppId()); + PageBean page = new PageBean(); + map.put(ParserUtil.HTML, ParserUtil.HTML); + map.put(ParserUtil.URL, BasicUtil.getUrl()); + map.put(ParserUtil.PAGE, page); + + CategoryEntity categoryEntity = new CategoryEntity(); + categoryList = categoryDao.query(categoryEntity); + for(CategoryEntity category : categoryList){ + contentBean.setContentCategoryId(category.getId()); + // 分类是列表 + if(category.getCategoryType().equals("1")){ + // 判断模板文件是否存在 + if (!FileUtil.exist(ParserUtil.buildTempletPath(category.getCategoryListUrl())) || StringUtils.isEmpty(category.getCategoryListUrl())) { + LOG.error("模板不存在:{}",category.getCategoryUrl()); + continue; + } + // 获取文章列表表属性 + ParserUtil.read(category.getCategoryListUrl(),map, page,attributeBean); + contentBean.setFlag(attributeBean.getFlag()); + contentBean.setNoflag(attributeBean.getNoflag()); + contentBean.setOrder(attributeBean.getOrder()); + contentBean.setOrderBy(attributeBean.getOrderby()); + } + articleIdList = queryIdsByCategoryIdForParser(contentBean); + // 有符合条件的就更新 + if (articleIdList.size() > 0) { + CmsParserUtil.generateBasic(articleIdList); + } + } + } + + /* + * 生成栏目逻辑 + */ + private void genernateColumn() throws IOException { + List columns = new ArrayList<>(); + // 获取所有的内容管理栏目 + CategoryEntity categoryEntity=new CategoryEntity(); + categoryEntity.setAppId(BasicUtil.getAppId()); + columns = categoryDao.query(categoryEntity); + List articleIdList = null; + // 1、设置模板文件夹路径 + // 获取栏目列表模版 + for (CategoryEntity column : columns) { + ContentBean contentBean = new ContentBean(); + contentBean.setContentCategoryId(column.getId()); + // 分类是列表 + if(column.getCategoryType().equals("1")) { + // 判断模板文件是否存在 + if (!FileUtil.exist(ParserUtil.buildTempletPath(column.getCategoryListUrl()))) { + LOG.error("模板不存在:{}", column.getCategoryUrl()); + continue; + } + //获取模板中列表标签中的条件 + Map map = new HashMap<>(); + map.put(net.mingsoft.basic.constant.Const.APP_ID, BasicUtil.getAppId()); + PageBean page = new PageBean(); + map.put(ParserUtil.HTML, ParserUtil.HTML); + map.put(ParserUtil.URL, BasicUtil.getUrl()); + map.put(ParserUtil.PAGE, page); + AttributeBean attributeBean = new AttributeBean(); + // 获取文章列表模板标签属性 + ParserUtil.read(column.getCategoryListUrl(), map, page, attributeBean); + contentBean.setFlag(attributeBean.getFlag()); + contentBean.setNoflag(attributeBean.getNoflag()); + contentBean.setOrder(attributeBean.getOrder()); + contentBean.setOrderBy(attributeBean.getOrderby()); + } + articleIdList = contentDao.queryIdsByCategoryIdForParser(contentBean); + // 判断列表类型 + switch (column.getCategoryType()) { + //TODO 暂时先用字符串代替 + case "1": // 列表 + CmsParserUtil.generateList(column, articleIdList.size()); + break; + case "2":// 单页 + if(articleIdList.size()==0){ + CategoryBean columnArticleIdBean=new CategoryBean(); + CopyOptions copyOptions=CopyOptions.create(); + copyOptions.setIgnoreError(true); + BeanUtil.copyProperties(column,columnArticleIdBean,copyOptions); + articleIdList.add(columnArticleIdBean); + } + CmsParserUtil.generateBasic(articleIdList); + break; + } + } + } + + /* + * 生成主页逻辑 + */ + private void generaterIndex(String templatePath, String targetPath) throws IOException { + if (!FileUtil.exist(ParserUtil.buildTempletPath())) { + LOG.info("模板文件不存在"); + return; + } + Map map = new HashMap(); + map.put(ParserUtil.IS_DO, false); + CategoryEntity column = new CategoryEntity(); + //内容管理栏目编码 + map.put(ParserUtil.COLUMN, column); + //如果单站点,就废弃站点地址 + if (ParserUtil.IS_SINGLE) { + map.put(ParserUtil.URL, BasicUtil.getUrl()); + } + //设置生成的路径 + map.put(ParserUtil.HTML, ParserUtil.HTML); + //设置站点编号 + map.put(Const.APP_ID, BasicUtil.getAppId()); + String read = ParserUtil.read(templatePath, map); + FileUtil.writeString(read, ParserUtil.buildHtmlPath(targetPath), net.mingsoft.base.constant.Const.UTF8); + } + } \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.java b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.java index 388c3ae03b600cffe00f50d6119d29484ade19c7..a59075fd275ed65b280c5cf09a7e775db0bb0a7d 100644 --- a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.java +++ b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.java @@ -1,12 +1,11 @@ package net.mingsoft.cms.dao; import net.mingsoft.base.dao.IBaseDao; -import java.util.*; - import net.mingsoft.cms.entity.CategoryEntity; -import org.apache.ibatis.annotations.Param; import org.springframework.stereotype.Component; +import java.util.List; + /** * 分类持久层 * @author 铭飞开发团队 @@ -14,13 +13,13 @@ import org.springframework.stereotype.Component; * 历史修订:
*/ @Component("cmsCategoryDao") -public interface ICategoryDao extends IBaseDao { +public interface ICategoryDao extends IBaseDao { /** * 查询当前分类下面的所有子分类 * @param category 必须存在categoryId categoryParentId * @return */ - public List queryChildren(CategoryEntity category); + public List queryChildren(CategoryEntity category); } \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml index 89bd650977d1fbda82765846d6f509f56b5589ec..9fdd331d23db10f7a34f369f8cb3f77565cbfe2d 100644 --- a/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml +++ b/src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml @@ -49,7 +49,6 @@ mdiy_model_id, category_datetime, category_manager_id, - app_id, dict_id, category_flag, category_path, @@ -75,7 +74,6 @@ #{mdiyModelId}, #{categoryDatetime}, #{categoryManagerId}, - #{appId}, #{dictId}, #{categoryFlag}, #{categoryPath}, @@ -107,7 +105,6 @@ mdiy_model_id=#{mdiyModelId}, category_datetime=#{categoryDatetime}, category_manager_id=#{categoryManagerId}, - app_id=#{appId}, dict_id=#{dictId}, category_flag=#{categoryFlag}, category_path=#{categoryPath}, @@ -143,7 +140,6 @@ and mdiy_model_id=#{mdiyModelId} and category_datetime=#{categoryDatetime} and category_manager_id=#{categoryManagerId} - and app_id=#{appId} and dict_id=#{dictId} and category_flag=#{categoryFlag} and category_path=#{categoryPath} @@ -170,9 +166,7 @@ diff --git a/src/main/java/net/mingsoft/cms/dao/IContentDao.java b/src/main/java/net/mingsoft/cms/dao/IContentDao.java index 645dc1af686ffe3b4650290ba57f66403ae29d18..2578771eaa2f2239a6cf4cb8cceebf139be76a51 100644 --- a/src/main/java/net/mingsoft/cms/dao/IContentDao.java +++ b/src/main/java/net/mingsoft/cms/dao/IContentDao.java @@ -1,19 +1,21 @@ package net.mingsoft.cms.dao; import net.mingsoft.base.dao.IBaseDao; -import java.util.*; - import net.mingsoft.cms.bean.CategoryBean; import net.mingsoft.cms.bean.ContentBean; +import net.mingsoft.cms.entity.ContentEntity; import org.apache.ibatis.annotations.Param; +import java.util.List; +import java.util.Map; + /** * 文章持久层 * @author 铭飞开发团队 * 创建日期:2019-11-28 15:12:32
* 历史修订:
*/ -public interface IContentDao extends IBaseDao { +public interface IContentDao extends IBaseDao { /** * 查询文章编号集合 @@ -32,12 +34,12 @@ public interface IContentDao extends IBaseDao { * list[2]:是否是等值查询 list[3]:字段的值 * @return 文章实体总数 */ - int getSearchCount(@Param("tableName") String tableName, @Param("diyList") List diyList,@Param("map") Map map, + int getSearchCount(@Param("tableName") String tableName, @Param("diyList") List diyList, @Param("map") Map map, @Param("websiteId") int websiteId, @Param("ids") String ids); /** * 分类编号删除文章 * @param ids */ - void deleteEntityByCategoryIds(@Param("ids") int[] ids); + void deleteEntityByCategoryIds(@Param("ids") String[] ids); } \ No newline at end of file diff --git a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml index 18dcad9a916c27dc43073d80940ffc363c347022..fe0bfd69677f58f4a460cefe50a9420f3b03a437 100644 --- a/src/main/java/net/mingsoft/cms/dao/IContentDao.xml +++ b/src/main/java/net/mingsoft/cms/dao/IContentDao.xml @@ -43,7 +43,6 @@ - @@ -67,7 +66,6 @@ - @@ -98,7 +96,6 @@ content_details, content_url, content_hit, - app_id, create_by, create_date, update_by, @@ -120,7 +117,6 @@ #{contentDetails}, #{contentUrl}, #{contentHit}, - #{appId}, #{createBy}, #{createDate}, #{updateBy}, @@ -147,7 +143,6 @@ content_details=#{contentDetails}, content_url=#{contentUrl}, content_hit=#{contentHit}, - app_id=#{appId}, create_by=#{createBy}, create_date=#{createDate}, update_by=#{updateBy}, @@ -181,7 +176,6 @@ and content_details=#{contentDetails} and content_url=#{contentUrl} and content_hit=#{contentHit} - and app_id=#{appId} and create_by=#{createBy} and create_date=#{createDate} and update_by=#{updateBy} @@ -219,7 +213,7 @@ @@ -261,13 +254,11 @@