Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
MCMS
Commits
3b8fb103
Commit
3b8fb103
authored
Dec 22, 2020
by
xierz
Browse files
Merge branch 'master' into adaptive-oracle-mysql
parents
b2d5a442
b19dccc6
Changes
10
Hide whitespace changes
Inline
Side-by-side
doc/5.2-patch.sql
View file @
3b8fb103
...
...
@@ -203,3 +203,28 @@ ALTER TABLE `log`
MODIFY
COLUMN
`log_error_msg`
text
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'错误消息'
AFTER
`id`
,
MODIFY
COLUMN
`log_result`
text
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'返回参数'
AFTER
`log_error_msg`
,
MODIFY
COLUMN
`log_param`
text
CHARACTER
SET
utf8
COLLATE
utf8_general_ci
NULL
COMMENT
'请求参数'
AFTER
`log_result`
;
alter
table
log
rename
to
logger
;
ALTER
TABLE
`role`
ADD
COLUMN
`create_by`
int
(
10
)
NULL
COMMENT
'创建人'
,
ADD
COLUMN
`create_date`
datetime
(
0
)
NULL
COMMENT
'创建时间'
,
ADD
COLUMN
`update_by`
int
(
10
)
NULL
COMMENT
'更新人'
,
ADD
COLUMN
`update_date`
datetime
(
0
)
NULL
COMMENT
'更新时间'
,
ADD
COLUMN
`del`
int
(
1
)
NULL
COMMENT
'删除标识'
;
ALTER
TABLE
`model`
ADD
COLUMN
`create_by`
int
(
10
)
NULL
COMMENT
'创建人'
,
ADD
COLUMN
`create_date`
datetime
(
0
)
NULL
COMMENT
'创建时间'
,
ADD
COLUMN
`update_by`
int
(
10
)
NULL
COMMENT
'更新人'
,
ADD
COLUMN
`update_date`
datetime
(
0
)
NULL
COMMENT
'更新时间'
,
ADD
COLUMN
`del`
int
(
1
)
NULL
COMMENT
'删除标识'
;
ALTER
TABLE
`people`
ADD
COLUMN
`create_by`
int
(
10
)
NULL
COMMENT
'创建人'
,
ADD
COLUMN
`create_date`
datetime
(
0
)
NULL
COMMENT
'创建时间'
,
ADD
COLUMN
`update_by`
int
(
10
)
NULL
COMMENT
'更新人'
,
ADD
COLUMN
`update_date`
datetime
(
0
)
NULL
COMMENT
'更新时间'
,
ADD
COLUMN
`del`
int
(
1
)
NULL
COMMENT
'删除标识'
;
pom.xml
View file @
3b8fb103
...
...
@@ -10,7 +10,7 @@
<modelVersion>
4.0.0
</modelVersion>
<groupId>
net.mingsoft
</groupId>
<artifactId>
ms-mcms
</artifactId>
<version>
5.2.
0
-SNAPSHOT
</version>
<version>
5.2.
1
-SNAPSHOT
</version>
<name>
ms-mcms
</name>
<!-- 打包jar包 -->
<packaging>
jar
</packaging>
...
...
src/main/java/net/mingsoft/cms/biz/ICacheBiz.java
deleted
100644 → 0
View file @
b2d5a442
package
net.mingsoft.cms.biz
;
public
interface
ICacheBiz
{
void
set
(
String
cacheName
,
String
key
,
Object
value
);
<
T
>
T
get
(
String
cacheName
,
String
key
,
Class
<
T
>
cls
);
void
del
(
String
cacheName
,
String
key
);
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/biz/impl/ContentBizImpl.java
View file @
3b8fb103
...
...
@@ -22,37 +22,23 @@
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.base.biz.impl.BaseBizImpl
;
import
net.mingsoft.base.dao.IBaseDao
;
import
net.mingsoft.cms.bean.CategoryBean
;
import
net.mingsoft.cms.bean.ContentBean
;
import
net.mingsoft.cms.
constant.e.CategoryTypeEnum
;
import
net.mingsoft.cms.
biz.IContentBiz
;
import
net.mingsoft.cms.dao.ICategoryDao
;
import
net.mingsoft.cms.
entity.CategoryEntity
;
import
net.mingsoft.cms.
dao.IContentDao
;
import
net.mingsoft.cms.entity.ContentEntity
;
import
net.mingsoft.cms.util.CmsParserUtil
;
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.beans.factory.annotation.Value
;
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
;
import
net.mingsoft.cms.dao.IContentDao
;
import
java.util.List
;
import
java.util.Map
;
/**
* 文章管理持久化层
...
...
src/main/java/net/mingsoft/cms/biz/impl/EhcacheBizImpl.java
deleted
100644 → 0
View file @
b2d5a442
package
net.mingsoft.cms.biz.impl
;
import
com.alibaba.fastjson.JSONObject
;
import
net.mingsoft.cms.biz.ICacheBiz
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.cache.CacheManager
;
import
org.springframework.stereotype.Service
;
@Service
(
"abc"
)
public
class
EhcacheBizImpl
implements
ICacheBiz
{
@Autowired
private
CacheManager
cacheManager
;
@Override
public
void
set
(
String
cacheName
,
String
key
,
Object
value
)
{
this
.
cacheManager
.
getCache
(
cacheName
).
put
(
key
,
JSONObject
.
toJSONString
(
value
));
}
@Override
public
<
T
>
T
get
(
String
cacheName
,
String
key
,
Class
<
T
>
cls
)
{
String
str
=
this
.
cacheManager
.
getCache
(
cacheName
).
get
(
key
,
String
.
class
);
if
(
StringUtils
.
isBlank
(
str
))
{
return
null
;
}
return
JSONObject
.
parseObject
(
str
,
cls
);
}
@Override
public
void
del
(
String
cacheName
,
String
key
)
{
this
.
cacheManager
.
getCache
(
cacheName
).
evictIfPresent
(
key
);
}
}
\ No newline at end of file
src/main/java/net/mingsoft/cms/dao/ICategoryDao.java
View file @
3b8fb103
...
...
@@ -20,7 +20,6 @@
*/
package
net.mingsoft.cms.dao
;
import
com.baomidou.mybatisplus.annotation.SqlParser
;
import
net.mingsoft.base.dao.IBaseDao
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
org.springframework.stereotype.Component
;
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
3b8fb103
...
...
@@ -307,13 +307,13 @@
and FIND_IN_SET(a.category_id,#{ids})>0
</if>
<if
test=
"map.content_title!=null"
>
and a.content_title like CONCAT(CONCAT(
"%"
,#{map.content_title}),
"%"
)
and a.content_title like CONCAT(CONCAT(
'%'
,#{map.content_title}),
'%'
)
</if>
<if
test=
"map.content_author!=null"
>
and a.content_author like CONCAT(CONCAT(
"%"
,#{map.content_author}),
"%"
)
and a.content_author like CONCAT(CONCAT(
'%'
,#{map.content_author}),
'%'
)
</if>
<if
test=
"map.content_source!=null"
>
and a.content_source like CONCAT(CONCAT(
"%"
,#{map.content_source}),
"%"
)
and a.content_source like CONCAT(CONCAT(
'%'
,#{map.content_source}),
'%'
)
</if>
<if
test=
"map.content_type!=null"
>
and
<foreach
item=
"item"
index=
"index"
collection=
"map.content_type.split(',')"
open=
"("
separator=
"or"
close=
")"
>
...
...
@@ -321,13 +321,13 @@
</foreach>
</if>
<if
test=
"map.content_description!=null"
>
and a.content_description like CONCAT(CONCAT(
"%"
,#{map.content_description}),
"%"
)
and a.content_description like CONCAT(CONCAT(
'%'
,#{map.content_description}),
'%'
)
</if>
<if
test=
"map.content_keyword!=null"
>
and a.content_keyword like CONCAT(CONCAT(
"%"
,#{map.content_keyword}),
"%"
)
and a.content_keyword like CONCAT(CONCAT(
'%'
,#{map.content_keyword}),
'%'
)
</if>
<if
test=
"map.content_details!=null"
>
and a.content_details like CONCAT(CONCAT(
"%"
,#{map.content_details}),
"%"
)
and a.content_details like CONCAT(CONCAT(
'%'
,#{map.content_details}),
'%'
)
</if>
<if
test=
"map.content_datetime_start!=null and map.content_datetime_end!=null"
>
<if
test=
"_databaseId == 'mysql'"
>
...
...
@@ -341,7 +341,7 @@
<if
test=
"tableName!=null and tableName!='' and diyMap!=null"
>
<foreach
item=
"item"
index=
"index"
collection=
"diyList"
open=
""
separator=
""
close=
""
>
and d.${field.key} like CONCAT(CONCAT(
"%"
,#{item.value}),
"%"
)
and d.${field.key} like CONCAT(CONCAT(
'%'
,#{item.value}),
'%'
)
</foreach>
</if>
</where>
...
...
src/main/java/net/mingsoft/cms/util/CmsParserUtil.java
View file @
3b8fb103
...
...
@@ -27,7 +27,6 @@ import freemarker.core.ParseException;
import
freemarker.template.MalformedTemplateNameException
;
import
freemarker.template.TemplateNotFoundException
;
import
net.mingsoft.base.constant.Const
;
import
net.mingsoft.basic.holder.DataHolder
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.basic.util.SpringUtil
;
import
net.mingsoft.cms.bean.CategoryBean
;
...
...
src/main/resources/application.yml
View file @
3b8fb103
...
...
@@ -96,6 +96,6 @@ mybatis-plus:
db-config
:
id-type
:
auto
configuration
:
database-id
:
oracle
database-id
:
mysql
cache-enabled
:
true
jdbc-type-for-null
:
'
null'
#注意:单引号
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
View file @
3b8fb103
...
...
@@ -11,7 +11,7 @@
<el-header class="ms-header" height="50px">
<el-col :span="12">
<@shiro.hasPermission name="cms:content:save">
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save(
0
)">新增</el-button>
<el-button type="primary" icon="el-icon-plus" size="mini" @click="save()">新增</el-button>
</@shiro.hasPermission>
<@shiro.hasPermission name="cms:content:del">
<el-button type="danger" icon="el-icon-delete" size="mini" @click="del(selectionList)" :disabled="!selectionList.length">删除</el-button>
...
...
@@ -368,13 +368,18 @@
},
//新增
save
:
function
(
id
)
{
//
id
有值时编辑
if
(
id
)
{
location
.href
=
this
.manager
+
"/cms/content/form.do?id="
+
id
;
}
else
if
(
id
==
0
){
//在全部栏目下新增文章
location
.href
=
this
.manager
+
"/cms/content/form.do"
;
}
else
{
location
.href
=
this
.manager
+
"/cms/content/form.do?categoryId="
+
this
.form.categoryId
;
}
else
{
//根据当前栏目新增时自动选中栏目
var
categoryId
=
this
.form.categoryId
;
if
(
categoryId
)
{
location
.href
=
this
.manager
+
"/cms/content/form.do?categoryId="
+
this
.form.categoryId
;
}
else
{
//如果栏目
id
没有值就单纯的新增,不自动选定栏目
location
.href
=
this
.manager
+
"/cms/content/form.do"
;
}
}
},
//表格数据转换
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment