Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
9ec039fe
Commit
9ec039fe
authored
Dec 17, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-chw' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev-chw
parents
babe0772
9555844e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
121 additions
and
1 deletion
+121
-1
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+1
-1
ArticleAdminController.java
...xxfc/platform/uccn/rest/admin/ArticleAdminController.java
+120
-0
No files found.
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
9ec039fe
...
...
@@ -50,7 +50,7 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
criteria
.
andEqualTo
(
"type"
,
type
);
}
if
(
StringUtils
.
isNotBlank
(
title
))
{
criteria
.
and
EqualTo
(
"title"
,
"%"
+
title
+
"%"
);
criteria
.
and
Like
(
"title"
,
"%"
+
title
+
"%"
);
}
if
(
typeId
!=
null
)
{
criteria
.
andEqualTo
(
"typeId"
,
typeId
);
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/admin/ArticleAdminController.java
0 → 100644
View file @
9ec039fe
package
com
.
xxfc
.
platform
.
uccn
.
rest
.
admin
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
com.xxfc.platform.uccn.biz.ArticleBiz
;
import
com.xxfc.platform.uccn.entity.Article
;
import
com.xxfc.platform.uccn.vo.ArticleQuery
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.web.bind.annotation.*
;
/**
* 文章
*
* @author Administrator
*/
@RestController
@RequestMapping
(
"/article/admin"
)
@Api
(
tags
=
{
"文章"
})
public
class
ArticleAdminController
extends
BaseController
<
ArticleBiz
,
Article
>
{
@GetMapping
(
"/list"
)
@ApiOperation
(
value
=
"获取文章列表"
)
public
ObjectRestResponse
getArticleList
(
@RequestParam
(
name
=
"page"
,
defaultValue
=
"1"
)
Integer
page
,
@RequestParam
(
name
=
"limit"
,
defaultValue
=
"10"
)
Integer
limit
,
@RequestParam
(
name
=
"type"
,
defaultValue
=
"1"
)
Integer
type
,
@RequestParam
(
value
=
"title"
,
required
=
false
)
String
title
,
@RequestParam
(
value
=
"typeId"
,
required
=
false
)
Integer
typeId
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getArticleList
(
page
,
limit
,
type
,
title
,
typeId
));
}
@GetMapping
(
"/app/unauth/one"
)
@ApiOperation
(
value
=
"获取一条数据"
)
public
ObjectRestResponse
getOne
(
@RequestParam
Integer
id
,
@RequestParam
(
required
=
false
)
Integer
urlType
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getOne
(
id
,
urlType
));
}
/**
* 随机获取三条数据
* @param type
* @param number
* @param id
* @return
*/
@GetMapping
(
"/app/unauth/three"
)
@ApiOperation
(
value
=
"随机获取三条数据"
)
public
ObjectRestResponse
randomAccessToThreeData
(
@RequestParam
(
"type"
)
Integer
type
,
@RequestParam
(
"number"
)
Integer
number
,
@RequestParam
(
"id"
)
Integer
id
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getThree
(
type
,
number
,
id
));
}
@GetMapping
(
"/app/unauth/homePage/{type}"
)
@ApiOperation
(
value
=
"获取首页文章列表"
)
public
ObjectRestResponse
getHomePageArticle
(
@PathVariable
Integer
type
,
@RequestParam
(
value
=
"limit"
,
defaultValue
=
"9"
)
Integer
limit
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getHomePageArticle
(
type
,
limit
));
}
@Override
@PostMapping
(
"/add"
)
@ApiOperation
(
value
=
"添加"
)
public
ObjectRestResponse
add
(
@RequestBody
Article
article
){
baseBiz
.
add
(
article
);
return
ObjectRestResponse
.
succ
();
}
@PostMapping
(
"/all"
)
@ApiOperation
(
value
=
"获取新闻列表"
)
public
ObjectRestResponse
<
Article
>
findAll
(
@RequestBody
ArticleQuery
query
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
findAll
(
query
));
}
@Override
@PutMapping
(
"/update"
)
@ApiOperation
(
value
=
"修改"
)
public
ObjectRestResponse
update
(
@RequestBody
Article
article
){
int
flag
=
baseBiz
.
updateSelectiveByIdRe
(
article
);
if
(
flag
==
1
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createDefaultFail
();
}
@PutMapping
(
"/putaway/{id}"
)
@ApiOperation
(
value
=
"上架"
)
public
ObjectRestResponse
putaway
(
@PathVariable
Integer
id
){
int
flag
=
baseBiz
.
putaway
(
id
);
if
(
flag
==
1
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createDefaultFail
();
}
@PutMapping
(
"/soldOut/{id}"
)
@ApiOperation
(
value
=
"下架"
)
public
ObjectRestResponse
soldOut
(
@PathVariable
Integer
id
){
int
flag
=
baseBiz
.
soldOut
(
id
);
if
(
flag
==
1
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createDefaultFail
();
}
@PutMapping
(
"/remove/{id}"
)
@ApiOperation
(
value
=
"删除"
)
public
ObjectRestResponse
remove
(
@PathVariable
Integer
id
){
int
flag
=
baseBiz
.
remove
(
id
);
if
(
flag
==
1
)
{
return
ObjectRestResponse
.
succ
();
}
return
ObjectRestResponse
.
createDefaultFail
();
}
}
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