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
644f0bdc
Commit
644f0bdc
authored
Dec 15, 2022
by
msgroup
Committed by
mingsoft
Dec 15, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:待发布版本
Signed-off-by:
mingsoft
<
killfen@126.com
>
parent
f66c6298
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
132 additions
and
83 deletions
+132
-83
BaseAction.java
src/main/java/net/mingsoft/cms/action/BaseAction.java
+0
-0
CategoryAction.java
src/main/java/net/mingsoft/cms/action/CategoryAction.java
+84
-78
CategoryBean.java
src/main/java/net/mingsoft/cms/bean/CategoryBean.java
+0
-0
ICategoryBiz.java
src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java
+0
-0
IHistoryLogBiz.java
src/main/java/net/mingsoft/cms/biz/IHistoryLogBiz.java
+0
-0
CategoryBizImpl.java
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
+0
-0
Const.java
src/main/java/net/mingsoft/cms/constant/Const.java
+0
-0
ICategoryDao.java
src/main/java/net/mingsoft/cms/dao/ICategoryDao.java
+0
-0
ICmsHistoryLogDao.java
src/main/java/net/mingsoft/cms/dao/ICmsHistoryLogDao.java
+0
-0
CategoryEntity.java
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
+43
-3
WebConfig.java
src/main/java/net/mingsoft/config/WebConfig.java
+5
-1
news-detail.htm
src/main/webapp/template/1/default/news-detail.htm
+0
-1
No files found.
src/main/java/net/mingsoft/cms/action/BaseAction.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
644f0bdc
...
...
@@ -7,10 +7,10 @@
* 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:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* 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
...
...
@@ -23,6 +23,7 @@
package
net
.
mingsoft
.
cms
.
action
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -53,7 +54,7 @@ import java.util.List;
* 创建日期:2019-11-28 15:12:32<br/>
* 历史修订:<br/>
*/
@Api
(
tags
=
{
"后端-内容模块接口"
})
@Api
(
tags
=
{
"后端-内容模块接口"
})
@Controller
(
"cmsCategoryAction"
)
@RequestMapping
(
"/${ms.manager.path}/cms/category"
)
public
class
CategoryAction
extends
BaseAction
{
...
...
@@ -71,7 +72,7 @@ public class CategoryAction extends BaseAction {
*/
@GetMapping
(
"/index"
)
@RequiresPermissions
(
"cms:category:view"
)
public
String
index
()
{
public
String
index
()
{
return
"/cms/category/index"
;
}
...
...
@@ -82,15 +83,15 @@ public class CategoryAction extends BaseAction {
*/
@ApiOperation
(
value
=
"查询分类列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryParentId"
,
value
=
"父类型编号"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryParentId"
,
value
=
"父类型编号"
,
required
=
false
,
paramType
=
"query"
),
})
@RequestMapping
(
value
=
"/list"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@RequestMapping
(
value
=
"/list"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
})
@ResponseBody
public
ResultData
list
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
BasicUtil
.
startPage
();
List
categoryList
=
categoryBiz
.
query
(
category
);
return
ResultData
.
build
().
success
(
new
EUListBean
(
categoryList
,
(
int
)
BasicUtil
.
endPage
(
categoryList
).
getTotal
()));
List
categoryList
=
categoryBiz
.
list
(
new
LambdaQueryWrapper
<
CategoryEntity
>(
category
)
);
return
ResultData
.
build
().
success
(
new
EUListBean
(
categoryList
,
(
int
)
BasicUtil
.
endPage
(
categoryList
).
getTotal
()));
}
/**
...
...
@@ -99,7 +100,7 @@ public class CategoryAction extends BaseAction {
* @return
*/
@GetMapping
(
"/form"
)
public
String
form
(
@ModelAttribute
CategoryEntity
category
,
ModelMap
model
)
{
public
String
form
(
@ModelAttribute
CategoryEntity
category
,
ModelMap
model
)
{
model
.
addAttribute
(
"appId"
,
BasicUtil
.
getApp
().
getAppId
());
return
"/cms/category/form"
;
}
...
...
@@ -109,42 +110,41 @@ public class CategoryAction extends BaseAction {
* @param category 分类实体
*/
@ApiOperation
(
value
=
"获取分类列表接口"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@GetMapping
(
"/get"
)
@RequiresPermissions
(
"cms:category:view"
)
@ResponseBody
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
if
(
category
.
getId
()==
null
)
{
public
ResultData
get
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
if
(
category
.
getId
()
==
null
)
{
return
ResultData
.
build
().
error
();
}
CategoryEntity
_category
=
(
CategoryEntity
)
categoryBiz
.
getById
(
category
.
getId
());
CategoryEntity
_category
=
(
CategoryEntity
)
categoryBiz
.
getById
(
category
.
getId
());
return
ResultData
.
build
().
success
(
_category
);
}
/**
* 保存分类
* @param category 分类实体
*/
@ApiOperation
(
value
=
"保存分类列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryId"
,
value
=
"所属栏目"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryType"
,
value
=
"栏目管理属性"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categorySort"
,
value
=
"自定义顺序"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryListUrl"
,
value
=
"列表模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryUrl"
,
value
=
"内容模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryKeyword"
,
value
=
"栏目管理关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDescrip"
,
value
=
"栏目管理描述"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryImg"
,
value
=
"缩略图"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDiyUrl"
,
value
=
"自定义链接"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"mdiyModelId"
,
value
=
"栏目管理的内容模型id"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDatetime"
,
value
=
"类别发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"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
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryId"
,
value
=
"所属栏目"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryType"
,
value
=
"栏目管理属性"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categorySort"
,
value
=
"自定义顺序"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryListUrl"
,
value
=
"列表模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryUrl"
,
value
=
"内容模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryKeyword"
,
value
=
"栏目管理关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDescrip"
,
value
=
"栏目管理描述"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryImg"
,
value
=
"缩略图"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDiyUrl"
,
value
=
"自定义链接"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"mdiyModelId"
,
value
=
"栏目管理的内容模型id"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDatetime"
,
value
=
"类别发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"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"
),
})
@PostMapping
(
"/save"
)
@ResponseBody
...
...
@@ -152,25 +152,28 @@ public class CategoryAction extends BaseAction {
@RequiresPermissions
(
"cms:category:save"
)
public
ResultData
save
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
//验证缩略图参数值是否合法
if
(!
category
.
getCategoryImg
().
matches
(
"^\\[.{1,}]$"
)
||
category
.
getCategoryImg
()==
null
)
{
if
(!
category
.
getCategoryImg
().
matches
(
"^\\[.{1,}]$"
)
||
category
.
getCategoryImg
()
==
null
)
{
category
.
setCategoryImg
(
""
);
}
//验证栏目管理名称的值是否合法
if
(
StringUtil
.
isBlank
(
category
.
getCategoryTitle
()))
{
if
(
StringUtil
.
isBlank
(
category
.
getCategoryTitle
()))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"category.title"
)));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryTitle
()+
""
,
1
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryTitle
()
+
""
,
1
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.title"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()+
""
,
1
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()
+
""
,
1
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.path"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentIds
()+
""
,
1
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentIds
()
+
""
,
1
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.parent.id"
),
"1"
,
"100"
));
}
//判断拼音是否重复
if
(
StrUtil
.
isNotBlank
(
category
.
getCategoryPinyin
()))
{
if
(
StrUtil
.
isNotBlank
(
category
.
getCategoryPinyin
()))
{
if
(!
category
.
getCategoryPinyin
().
matches
(
"^[a-zA-Z0-9]*$"
)){
return
ResultData
.
build
().
error
(
this
.
getResString
(
"err.format"
));
}
CategoryEntity
_category
=
new
CategoryEntity
();
_category
.
setCategoryPinyin
(
category
.
getCategoryPinyin
());
List
<
CategoryEntity
>
query
=
categoryBiz
.
query
(
_category
);
...
...
@@ -198,7 +201,7 @@ public class CategoryAction extends BaseAction {
@LogAnn
(
title
=
"删除分类"
,
businessType
=
BusinessTypeEnum
.
DELETE
)
@RequiresPermissions
(
"cms:category:del"
)
public
ResultData
delete
(
@RequestBody
List
<
CategoryEntity
>
categorys
)
{
for
(
int
i
=
0
;
i
<
categorys
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
categorys
.
size
();
i
++)
{
categoryBiz
.
delete
(
categorys
.
get
(
i
).
getId
());
}
return
ResultData
.
build
().
success
();
...
...
@@ -210,23 +213,23 @@ public class CategoryAction extends BaseAction {
*/
@ApiOperation
(
value
=
"更新分类列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryId"
,
value
=
"所属栏目"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryType"
,
value
=
"栏目管理属性"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categorySort"
,
value
=
"自定义顺序"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryListUrl"
,
value
=
"列表模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryUrl"
,
value
=
"内容模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryKeyword"
,
value
=
"栏目管理关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDescrip"
,
value
=
"栏目管理描述"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryImg"
,
value
=
"缩略图"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDiyUrl"
,
value
=
"自定义链接"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"mdiyModelId"
,
value
=
"栏目管理的内容模型id"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDatetime"
,
value
=
"类别发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"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
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryTitle"
,
value
=
"栏目管理名称"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryId"
,
value
=
"所属栏目"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryType"
,
value
=
"栏目管理属性"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categorySort"
,
value
=
"自定义顺序"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryListUrl"
,
value
=
"列表模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryUrl"
,
value
=
"内容模板"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryKeyword"
,
value
=
"栏目管理关键字"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDescrip"
,
value
=
"栏目管理描述"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryImg"
,
value
=
"缩略图"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDiyUrl"
,
value
=
"自定义链接"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"mdiyModelId"
,
value
=
"栏目管理的内容模型id"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryDatetime"
,
value
=
"类别发布时间"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"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"
),
})
@PostMapping
(
"/update"
)
@ResponseBody
...
...
@@ -234,25 +237,28 @@ public class CategoryAction extends BaseAction {
@RequiresPermissions
(
"cms:category:update"
)
public
ResultData
update
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
//验证缩略图参数值是否合法
if
(!
category
.
getCategoryImg
().
matches
(
"^\\[.{1,}]$"
)
||
category
.
getCategoryImg
()==
null
)
{
if
(!
category
.
getCategoryImg
().
matches
(
"^\\[.{1,}]$"
)
||
category
.
getCategoryImg
()
==
null
)
{
category
.
setCategoryImg
(
""
);
}
//验证栏目管理名称的值是否合法
if
(
StringUtil
.
isBlank
(
category
.
getCategoryTitle
()))
{
if
(
StringUtil
.
isBlank
(
category
.
getCategoryTitle
()))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"category.title"
)));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryTitle
()+
""
,
1
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryTitle
()
+
""
,
1
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.title"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()+
""
,
0
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryPath
()
+
""
,
0
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.path"
),
"1"
,
"100"
));
}
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentIds
()+
""
,
0
,
100
))
{
if
(!
StringUtil
.
checkLength
(
category
.
getCategoryParentIds
()
+
""
,
0
,
100
))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"category.parent.id"
),
"1"
,
"100"
));
}
//判断拼音是否重复并且是否和原拼音相同
if
(
StrUtil
.
isNotBlank
(
category
.
getCategoryPinyin
())
&&
!
categoryBiz
.
getById
(
category
.
getId
()).
getCategoryPinyin
().
equals
(
category
.
getCategoryPinyin
()))
{
if
(
StrUtil
.
isNotBlank
(
category
.
getCategoryPinyin
())
&&
!
categoryBiz
.
getById
(
category
.
getId
()).
getCategoryPinyin
().
equals
(
category
.
getCategoryPinyin
()))
{
if
(!
category
.
getCategoryPinyin
().
matches
(
"^[a-zA-Z0-9]*$"
)){
return
ResultData
.
build
().
error
(
this
.
getResString
(
"err.format"
));
}
CategoryEntity
_category
=
new
CategoryEntity
();
_category
.
setCategoryPinyin
(
category
.
getCategoryPinyin
());
List
<
CategoryEntity
>
query
=
categoryBiz
.
query
(
_category
);
...
...
@@ -265,21 +271,21 @@ public class CategoryAction extends BaseAction {
if
(
StrUtil
.
isNotBlank
(
category
.
getCategoryPinyin
()))
{
pingYin
=
category
.
getCategoryPinyin
();
}
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
CategoryEntity
categoryEntity
=
new
CategoryEntity
();
categoryEntity
.
setCategoryPinyin
(
pingYin
);
CategoryEntity
categoryBizEntity
=
categoryBiz
.
getEntity
(
categoryEntity
);
category
.
setCategoryPinyin
(
pingYin
);
//如果存在此拼音栏目则拼接上id
if
(
categoryBizEntity
!=
null
&&!
categoryBizEntity
.
getId
().
equals
(
category
.
getId
()))
{
category
.
setCategoryPinyin
(
pingYin
+
category
.
getId
());
if
(
categoryBizEntity
!=
null
&&
!
categoryBizEntity
.
getId
().
equals
(
category
.
getId
()))
{
category
.
setCategoryPinyin
(
pingYin
+
category
.
getId
());
}
//判断是否选择子级为所属栏目
CategoryEntity
_category
=
new
CategoryEntity
();
_category
.
setId
(
category
.
getId
());
List
<
CategoryEntity
>
categoryList
=
categoryBiz
.
queryChildren
(
_category
);
if
(
categoryList
.
size
()>
1
)
{
for
(
CategoryEntity
item:
categoryList
)
{
if
(
item
.
getId
().
equals
(
category
.
getCategoryId
()))
{
if
(
categoryList
.
size
()
>
1
)
{
for
(
CategoryEntity
item
:
categoryList
)
{
if
(
item
.
getId
().
equals
(
category
.
getCategoryId
()))
{
return
ResultData
.
build
().
error
(
getResString
(
"cannot.select.child"
));
}
}
...
...
@@ -300,17 +306,17 @@ public class CategoryAction extends BaseAction {
*/
@ApiOperation
(
value
=
"验证拼音"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryPinyin"
,
value
=
"栏目管拼音"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"categoryPinyin"
,
value
=
"栏目管拼音"
,
required
=
true
,
paramType
=
"query"
),
})
@GetMapping
(
"/verifyPingYin"
)
@ResponseBody
public
ResultData
verifyPingYin
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
public
ResultData
verifyPingYin
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
long
count
=
categoryBiz
.
count
(
Wrappers
.<
CategoryEntity
>
lambdaQuery
()
.
ne
(
StrUtil
.
isNotBlank
(
category
.
getId
()),
CategoryEntity:
:
getId
,
category
.
getId
())
.
eq
(
CategoryEntity:
:
getCategoryPinyin
,
category
.
getCategoryPinyin
()));
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
ResultData
.
build
().
error
(
"存在相同拼音的栏目"
);
}
return
ResultData
.
build
().
success
();
...
...
@@ -323,21 +329,21 @@ public class CategoryAction extends BaseAction {
*/
@ApiOperation
(
value
=
"批量更新模版"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"dictId"
,
value
=
"字典"
,
required
=
true
,
paramType
=
"query"
)
})
@GetMapping
(
"/updateTemplate"
)
@ResponseBody
@RequiresPermissions
(
"cms:category:update"
)
public
ResultData
updateTemplate
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
if
(
category
==
null
||
StringUtils
.
isEmpty
(
category
.
getId
()))
{
public
ResultData
updateTemplate
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
if
(
category
==
null
||
StringUtils
.
isEmpty
(
category
.
getId
()))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.error"
,
this
.
getResString
(
"id"
)));
}
category
=
categoryBiz
.
getById
(
category
.
getId
());
category
.
setCategoryParentIds
(
null
);
List
<
CategoryEntity
>
childs
=
categoryBiz
.
queryChildren
(
category
);
//更新与父节点相同类型的子栏目的模板内容
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
childs
.
size
();
i
++)
{
if
(
childs
.
get
(
i
).
getCategoryType
().
equals
(
category
.
getCategoryType
()))
{
childs
.
get
(
i
).
setCategoryUrl
(
category
.
getCategoryUrl
());
childs
.
get
(
i
).
setCategoryListUrl
(
category
.
getCategoryListUrl
());
...
...
@@ -354,12 +360,12 @@ public class CategoryAction extends BaseAction {
*/
@ApiOperation
(
value
=
"复制栏目"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
true
,
paramType
=
"query"
)
})
@GetMapping
(
"/copyCategory"
)
@ResponseBody
@RequiresPermissions
(
"cms:category:save"
)
public
ResultData
copyCategory
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
public
ResultData
copyCategory
(
@ModelAttribute
@ApiIgnore
CategoryEntity
category
)
{
if
(
category
==
null
||
StringUtils
.
isEmpty
(
category
.
getId
()))
{
return
ResultData
.
build
().
error
(
getResString
(
"err.error"
,
this
.
getResString
(
"id"
)));
}
...
...
src/main/java/net/mingsoft/cms/bean/CategoryBean.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/biz/ICategoryBiz.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/biz/IHistoryLogBiz.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/biz/impl/CategoryBizImpl.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/constant/Const.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/dao/ICategoryDao.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/dao/ICmsHistoryLogDao.java
View file @
644f0bdc
src/main/java/net/mingsoft/cms/entity/CategoryEntity.java
View file @
644f0bdc
...
...
@@ -7,10 +7,10 @@
* 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:
* <p>
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* <p>
* 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
...
...
@@ -24,6 +24,11 @@ package net.mingsoft.cms.entity;
import
com.baomidou.mybatisplus.annotation.*
;
import
net.mingsoft.base.entity.BaseEntity
;
import
net.mingsoft.basic.util.BasicUtil
;
import
net.mingsoft.config.MSProperties
;
import
net.mingsoft.mdiy.util.ConfigUtil
;
import
java.io.File
;
/**
* 分类实体
...
...
@@ -131,6 +136,21 @@ public class CategoryEntity extends BaseEntity {
*/
private
String
topId
;
/**
* 路径url
*/
@TableField
(
exist
=
false
)
private
String
url
;
/**
* 设置url路径
*
* @param url 路径的字符串
*/
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
Boolean
getLeaf
()
{
return
leaf
;
}
...
...
@@ -419,7 +439,8 @@ public class CategoryEntity extends BaseEntity {
* 获取栏目Id(标签使用)
*/
public
Boolean
getTypeleaf
()
{
return
this
.
leaf
;
}
return
this
.
leaf
;
}
/**
...
...
@@ -431,6 +452,7 @@ public class CategoryEntity extends BaseEntity {
@TableField
(
exist
=
false
)
private
String
typepath
;
/**
* 获取栏目图片 (标签使用)
*/
...
...
@@ -462,4 +484,22 @@ public class CategoryEntity extends BaseEntity {
this
.
childsize
=
childsize
;
}
/**
* 获取url路径
*
* @return url路径的字符串
*/
public
String
getUrl
()
{
String
appDir
=
""
;
String
htmlDir
=
MSProperties
.
diy
.
htmlDir
;
String
categoryPath
=
this
.
getCategoryPath
();
String
categoryPinyin
=
this
.
getCategoryPinyin
();
if
(!(
ConfigUtil
.
getBoolean
(
"短链配置"
,
"shortLinkSwitch"
,
false
)))
{
//未开启短链
appDir
=
"/"
+
BasicUtil
.
getApp
().
getAppDir
();
return
url
=
"/"
+
htmlDir
+
appDir
+
categoryPath
+
"/index.html"
;
}
//开启短链后的url拼接
return
url
=
"/"
+
htmlDir
+
appDir
+
"/"
+
categoryPinyin
+
".html"
;
}
}
src/main/java/net/mingsoft/config/WebConfig.java
View file @
644f0bdc
...
...
@@ -132,7 +132,8 @@ public class WebConfig implements WebMvcConfigurer {
@Bean
public
FilterRegistrationBean
xssFilterRegistration
(
@Value
(
"${ms.xss.enable:true}"
)
boolean
xssEnable
,
@Value
(
"${ms.xss.filter-url}"
)
String
filterUrl
,
@Value
(
"${ms.xss.exclude-url}"
)
String
excludeUrl
)
{
@Value
(
"${ms.xss.exclude-url}"
)
String
excludeUrl
,
@Value
(
"${ms.xss.exclude-filed}"
)
String
excludeFiled
)
{
XSSEscapeFilter
xssFilter
=
new
XSSEscapeFilter
();
Map
<
String
,
String
>
initParameters
=
new
HashMap
();
FilterRegistrationBean
registration
=
new
FilterRegistrationBean
();
...
...
@@ -149,6 +150,9 @@ public class WebConfig implements WebMvcConfigurer {
}
else
{
xssFilter
.
excludes
.
add
(
MSProperties
.
manager
.
path
+
"/**"
);
}
if
(
excludeFiled
!=
null
&&
StrUtil
.
isNotBlank
(
excludeFiled
))
{
xssFilter
.
excludesFiled
.
addAll
(
Arrays
.
asList
(
excludeFiled
.
split
(
","
)));
}
initParameters
.
put
(
"isIncludeRichText"
,
"false"
);
registration
.
setInitParameters
(
initParameters
);
registration
.
setFilter
(
xssFilter
);
...
...
src/main/webapp/template/1/default/news-detail.htm
View file @
644f0bdc
...
...
@@ -92,7 +92,6 @@
},
},
created
()
{
this
.
likeTotal
()
}
})
</script>
...
...
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