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
14366861
Commit
14366861
authored
Jul 11, 2021
by
msgroup
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
规范方法
parent
4e8fbac7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
27 additions
and
38 deletions
+27
-38
CategoryAction.java
src/main/java/net/mingsoft/cms/action/CategoryAction.java
+1
-1
ContentAction.java
src/main/java/net/mingsoft/cms/action/ContentAction.java
+10
-10
GeneraterAction.java
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
+6
-8
CategoryAction.java
...main/java/net/mingsoft/cms/action/web/CategoryAction.java
+6
-11
ContentAction.java
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
+2
-6
MCmsAction.java
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
+1
-1
main.ftl
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
+1
-1
No files found.
src/main/java/net/mingsoft/cms/action/CategoryAction.java
View file @
14366861
...
@@ -104,7 +104,7 @@ public class CategoryAction extends BaseAction {
...
@@ -104,7 +104,7 @@ public class CategoryAction extends BaseAction {
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
})
})
@RequestMapping
(
"/list"
)
@RequestMapping
(
value
=
"/list"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@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
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
BasicUtil
.
startPage
();
BasicUtil
.
startPage
();
...
...
src/main/java/net/mingsoft/cms/action/ContentAction.java
View file @
14366861
...
@@ -57,11 +57,11 @@ import java.util.List;
...
@@ -57,11 +57,11 @@ import java.util.List;
@Controller
(
"cmsContentAction"
)
@Controller
(
"cmsContentAction"
)
@RequestMapping
(
"/${ms.manager.path}/cms/content"
)
@RequestMapping
(
"/${ms.manager.path}/cms/content"
)
public
class
ContentAction
extends
BaseAction
{
public
class
ContentAction
extends
BaseAction
{
/**
/**
* 注入文章业务层
* 注入文章业务层
*/
*/
@Autowired
@Autowired
private
IContentBiz
contentBiz
;
private
IContentBiz
contentBiz
;
...
@@ -107,14 +107,14 @@ public class ContentAction extends BaseAction {
...
@@ -107,14 +107,14 @@ public class ContentAction extends BaseAction {
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
})
})
@
Reque
stMapping
(
"/list"
)
@
Po
stMapping
(
"/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
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
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
()));
}
}
/**
/**
* 返回编辑界面content_form
* 返回编辑界面content_form
*/
*/
...
@@ -157,7 +157,7 @@ public class ContentAction extends BaseAction {
...
@@ -157,7 +157,7 @@ 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
);
}
}
@ApiOperation
(
value
=
"保存文章列表接口"
)
@ApiOperation
(
value
=
"保存文章列表接口"
)
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"contentTitle"
,
value
=
"文章标题"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"contentTitle"
,
value
=
"文章标题"
,
required
=
true
,
paramType
=
"query"
),
...
@@ -214,7 +214,7 @@ public class ContentAction extends BaseAction {
...
@@ -214,7 +214,7 @@ public class ContentAction extends BaseAction {
contentBiz
.
save
(
content
);
contentBiz
.
save
(
content
);
return
ResultData
.
build
().
success
(
content
);
return
ResultData
.
build
().
success
(
content
);
}
}
/**
/**
* @param contents 文章实体
* @param contents 文章实体
*/
*/
...
@@ -265,7 +265,7 @@ public class ContentAction extends BaseAction {
...
@@ -265,7 +265,7 @@ public class ContentAction extends BaseAction {
@RequiresPermissions
(
"cms:content:update"
)
@RequiresPermissions
(
"cms:content:update"
)
public
ResultData
update
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
public
ResultData
update
(
@ModelAttribute
@ApiIgnore
ContentEntity
content
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
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"
)));
}
}
...
@@ -278,7 +278,7 @@ public class ContentAction extends BaseAction {
...
@@ -278,7 +278,7 @@ public class ContentAction extends BaseAction {
if
(!
StringUtil
.
checkLength
(
content
.
getContentSource
()+
""
,
0
,
200
)){
if
(!
StringUtil
.
checkLength
(
content
.
getContentSource
()+
""
,
0
,
200
)){
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"content.source"
),
"0"
,
"200"
));
return
ResultData
.
build
().
error
(
getResString
(
"err.length"
,
this
.
getResString
(
"content.source"
),
"0"
,
"200"
));
}
}
//验证发布时间的值是否合法
//验证发布时间的值是否合法
if
(
StringUtil
.
isBlank
(
content
.
getContentDatetime
())){
if
(
StringUtil
.
isBlank
(
content
.
getContentDatetime
())){
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.datetime"
)));
return
ResultData
.
build
().
error
(
getResString
(
"err.empty"
,
this
.
getResString
(
"content.datetime"
)));
}
}
...
@@ -290,5 +290,5 @@ public class ContentAction extends BaseAction {
...
@@ -290,5 +290,5 @@ public class ContentAction extends BaseAction {
}
}
}
}
src/main/java/net/mingsoft/cms/action/GeneraterAction.java
View file @
14366861
...
@@ -51,9 +51,7 @@ import org.springframework.beans.factory.annotation.Value;
...
@@ -51,9 +51,7 @@ import org.springframework.beans.factory.annotation.Value;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.context.annotation.Scope
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
...
@@ -111,7 +109,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -111,7 +109,7 @@ public class GeneraterAction extends BaseAction {
*
*
* @return
* @return
*/
*/
@
Reques
tMapping
(
"/index"
)
@
Ge
tMapping
(
"/index"
)
public
String
index
(
HttpServletRequest
request
,
ModelMap
model
)
{
public
String
index
(
HttpServletRequest
request
,
ModelMap
model
)
{
return
"/cms/generate/index"
;
return
"/cms/generate/index"
;
}
}
...
@@ -122,7 +120,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -122,7 +120,7 @@ public class GeneraterAction extends BaseAction {
* @param request
* @param request
* @param response
* @param response
*/
*/
@RequestMapping
(
"/generateIndex"
)
@RequestMapping
(
value
=
"/generateIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@RequiresPermissions
(
"cms:generate:index"
)
@RequiresPermissions
(
"cms:generate:index"
)
@LogAnn
(
title
=
"生成主页"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@LogAnn
(
title
=
"生成主页"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@ResponseBody
@ResponseBody
...
@@ -150,7 +148,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -150,7 +148,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param response
* @param categoryId
* @param categoryId
*/
*/
@RequestMapping
(
"/{categoryId}/genernateColumn"
)
@RequestMapping
(
value
=
"/{categoryId}/genernateColumn"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@LogAnn
(
title
=
"生成栏目"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@LogAnn
(
title
=
"生成栏目"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@RequiresPermissions
(
"cms:generate:column"
)
@RequiresPermissions
(
"cms:generate:column"
)
@ResponseBody
@ResponseBody
...
@@ -216,7 +214,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -216,7 +214,7 @@ public class GeneraterAction extends BaseAction {
* @param response
* @param response
* @param columnId
* @param columnId
*/
*/
@RequestMapping
(
"/{columnId}/generateArticle"
)
@RequestMapping
(
value
=
"/{columnId}/generateArticle"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@RequiresPermissions
(
"cms:generate:article"
)
@RequiresPermissions
(
"cms:generate:article"
)
@LogAnn
(
title
=
"生成文章"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@LogAnn
(
title
=
"生成文章"
,
businessType
=
BusinessTypeEnum
.
UPDATE
)
@ResponseBody
@ResponseBody
...
@@ -273,7 +271,7 @@ public class GeneraterAction extends BaseAction {
...
@@ -273,7 +271,7 @@ public class GeneraterAction extends BaseAction {
* @param request
* @param request
* @return
* @return
*/
*/
@RequestMapping
(
"/{position}/viewIndex"
)
@RequestMapping
(
value
=
"/{position}/viewIndex"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
public
String
viewIndex
(
HttpServletRequest
request
,
@PathVariable
String
position
,
HttpServletResponse
response
)
{
public
String
viewIndex
(
HttpServletRequest
request
,
@PathVariable
String
position
,
HttpServletResponse
response
)
{
AppEntity
app
=
BasicUtil
.
getApp
();
AppEntity
app
=
BasicUtil
.
getApp
();
// 组织主页预览地址
// 组织主页预览地址
...
...
src/main/java/net/mingsoft/cms/action/web/CategoryAction.java
View file @
14366861
...
@@ -37,13 +37,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
...
@@ -37,13 +37,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
import
org.springframework.ui.ModelMap
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.biz.ICategoryBiz
;
import
net.mingsoft.cms.entity.CategoryEntity
;
import
net.mingsoft.cms.entity.CategoryEntity
;
...
@@ -71,11 +66,11 @@ import springfox.documentation.annotations.ApiIgnore;
...
@@ -71,11 +66,11 @@ import springfox.documentation.annotations.ApiIgnore;
@Controller
(
"WebcmsCategoryAction"
)
@Controller
(
"WebcmsCategoryAction"
)
@RequestMapping
(
"/cms/category"
)
@RequestMapping
(
"/cms/category"
)
public
class
CategoryAction
extends
net
.
mingsoft
.
cms
.
action
.
BaseAction
{
public
class
CategoryAction
extends
net
.
mingsoft
.
cms
.
action
.
BaseAction
{
/**
/**
* 注入分类业务层
* 注入分类业务层
*/
*/
@Autowired
@Autowired
private
ICategoryBiz
categoryBiz
;
private
ICategoryBiz
categoryBiz
;
...
@@ -108,14 +103,14 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -108,14 +103,14 @@ public class CategoryAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
})
})
@RequestMapping
(
"/list"
)
@RequestMapping
(
value
=
"/list"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@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
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
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
()));
}
}
/**
/**
* 获取分类
* 获取分类
...
...
src/main/java/net/mingsoft/cms/action/web/ContentAction.java
View file @
14366861
...
@@ -38,11 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -38,11 +38,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.ui.ModelMap
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
...
@@ -97,7 +93,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
...
@@ -97,7 +93,7 @@ public class ContentAction extends net.mingsoft.cms.action.BaseAction{
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"del"
,
value
=
"删除标记"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"id"
,
value
=
"编号"
,
required
=
false
,
paramType
=
"query"
),
})
})
@
Reque
stMapping
(
"/list"
)
@
Po
stMapping
(
"/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
,
HttpServletResponse
response
,
HttpServletRequest
request
,
@ApiIgnore
ModelMap
model
,
BindingResult
result
)
{
BasicUtil
.
startPage
();
BasicUtil
.
startPage
();
...
...
src/main/java/net/mingsoft/cms/action/web/MCmsAction.java
View file @
14366861
...
@@ -317,7 +317,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
...
@@ -317,7 +317,7 @@ public class MCmsAction extends net.mingsoft.cms.action.BaseAction {
* @param request 搜索id
* @param request 搜索id
* @param response
* @param response
*/
*/
@RequestMapping
(
value
=
"search"
)
@RequestMapping
(
value
=
"search"
,
method
=
{
RequestMethod
.
GET
,
RequestMethod
.
POST
}
)
@ResponseBody
@ResponseBody
public
String
search
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
search
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
//设置分页类
//设置分页类
...
...
src/main/webapp/WEB-INF/manager/cms/content/main.ftl
View file @
14366861
...
@@ -284,7 +284,7 @@
...
@@ -284,7 +284,7 @@
};
};
var
form
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
form
));
var
form
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
form
));
if
(
form
.
contentType
.
length
>
0
)
{
if
(
form
.
contentType
!=
null
&&
form
.
contentType
.
length
>
0
)
{
form
.
contentType
=
form
.
contentType
.
join
(
','
);
form
.
contentType
=
form
.
contentType
.
join
(
','
);
}
}
...
...
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