Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
C
cms_sys
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
西魏
cms_sys
Commits
f78bbc93
Commit
f78bbc93
authored
May 07, 2022
by
mingsoft
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 规范模版、规范接口、修复issues BUG
parent
af449b4c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
162 additions
and
251 deletions
+162
-251
EditorAction.java
...main/java/net/mingsoft/basic/action/web/EditorAction.java
+0
-83
CategoryAction.java
src/main/java/net/mingsoft/cms/action/CategoryAction.java
+0
-0
ContentAction.java
src/main/java/net/mingsoft/cms/action/ContentAction.java
+22
-42
CategoryAction.java
...main/java/net/mingsoft/cms/action/web/CategoryAction.java
+3
-24
ContentAction.java
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
+14
-20
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+4
-4
ICategoryDao.xml
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
+1
-1
IContentDao.xml
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
+12
-13
WebConfig.java
src/main/java/net/mingsoft/config/WebConfig.java
+42
-12
form.ftl
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
+1
-1
index.ftl
src/main/webapp/WEB-INF/manager/index.ftl
+0
-0
about.htm
src/main/webapp/template/1/default/about.htm
+1
-1
index.htm
src/main/webapp/template/1/default/index.htm
+58
-2
message.htm
src/main/webapp/template/1/default/message.htm
+0
-0
nav.htm
src/main/webapp/template/1/default/nav.htm
+0
-44
news-detail.htm
src/main/webapp/template/1/default/news-detail.htm
+0
-0
news-list.htm
src/main/webapp/template/1/default/news-list.htm
+1
-1
product-detail.htm
src/main/webapp/template/1/default/product-detail.htm
+1
-1
product-list.htm
src/main/webapp/template/1/default/product-list.htm
+1
-1
search.htm
src/main/webapp/template/1/default/search.htm
+1
-1
No files found.
src/main/java/net/mingsoft/basic/action/web/EditorAction.java
deleted
100755 → 0
View file @
af449b4c
/**
* The MIT License (MIT)
* Copyright (c) 2012-2022 铭软科技(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
.
basic
.
action
.
web
;
import
cn.hutool.core.io.FileUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.mingsoft.ueditor.MsUeditorActionEnter
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.config.MSProperties
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Map
;
/**
* 临时修复:百度编辑器上传,会在下一版本合并
*
* @author 铭软开发团队
* @date 2019年7月16日
* 历史修订 2022-1-21 新增normalize(),
* editor()方法过滤非法上传路径
*/
@ApiIgnore
@Controller
(
"ueAction"
)
@RequestMapping
(
"/static/plugins/ueditor/{version}/jsp"
)
public
class
EditorAction
{
@ResponseBody
@RequestMapping
(
value
=
"editor"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
public
String
editor
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
jsonConfig
)
{
String
uploadFloderPath
=
MSProperties
.
upload
.
path
;
String
rootPath
=
BasicUtil
.
getRealPath
(
uploadFloderPath
);
jsonConfig
=
jsonConfig
.
replace
(
"{ms.upload}"
,
"/"
+
uploadFloderPath
);
//过滤非法上传路径
Map
<
String
,
Object
>
map
=
(
Map
<
String
,
Object
>)
JSONObject
.
parse
(
jsonConfig
);
String
imagePathFormat
=
(
String
)
map
.
get
(
"imagePathFormat"
);
imagePathFormat
=
FileUtil
.
normalize
(
imagePathFormat
);
String
filePathFormat
=
(
String
)
map
.
get
(
"filePathFormat"
);
filePathFormat
=
FileUtil
.
normalize
(
filePathFormat
);
String
videoPathFormat
=
(
String
)
map
.
get
(
"videoPathFormat"
);
videoPathFormat
=
FileUtil
.
normalize
(
videoPathFormat
);
map
.
put
(
"imagePathFormat"
,
imagePathFormat
);
map
.
put
(
"filePathFormat"
,
filePathFormat
);
map
.
put
(
"videoPathFormat"
,
videoPathFormat
);
jsonConfig
=
JSONObject
.
toJSONString
(
map
);
MsUeditorActionEnter
actionEnter
=
new
MsUeditorActionEnter
(
request
,
rootPath
,
jsonConfig
,
BasicUtil
.
getRealPath
(
""
));
String
json
=
actionEnter
.
exec
();
Map
jsonMap
=
JSON
.
parseObject
(
json
,
Map
.
class
);
jsonMap
.
put
(
"url"
,
"/"
.
concat
(
uploadFloderPath
).
concat
(
jsonMap
.
get
(
"url"
)+
""
));
return
JSONObject
.
toJSONString
(
jsonMap
);
}
}
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
f78bbc93
This diff is collapsed.
Click to expand it.
src/main/java/net/mingsoft/cms/action/ContentAction.java
View file @
f78bbc93
...
@@ -85,14 +85,15 @@ public class ContentAction extends BaseAction {
...
@@ -85,14 +85,15 @@ public class ContentAction extends BaseAction {
* 返回主界面index
* 返回主界面index
*/
*/
@GetMapping
(
"/index"
)
@GetMapping
(
"/index"
)
public
String
index
(
HttpServletResponse
response
,
HttpServletRequest
request
){
public
String
index
(){
return
"/cms/content/index"
;
return
"/cms/content/index"
;
}
}
/**
/**
* 返回主界面main
* 返回主界面main
*/
*/
@GetMapping
(
"/main"
)
@GetMapping
(
"/main"
)
public
String
main
(
HttpServletResponse
response
,
HttpServletRequest
request
){
public
String
main
(){
return
"/cms/content/main"
;
return
"/cms/content/main"
;
}
}
...
@@ -109,23 +110,10 @@ public class ContentAction extends BaseAction {
...
@@ -109,23 +110,10 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam
(
name
=
"contentAuthor"
,
value
=
"文章作者"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentAuthor"
,
value
=
"文章作者"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentSource"
,
value
=
"文章来源"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentSource"
,
value
=
"文章来源"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDatetime"
,
value
=
"发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDatetime"
,
value
=
"发布时间"
,
required
=
false
,
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
(
"/list"
)
@PostMapping
(
"/list"
)
@ResponseBody
@ResponseBody
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
ContentBean
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
ContentBean
content
)
{
BasicUtil
.
startPage
();
BasicUtil
.
startPage
();
List
contentList
=
contentBiz
.
query
(
content
);
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
()));
...
@@ -135,7 +123,7 @@ public class ContentAction extends BaseAction {
...
@@ -135,7 +123,7 @@ public class ContentAction extends BaseAction {
* 返回编辑界面content_form
* 返回编辑界面content_form
*/
*/
@GetMapping
(
"/form"
)
@GetMapping
(
"/form"
)
public
String
form
(
@ModelAttribute
ContentEntity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
ModelMap
model
){
public
String
form
(
@ModelAttribute
ContentEntity
content
,
ModelMap
model
){
model
.
addAttribute
(
"appId"
,
BasicUtil
.
getApp
().
getAppId
());
model
.
addAttribute
(
"appId"
,
BasicUtil
.
getApp
().
getAppId
());
return
"/cms/content/form"
;
return
"/cms/content/form"
;
}
}
...
@@ -144,17 +132,18 @@ public class ContentAction extends BaseAction {
...
@@ -144,17 +132,18 @@ public class ContentAction extends BaseAction {
* 获取文章
* 获取文章
* @param content 文章实体
* @param content 文章实体
*/
*/
@ApiOperation
(
value
=
"获取文章
列表
接口"
)
@ApiOperation
(
value
=
"获取文章
详情
接口"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@GetMapping
(
"/get"
)
@GetMapping
(
"/get"
)
@ResponseBody
@ResponseBody
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
){
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
){
if
(
content
.
getId
()==
null
)
{
if
(
content
.
getId
()==
null
)
{
return
ResultData
.
build
().
error
();
return
ResultData
.
build
().
error
();
}
}
ContentEntity
_content
=
contentBiz
.
getById
(
content
.
getId
());
ContentEntity
_content
=
contentBiz
.
getById
(
content
.
getId
());
return
ResultData
.
build
().
success
(
_content
);
return
ResultData
.
build
().
success
(
_content
);
}
}
/**
/**
* 获取文章
* 获取文章
* @param content 文章实体
* @param content 文章实体
...
@@ -174,6 +163,12 @@ public class ContentAction extends BaseAction {
...
@@ -174,6 +163,12 @@ public class ContentAction extends BaseAction {
return
ResultData
.
build
().
success
(
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
);
return
ResultData
.
build
().
success
(
list
.
size
()
>
0
?
list
.
get
(
0
)
:
null
);
}
}
/**
* 保存文章
* @param content 文章实体
*/
@ApiOperation
(
value
=
"保存文章列表接口"
)
@ApiOperation
(
value
=
"保存文章列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contentTitle"
,
value
=
"文章标题"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentTitle"
,
value
=
"文章标题"
,
required
=
true
,
paramType
=
"query"
),
...
@@ -189,24 +184,12 @@ public class ContentAction extends BaseAction {
...
@@ -189,24 +184,12 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam
(
name
=
"contentKeyword"
,
value
=
"关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentKeyword"
,
value
=
"关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDetails"
,
value
=
"文章内容"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDetails"
,
value
=
"文章内容"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentUrl"
,
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"
)
@PostMapping
(
"/save"
)
@ResponseBody
@ResponseBody
@LogAnn
(
title
=
"保存文章"
,
businessType
=
BusinessTypeEnum
.
INSERT
)
@LogAnn
(
title
=
"保存文章"
,
businessType
=
BusinessTypeEnum
.
INSERT
)
@RequiresPermissions
(
"cms:content:save"
)
@RequiresPermissions
(
"cms:content:save"
)
public
ResultData
save
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
public
ResultData
save
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
)
{
//验证文章标题的值是否合法
//验证文章标题的值是否合法
if
(
StringUtil
.
isBlank
(
content
.
getContentTitle
())){
if
(
StringUtil
.
isBlank
(
content
.
getContentTitle
())){
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.title"
)));
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.title"
)));
...
@@ -235,11 +218,15 @@ public class ContentAction extends BaseAction {
...
@@ -235,11 +218,15 @@ public class ContentAction extends BaseAction {
* @param contents 文章实体
* @param contents 文章实体
*/
*/
@ApiOperation
(
value
=
"批量删除文章列表接口"
)
@ApiOperation
(
value
=
"批量删除文章列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contents"
,
value
=
"文章集合"
,
allowMultiple
=
true
,
dataType
=
"ContentEntity"
,
required
=
true
)
})
@PostMapping
(
"/delete"
)
@PostMapping
(
"/delete"
)
@ResponseBody
@ResponseBody
@LogAnn
(
title
=
"删除文章"
,
businessType
=
BusinessTypeEnum
.
DELETE
)
@LogAnn
(
title
=
"删除文章"
,
businessType
=
BusinessTypeEnum
.
DELETE
)
@RequiresPermissions
(
"cms:content:del"
)
@RequiresPermissions
(
"cms:content:del"
)
public
ResultData
delete
(
@RequestBody
List
<
ContentEntity
>
contents
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
public
ResultData
delete
(
@RequestBody
List
<
ContentEntity
>
contents
)
{
List
<
String
>
ids
=
new
ArrayList
<>();
List
<
String
>
ids
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
contents
.
size
();
i
++){
for
(
int
i
=
0
;
i
<
contents
.
size
();
i
++){
ids
.
add
(
contents
.
get
(
i
).
getId
());
ids
.
add
(
contents
.
get
(
i
).
getId
());
...
@@ -260,6 +247,7 @@ public class ContentAction extends BaseAction {
...
@@ -260,6 +247,7 @@ public class ContentAction extends BaseAction {
contentBiz
.
removeByIds
(
ids
);
contentBiz
.
removeByIds
(
ids
);
return
ResultData
.
build
().
success
();
return
ResultData
.
build
().
success
();
}
}
/**
/**
* 更新文章列表
* 更新文章列表
* @param content 文章实体
* @param content 文章实体
...
@@ -280,20 +268,12 @@ public class ContentAction extends BaseAction {
...
@@ -280,20 +268,12 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam
(
name
=
"contentKeyword"
,
value
=
"关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentKeyword"
,
value
=
"关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDetails"
,
value
=
"文章内容"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDetails"
,
value
=
"文章内容"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentUrl"
,
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"
)
@PostMapping
(
"/update"
)
@ResponseBody
@ResponseBody
@LogAnn
(
title
=
"更新文章"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@LogAnn
(
title
=
"更新文章"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@RequiresPermissions
(
"cms:content:update"
)
@RequiresPermissions
(
"cms:content:update"
)
public
ResultData
update
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
public
ResultData
update
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
)
{
HttpServletRequest
request
)
{
//验证文章标题的值是否合法
//验证文章标题的值是否合法
if
(
StringUtil
.
isBlank
(
content
.
getContentTitle
())){
if
(
StringUtil
.
isBlank
(
content
.
getContentTitle
())){
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.title"
)));
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.title"
)));
...
...
src/main/java/net/mingsoft/cms/action/web/CategoryAction.java
View file @
f78bbc93
...
@@ -66,31 +66,10 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -66,31 +66,10 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiOperation
(
value
=
"查询分类列表接口"
)
@ApiOperation
(
value
=
"查询分类列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
false
,
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
=
"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"
),
})
})
@
RequestMapping
(
value
=
"/list"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@
PostMapping
(
value
=
"/list"
)
@ResponseBody
@ResponseBody
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
BasicUtil
.
startPage
();
BasicUtil
.
startPage
();
List
categoryList
=
categoryBiz
.
query
(
category
);
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
()));
...
@@ -105,7 +84,7 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -105,7 +84,7 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@GetMapping
(
"/get"
)
@GetMapping
(
"/get"
)
@ResponseBody
@ResponseBody
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
){
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
){
if
(
category
.
getId
()==
null
)
{
if
(
category
.
getId
()==
null
)
{
return
ResultData
.
build
().
error
();
return
ResultData
.
build
().
error
();
}
}
...
...
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
View file @
f78bbc93
...
@@ -69,8 +69,9 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -69,8 +69,9 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
private
IHistoryLogBiz
historyLogBiz
;
private
IHistoryLogBiz
historyLogBiz
;
/**
/**
* 查询文章列表
* 查询文章列表接口
* @param content 文章实体
* @param content 文章
* @return
*/
*/
@ApiOperation
(
value
=
"查询文章列表接口"
)
@ApiOperation
(
value
=
"查询文章列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
...
@@ -81,23 +82,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -81,23 +82,10 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam
(
name
=
"contentAuthor"
,
value
=
"文章作者"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentAuthor"
,
value
=
"文章作者"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentSource"
,
value
=
"文章来源"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentSource"
,
value
=
"文章来源"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDatetime"
,
value
=
"发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentDatetime"
,
value
=
"发布时间"
,
required
=
false
,
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
(
"/list"
)
@PostMapping
(
"/list"
)
@ResponseBody
@ResponseBody
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
ContentBean
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
ContentBean
content
)
{
BasicUtil
.
startPage
();
BasicUtil
.
startPage
();
List
contentList
=
contentBiz
.
query
(
content
);
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
()));
...
@@ -105,14 +93,15 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -105,14 +93,15 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
/**
/**
* 获取文章
* 获取文章列表接口
* @param content 文章实体
* @param content 文章
* @return
*/
*/
@ApiOperation
(
value
=
"获取文章列表接口"
)
@ApiOperation
(
value
=
"获取文章列表接口"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@GetMapping
(
"/get"
)
@GetMapping
(
"/get"
)
@ResponseBody
@ResponseBody
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
){
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
){
if
(
content
.
getId
()==
null
)
{
if
(
content
.
getId
()==
null
)
{
return
ResultData
.
build
().
error
();
return
ResultData
.
build
().
error
();
}
}
...
@@ -120,11 +109,16 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -120,11 +109,16 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
return
ResultData
.
build
().
success
(
_content
);
return
ResultData
.
build
().
success
(
_content
);
}
}
/**
* 查看文章点击数
* @param contentId 文章编号
* @return
*/
@ApiOperation
(
value
=
"查看文章点击数"
)
@ApiOperation
(
value
=
"查看文章点击数"
)
@ApiImplicitParam
(
name
=
"contentId"
,
value
=
"文章编号"
,
required
=
true
,
paramType
=
"path"
)
@ApiImplicitParam
(
name
=
"contentId"
,
value
=
"文章编号"
,
required
=
true
,
paramType
=
"path"
)
@GetMapping
(
value
=
"/{contentId}/hit"
)
@GetMapping
(
value
=
"/{contentId}/hit"
)
@ResponseBody
@ResponseBody
public
String
hit
(
@PathVariable
@ApiIgnore
String
contentId
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
hit
(
@PathVariable
@ApiIgnore
String
contentId
)
{
if
(
StringUtils
.
isEmpty
(
contentId
)){
if
(
StringUtils
.
isEmpty
(
contentId
)){
return
"document.write(0)"
;
return
"document.write(0)"
;
}
}
...
...
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
f78bbc93
...
@@ -151,10 +151,10 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -151,10 +151,10 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
map
.
put
(
k
,
v
.
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
));
map
.
put
(
k
,
v
.
toString
().
replaceAll
(
"('|\"|\\\\)"
,
"\\\\$1"
));
});
});
//获取栏目编号
//获取栏目编号
int
typeId
=
BasicUtil
.
getInt
(
ParserUtil
.
TYPE_ID
,
0
);
String
typeId
=
BasicUtil
.
getString
(
ParserUtil
.
TYPE_ID
);
int
size
=
BasicUtil
.
getInt
(
"size"
,
10
);
int
size
=
BasicUtil
.
getInt
(
"size"
,
10
);
ContentBean
contentBean
=
new
ContentBean
();
ContentBean
contentBean
=
new
ContentBean
();
contentBean
.
setCategoryId
(
String
.
valueOf
(
typeId
)
);
contentBean
.
setCategoryId
(
typeId
);
//获取文章总数
//获取文章总数
List
<
CategoryBean
>
columnArticles
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
List
<
CategoryBean
>
columnArticles
=
contentBiz
.
queryIdsByCategoryIdForParser
(
contentBean
);
//判断栏目下是否有文章
//判断栏目下是否有文章
...
@@ -203,7 +203,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -203,7 +203,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
@ResponseBody
@ResponseBody
public
String
view
(
String
orderby
,
String
order
,
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
public
String
view
(
String
orderby
,
String
order
,
HttpServletRequest
req
,
HttpServletResponse
resp
)
{
//参数文章编号
//参数文章编号
ContentEntity
article
=
(
ContentEntity
)
contentBiz
.
getEntity
(
BasicUtil
.
getInt
(
ParserUtil
.
ID
));
ContentEntity
article
=
contentBiz
.
getById
(
BasicUtil
.
getString
(
ParserUtil
.
ID
));
if
(
ObjectUtil
.
isNull
(
article
))
{
if
(
ObjectUtil
.
isNull
(
article
))
{
throw
new
BusinessException
(
this
.
getResString
(
"err.empty"
,
this
.
getResString
(
"id"
)));
throw
new
BusinessException
(
this
.
getResString
(
"err.empty"
,
this
.
getResString
(
"id"
)));
}
}
...
@@ -219,7 +219,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -219,7 +219,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
//用于详情上下页获取当前文章列表对应的分类,根据文章查询只能获取自身分类
//用于详情上下页获取当前文章列表对应的分类,根据文章查询只能获取自身分类
String
typeId
=
BasicUtil
.
getString
(
ParserUtil
.
TYPE_ID
,
article
.
getCategoryId
());
String
typeId
=
BasicUtil
.
getString
(
ParserUtil
.
TYPE_ID
,
article
.
getCategoryId
());
//根据文章编号查询栏目详情模版
//根据文章编号查询栏目详情模版
CategoryEntity
column
=
(
CategoryEntity
)
categoryBiz
.
getEntity
(
Integer
.
parseInt
(
typeId
)
);
CategoryEntity
column
=
categoryBiz
.
getById
(
typeId
);
//解析后的内容
//解析后的内容
String
content
=
""
;
String
content
=
""
;
Map
map
=
BasicUtil
.
assemblyRequestMap
();
Map
map
=
BasicUtil
.
assemblyRequestMap
();
...
...
src/main/java/net/mingsoft/cms/dao/ICategoryDao.xml
View file @
f78bbc93
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
</if>
</if>
and
and
(
(
find_in_set(
'${id}'
,CATEGORY_PARENT_IDS)>0
find_in_set(
#{id}
,CATEGORY_PARENT_IDS)>0
or id=#{id}
or id=#{id}
)
)
and del=0
and del=0
...
...
src/main/java/net/mingsoft/cms/dao/IContentDao.xml
View file @
f78bbc93
...
@@ -63,7 +63,6 @@
...
@@ -63,7 +63,6 @@
<result
column=
"category_img"
property=
"categoryImg"
/>
<!--缩略图 -->
<result
column=
"category_img"
property=
"categoryImg"
/>
<!--缩略图 -->
<result
column=
"category_diy_url"
property=
"categoryDiyUrl"
/>
<!--自定义链接 -->
<result
column=
"category_diy_url"
property=
"categoryDiyUrl"
/>
<!--自定义链接 -->
<result
column=
"mdiy_model_id"
property=
"mdiyModelId"
/>
<!--栏目管理的内容模型id -->
<result
column=
"mdiy_model_id"
property=
"mdiyModelId"
/>
<!--栏目管理的内容模型id -->
<result
column=
"category_datetime"
property=
"categoryDatetime"
/>
<!--类别发布时间 -->
<result
column=
"dict_id"
property=
"dictId"
/>
<!--字典对应编号 -->
<result
column=
"dict_id"
property=
"dictId"
/>
<!--字典对应编号 -->
<result
column=
"category_flag"
property=
"categoryFlag"
/>
<!--栏目属性 -->
<result
column=
"category_flag"
property=
"categoryFlag"
/>
<!--栏目属性 -->
<result
column=
"category_path"
property=
"categoryPath"
/>
<!--栏目路径 -->
<result
column=
"category_path"
property=
"categoryPath"
/>
<!--栏目路径 -->
...
@@ -182,14 +181,14 @@
...
@@ -182,14 +181,14 @@
</select>
</select>
<!--删除-->
<!--删除
防止脏数据
-->
<delete
id=
"deleteEntity"
parameterType=
"int"
>
<delete
id=
"deleteEntity"
parameterType=
"int"
>
update cms_content set del=1
where id=#{id}
delete from cms_content
where id=#{id}
</delete>
</delete>
<!--删除-->
<!--删除
防止脏数据
-->
<delete
id=
"deleteEntityByCategoryIds"
>
<delete
id=
"deleteEntityByCategoryIds"
>
update cms_content set del=1
delete from cms_content
<where>
<where>
category_id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
category_id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
...
@@ -198,7 +197,7 @@
...
@@ -198,7 +197,7 @@
<!--批量删除-->
<!--批量删除-->
<delete
id=
"delete"
>
<delete
id=
"delete"
>
update cms_content set del=1
delete from cms_content
<where>
<where>
id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
id in
<foreach
collection=
"ids"
item=
"item"
index=
"index"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
...
@@ -218,12 +217,12 @@
...
@@ -218,12 +217,12 @@
ct.del=0
ct.del=0
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')
</if>
<if
test=
"contentTitle != null and contentTitle != ''"
>
and content_title like CONCAT(CONCAT('%',#{contentTitle}),'%')
</if>
<if
test=
"categoryId != null and categoryId != ''"
>
and (ct.category_id=#{categoryId} or ct.category_id in
<if
test=
"categoryId != null and categoryId != ''"
>
and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set(
'${categoryId}'
,CATEGORY_PARENT_IDS)>0))
</if>
(select id FROM cms_category where find_in_set(
#{categoryId}
,CATEGORY_PARENT_IDS)>0))
</if>
<if
test=
"contentType != null and contentType != ''"
>
<if
test=
"contentType != null and contentType != ''"
>
and
and
<foreach
item=
"item"
index=
"index"
collection=
"contentType.split(',')"
open=
"("
separator=
"or"
<foreach
item=
"item"
index=
"index"
collection=
"contentType.split(',')"
open=
"("
separator=
"or"
close=
")"
>
close=
")"
>
FIND_IN_SET(
'${item}'
,ct.content_type)>0
FIND_IN_SET(
#{item}
,ct.content_type)>0
</foreach>
</foreach>
</if>
</if>
<if
test=
"contentDisplay != null and contentDisplay != ''"
>
and content_display=#{contentDisplay}
</if>
<if
test=
"contentDisplay != null and contentDisplay != ''"
>
and content_display=#{contentDisplay}
</if>
...
@@ -257,7 +256,7 @@
...
@@ -257,7 +256,7 @@
<!-- 查询子栏目数据 -->
<!-- 查询子栏目数据 -->
<if
test=
"categoryId!=null and categoryId!='' and categoryType==1"
>
<if
test=
"categoryId!=null and categoryId!='' and categoryType==1"
>
and (ct.category_id=#{categoryId} or ct.category_id in
and (ct.category_id=#{categoryId} or ct.category_id in
(select id FROM cms_category where find_in_set(
'${categoryId}'
,CATEGORY_PARENT_IDS)>0))
(select id FROM cms_category where find_in_set(
#{categoryId}
,CATEGORY_PARENT_IDS)>0))
</if>
</if>
<if
test=
"categoryId!=null and categoryId!='' and categoryType==2"
>
<if
test=
"categoryId!=null and categoryId!='' and categoryType==2"
>
and ct.category_id=#{categoryId}
and ct.category_id=#{categoryId}
...
@@ -308,7 +307,7 @@
...
@@ -308,7 +307,7 @@
left join cms_category c
left join cms_category c
ON a.category_id
ON a.category_id
= c.id
= c.id
<if
test=
"tableName!=null and tableName!='' and diy
Map
!=null"
>
left join ${tableName} d on d.link_id=a.id
<if
test=
"tableName!=null and tableName!='' and diy
List
!=null"
>
left join ${tableName} d on d.link_id=a.id
</if>
</if>
<where>
<where>
a.del=0
a.del=0
...
@@ -326,7 +325,7 @@
...
@@ -326,7 +325,7 @@
</if>
</if>
<if
test=
"map.content_type!=null"
>
<if
test=
"map.content_type!=null"
>
and
<foreach
item=
"item"
index=
"index"
collection=
"map.content_type.split(',')"
open=
"("
separator=
"or"
close=
")"
>
and
<foreach
item=
"item"
index=
"index"
collection=
"map.content_type.split(',')"
open=
"("
separator=
"or"
close=
")"
>
FIND_IN_SET(
'${item}'
,a.content_type)>0
FIND_IN_SET(
#{item}
,a.content_type)>0
</foreach>
</foreach>
</if>
</if>
<if
test=
"map.content_description!=null"
>
<if
test=
"map.content_description!=null"
>
...
@@ -347,10 +346,10 @@
...
@@ -347,10 +346,10 @@
and a.content_datetime
<
to_date(#{map.content_datetime_end}, 'yyyy-mm-dd hh24:mi:ss')
and a.content_datetime
<
to_date(#{map.content_datetime_end}, 'yyyy-mm-dd hh24:mi:ss')
</if>
</if>
</if>
</if>
<if
test=
"tableName!=null and tableName!='' and diy
Map
!=null"
>
<if
test=
"tableName!=null and tableName!='' and diy
List
!=null"
>
<foreach
item=
"item"
index=
"index"
collection=
"diyList"
open=
""
<foreach
item=
"item"
index=
"index"
collection=
"diyList"
open=
""
separator=
""
close=
""
>
separator=
""
close=
""
>
and d.${
field
.key} like CONCAT(CONCAT('%',#{item.value}),'%')
and d.${
item
.key} like CONCAT(CONCAT('%',#{item.value}),'%')
</foreach>
</foreach>
</if>
</if>
</where>
</where>
...
...
src/main/java/net/mingsoft/config/WebConfig.java
View file @
f78bbc93
...
@@ -21,12 +21,20 @@
...
@@ -21,12 +21,20 @@
package
net
.
mingsoft
.
config
;
package
net
.
mingsoft
.
config
;
import
cn.hutool.core.util.StrUtil
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.pool.DruidDataSource
;
import
com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator
;
import
com.alibaba.druid.support.spring.stat.BeanTypeAutoProxyCreator
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.DeserializationFeature
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
net.mingsoft.basic.filter.XSSEscapeFilter
;
import
net.mingsoft.basic.filter.XSSEscapeFilter
;
import
net.mingsoft.basic.interceptor.ActionInterceptor
;
import
net.mingsoft.basic.interceptor.ActionInterceptor
;
import
net.mingsoft.mdiy.biz.IConfigBiz
;
import
net.mingsoft.mdiy.entity.ConfigEntity
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.boot.web.servlet.FilterRegistrationBean
;
import
org.springframework.boot.web.servlet.ServletListenerRegistrationBean
;
import
org.springframework.boot.web.servlet.ServletListenerRegistrationBean
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Bean
;
...
@@ -41,6 +49,7 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
...
@@ -41,6 +49,7 @@ import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
org.springframework.web.servlet.config.annotation.WebMvcConfigurer
;
import
java.io.File
;
import
java.io.File
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -52,6 +61,8 @@ import java.util.concurrent.TimeUnit;
...
@@ -52,6 +61,8 @@ import java.util.concurrent.TimeUnit;
@Configuration
@Configuration
public
class
WebConfig
implements
WebMvcConfigurer
{
public
class
WebConfig
implements
WebMvcConfigurer
{
@Autowired
(
required
=
false
)
private
IConfigBiz
configBiz
;
@Bean
@Bean
public
ActionInterceptor
actionInterceptor
()
{
public
ActionInterceptor
actionInterceptor
()
{
...
@@ -84,19 +95,20 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -84,19 +95,20 @@ public class WebConfig implements WebMvcConfigurer {
@Override
@Override
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
public
void
addResourceHandlers
(
ResourceHandlerRegistry
registry
)
{
String
uploadMapping
=
MSProperties
.
upload
.
mapping
;
String
uploadMapping
=
MSProperties
.
upload
.
mapping
;
String
uploadF
lo
derPath
=
MSProperties
.
upload
.
path
;
String
uploadF
ol
derPath
=
MSProperties
.
upload
.
path
;
String
template
=
MSProperties
.
upload
.
template
;
String
template
=
MSProperties
.
upload
.
template
;
String
htmlDir
=
MSProperties
.
htmlDir
;
String
htmlDir
=
MSProperties
.
htmlDir
;
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
File
.
separator
+
uploadFloderPath
+
File
.
separator
,
"file:"
+
uploadFloderPath
+
File
.
separator
);
// 上传路径映射 这里的映射不能使用File.separator Windows会存在映射问题
registry
.
addResourceHandler
(
"/template/**"
).
addResourceLocations
(
File
.
separator
+
template
+
File
.
separator
,
"file:"
+
template
+
File
.
separator
);
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
"/"
+
uploadFolderPath
+
"/"
,
"file:"
+
uploadFolderPath
+
"/"
);
registry
.
addResourceHandler
(
"/"
+
template
+
"/**"
).
addResourceLocations
(
"/"
+
template
+
"/"
,
"file:"
+
template
+
"/"
);
registry
.
addResourceHandler
(
"/"
+
htmlDir
+
"/**"
).
addResourceLocations
(
"/"
+
htmlDir
+
"/"
,
"file:"
+
htmlDir
+
"/"
);
registry
.
addResourceHandler
(
"/"
+
htmlDir
+
"/**"
).
addResourceLocations
(
"/"
+
htmlDir
+
"/"
,
"file:"
+
htmlDir
+
"/"
);
//三种映射方式 webapp下、当前目录下、jar内
//三种映射方式 webapp下、当前目录下、jar内
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/app/**"
).
addResourceLocations
(
"/app/"
,
"file:app/"
,
"classpath:/app/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
,
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/static/**"
).
addResourceLocations
(
"/static/"
,
"file:static/"
,
"classpath:/static/"
,
"classpath:/META-INF/resources/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"/api/"
,
"file:api/"
,
"classpath:/api/"
);
registry
.
addResourceHandler
(
"/api/**"
).
addResourceLocations
(
"/api/"
,
"file:api/"
,
"classpath:/api/"
);
if
(
new
File
(
uploadF
lo
derPath
).
isAbsolute
())
{
if
(
new
File
(
uploadF
ol
derPath
).
isAbsolute
())
{
//如果指定了绝对路径,上传的文件都映射到uploadMapping下
//如果指定了绝对路径,上传的文件都映射到uploadMapping下
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
"file:"
+
uploadF
loderPath
+
File
.
separator
registry
.
addResourceHandler
(
uploadMapping
).
addResourceLocations
(
"file:"
+
uploadF
olderPath
+
"/"
//映射其他路径文件
//映射其他路径文件
//,file:F://images
//,file:F://images
);
);
...
@@ -117,19 +129,27 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -117,19 +129,27 @@ public class WebConfig implements WebMvcConfigurer {
//XSS过滤器
//XSS过滤器
@Bean
@Bean
public
FilterRegistrationBean
xssFilterRegistration
()
{
public
FilterRegistrationBean
xssFilterRegistration
(
@Value
(
"${ms.xss.xssEnable:false}"
)
boolean
xssEnable
,
@Value
(
"${ms.xss.filterUrl}"
)
String
filterUrl
,
@Value
(
"${ms.xss.excludeUrl}"
)
String
excludeUrl
)
{
XSSEscapeFilter
xssFilter
=
new
XSSEscapeFilter
();
XSSEscapeFilter
xssFilter
=
new
XSSEscapeFilter
();
Map
<
String
,
String
>
initParameters
=
new
HashMap
();
FilterRegistrationBean
registration
=
new
FilterRegistrationBean
();
FilterRegistrationBean
registration
=
new
FilterRegistrationBean
();
registration
.
setName
(
"XSSFilter"
);
registration
.
setName
(
"XSSFilter"
);
registration
.
addUrlPatterns
(
"/*"
);
registration
.
addUrlPatterns
(
new
String
[]{
"/*"
});
registration
.
setOrder
(
Ordered
.
HIGHEST_PRECEDENCE
);
registration
.
setOrder
(-
2147483648
);
xssFilter
.
includes
.
add
(
".*/search.do"
);
xssFilter
.
includes
.
add
(
"/**"
);
Map
<
String
,
String
>
initParameters
=
new
HashMap
();
xssFilter
.
excludes
.
add
(
MSProperties
.
manager
.
path
+
"/**"
);
boolean
enable
=
true
;
if
(
filterUrl
!=
null
&&
StrUtil
.
isNotBlank
(
filterUrl
.
toString
()))
{
xssFilter
.
includes
.
addAll
(
Arrays
.
asList
(
filterUrl
.
toString
().
split
(
","
)));
}
if
(
excludeUrl
!=
null
&&
StrUtil
.
isNotBlank
(
excludeUrl
.
toString
()))
{
xssFilter
.
excludes
.
addAll
(
Arrays
.
asList
(
excludeUrl
.
toString
().
split
(
","
)));
}
initParameters
.
put
(
"isIncludeRichText"
,
"false"
);
initParameters
.
put
(
"isIncludeRichText"
,
"false"
);
registration
.
setInitParameters
(
initParameters
);
registration
.
setInitParameters
(
initParameters
);
registration
.
setFilter
(
xssFilter
);
registration
.
setFilter
(
xssFilter
);
registration
.
setEnabled
(
e
nable
);
registration
.
setEnabled
(
xssE
nable
);
return
registration
;
return
registration
;
}
}
...
@@ -184,5 +204,15 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -184,5 +204,15 @@ public class WebConfig implements WebMvcConfigurer {
return
pool
;
return
pool
;
}
}
public
Map
getMap
(
String
configName
)
{
if
(!
StringUtils
.
isEmpty
(
configName
)
&&
!
StringUtils
.
isEmpty
(
configName
))
{
ConfigEntity
configEntity
=
new
ConfigEntity
();
configEntity
.
setConfigName
(
configName
);
configEntity
=
(
ConfigEntity
)
this
.
configBiz
.
getOne
(
new
QueryWrapper
(
configEntity
));
return
configEntity
!=
null
&&
!
StringUtils
.
isEmpty
(
configEntity
.
getConfigData
())
?
(
Map
)
JSON
.
parseObject
(
configEntity
.
getConfigData
(),
HashMap
.
class
)
:
null
;
}
else
{
return
null
;
}
}
}
}
src/main/webapp/WEB-INF/manager/cms/content/form.ftl
View file @
f78bbc93
<!DOCTYPE html>
<!DOCTYPE html>
<html>
<html>
<head>
<head>
<title>
文章
1
</title>
<title>
文章
</title>
<
#
include
"../../
include
/
head-file
.
ftl
"
>
<
#
include
"../../
include
/
head-file
.
ftl
"
>
<script
src=
"${base}/static/mdiy/index.js"
></script>
<script
src=
"${base}/static/mdiy/index.js"
></script>
</head>
</head>
...
...
src/main/webapp/WEB-INF/manager/index.ftl
View file @
f78bbc93
This diff is collapsed.
Click to expand it.
src/main/webapp/template/1/default/about.htm
View file @
f78bbc93
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"news"
>
<div
class=
"news"
>
<div
class=
"body"
>
<div
class=
"body"
>
<div
class=
"left"
>
<div
class=
"left"
>
...
...
src/main/webapp/template/1/default/index.htm
View file @
f78bbc93
...
@@ -2,11 +2,12 @@
...
@@ -2,11 +2,12 @@
<head>
<head>
<meta
charset=
"utf-8"
>
<meta
charset=
"utf-8"
>
<title>
{ms:global.name/}
</title>
<title>
{ms:global.name/}
</title>
<script
src=
"/static/mdiy/index.js"
></script>
<
#
include
"
head-file
.
htm
"
/>
<
#
include
"
head-file
.
htm
"
/>
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"ms-banner"
>
<div
class=
"ms-banner"
>
<swiper
class=
"ms-vue-awesome-swiper"
:options=
"{
<swiper
class=
"ms-vue-awesome-swiper"
:options=
"{
slidesPerView : 1,
slidesPerView : 1,
...
@@ -99,7 +100,33 @@ var app = new Vue({
...
@@ -99,7 +100,33 @@ var app = new Vue({
el
:
'#app'
,
el
:
'#app'
,
watch
:{
watch
:{
},
},
data
:
{
data
:
function
()
{
return
{
loading
:
false
,
saveDisabled
:
false
,
verifCode
:
ms
.
base
+
"/code"
,
//表单数据
form
:
{
// 姓名
leaveName
:
''
,
// 电话
leavePhone
:
''
,
// 留言内容
textareaMsg
:
''
},
rules
:{
rand_code
:
[{
required
:
true
,
message
:
'验证码不能为空'
,
trigger
:
'blur'
},
{
min
:
4
,
max
:
4
,
message
:
'请输入4位验证码'
,
trigger
:
'blur'
}]
},
}
},
},
methods
:
{
methods
:
{
switchShow
:
function
(
arr
){
switchShow
:
function
(
arr
){
...
@@ -111,8 +138,37 @@ var app = new Vue({
...
@@ -111,8 +138,37 @@ var app = new Vue({
}
}
})
})
},
},
save
:
function
()
{
var
that
=
this
;
that
.
saveDisabled
=
true
;
that
.
formModel
.
save
(
function
(
res
)
{
if
(
res
.
result
)
{
that
.
$notify
({
title
:
'成功'
,
type
:
'success'
,
message
:
'保存成功!'
});
}
else
{
that
.
$notify
({
title
:
'失败'
,
message
:
res
.
msg
,
type
:
'warning'
});
}
that
.
saveDisabled
=
false
;
});
},
code
:
function
()
{
this
.
verifCode
=
ms
.
base
+
"/code?t="
+
(
new
Date
).
getTime
();
}
},
},
created
(){
created
(){
var
that
=
this
;
URLS
[
"post"
].
formURL
[
"save"
]
=
"/mdiy/formData/save.do"
;
ms
.
mdiy
.
model
.
post
(
"formModel"
,
{
"modelName"
:
"留言版"
}).
then
(
function
(
obj
)
{
that
.
formModel
=
obj
;
});
}
}
})
})
</script>
</script>
...
...
src/main/webapp/template/1/default/message.htm
deleted
100755 → 0
View file @
af449b4c
This diff is collapsed.
Click to expand it.
src/main/webapp/template/1/default/nav.htm
deleted
100755 → 0
View file @
af449b4c
<
#
assign
ids=
field.parentids
>
<
#
assign
typeid=
field.typeid
>
<div
class=
"ms-nav"
>
<div
class=
"body"
>
<div
class=
"logo"
>
<img
title=
""
alt=
""
src=
"{ms:global.host/}/{@ms:file global.logo/}"
class=
"logo-pic"
>
<img
title=
""
alt=
""
src=
"https://www.mingsoft.net//template/1/ms/images/1596437934982.png"
class=
"logo-desc"
>
</div>
<div
@
click=
"switchShow(["1605172743000_96378"]);"
class=
"nav-h5"
>
<i
class=
"iconfont icon-caidan nav-h5-icon"
></i>
<div
id=
"key_1605172743000_96378"
class=
"nav-h5-body"
style=
"display: none"
>
<a
href=
"{ms:global.host/}"
class=
"nav-h5-item"
>
首页
</a>
{ms:channel flag='nav' type='top'}
<a
href=
"<#if field.type==3>{ms:global.url/}${field.typeurl}<#else>{ms:global.url/}${field.typelink}</#if>"
class=
"nav-h5-item <#if typeid==field.typeid || (ids?has_content && ids?index_of('${field.typeid}') gt -1)> sel</#if>"
>
${field.typetitle}
</a>
{/ms:channel}
</div>
</div>
<div
class=
"nav-item"
>
<a
href=
"{ms:global.host/}"
class=
"item"
>
首页
</a>
{ms:channel flag='nav' type='top'}
<a
href=
"<#if field.type==3>{ms:global.url/}${field.typeurl}<#else>{ms:global.url/}${field.typelink}</#if>"
class=
"item<#if typeid==field.typeid || (ids?has_content && ids?index_of('${field.typeid}') gt -1)> sel</#if>"
>
${field.typetitle}
</a>
{/ms:channel}
</div>
<div
class=
"nav-search"
>
<!--搜索-start-->
<form
id=
"searchDataForm"
action=
"{ms:global.host/}/mcms/search.do"
method=
"post"
class=
"ms-search-input"
>
<div
class=
"ms-search-input-div"
>
<!--输入框 - start -->
<input
class=
"ms-input"
name=
"content_title"
placeholder=
"输入搜索关键字"
>
<!--输入框 -end -->
</div>
<div
class=
"ms-search-button"
onclick=
"document.getElementById('searchDataForm').submit();"
>
<i
class=
"iconfont icon-fangdajing"
></i>
</div>
</form>
<!--搜索-end-->
</div>
</div>
</div>
src/main/webapp/template/1/default/news-detail.htm
View file @
f78bbc93
This diff is collapsed.
Click to expand it.
src/main/webapp/template/1/default/news-list.htm
View file @
f78bbc93
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"news"
>
<div
class=
"news"
>
<div
class=
"body"
>
<div
class=
"body"
>
<div
class=
"left"
>
<div
class=
"left"
>
...
...
src/main/webapp/template/1/default/product-detail.htm
View file @
f78bbc93
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"body"
>
<div
class=
"body"
>
<div
class=
"left"
>
<div
class=
"left"
>
...
...
src/main/webapp/template/1/default/product-list.htm
View file @
f78bbc93
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"content"
>
<div
class=
"content"
>
<div
class=
"body"
>
<div
class=
"body"
>
...
...
src/main/webapp/template/1/default/search.htm
View file @
f78bbc93
...
@@ -6,7 +6,7 @@
...
@@ -6,7 +6,7 @@
</head>
</head>
<body>
<body>
<div
id=
"app"
v-cloak
>
<div
id=
"app"
v-cloak
>
<
#
include
"
nav
.
htm
"
/>
<
#
include
"
header
.
htm
"
/>
<div
class=
"search"
>
<div
class=
"search"
>
<div
class=
"body"
>
<div
class=
"body"
>
<span>
关键字
<span
style=
"color: red"
>
{ms:search.content_title/}
</span>
</span>
<span>
关键字
<span
style=
"color: red"
>
{ms:search.content_title/}
</span>
</span>
...
...
Write
Preview
Markdown
is supported
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