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
5cfb478d
Commit
5cfb478d
authored
Aug 27, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加排序
parent
72f75b73
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
1 deletion
+28
-1
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+18
-1
ArticleController.java
...n/java/com/xxfc/platform/uccn/rest/ArticleController.java
+10
-0
No files found.
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
5cfb478d
...
@@ -3,10 +3,10 @@ package com.xxfc.platform.uccn.biz;
...
@@ -3,10 +3,10 @@ package com.xxfc.platform.uccn.biz;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.uccn.entity.Article
;
import
com.xxfc.platform.uccn.entity.Article
;
import
com.xxfc.platform.uccn.mapper.ArticleMapper
;
import
com.xxfc.platform.uccn.mapper.ArticleMapper
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
...
@@ -104,4 +104,21 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
...
@@ -104,4 +104,21 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
}
}
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
add
(
Article
article
)
{
if
(
article
==
null
)
{
return
;
}
article
.
setIsDel
(
0
);
if
(
article
.
getStatus
()==
null
){
article
.
setStatus
(
0
);
}
if
(
article
.
getType
()==
null
){
article
.
setType
(
0
);
}
article
.
setCreTime
(
new
Date
());
mapper
.
insertSelective
(
article
);
}
}
}
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/ArticleController.java
View file @
5cfb478d
...
@@ -48,4 +48,14 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
...
@@ -48,4 +48,14 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
public
ObjectRestResponse
getHomePageArticle
(
@PathVariable
Integer
type
){
public
ObjectRestResponse
getHomePageArticle
(
@PathVariable
Integer
type
){
return
ObjectRestResponse
.
succ
(
baseBiz
.
getHomePageArticle
(
type
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
getHomePageArticle
(
type
));
}
}
@Override
@PostMapping
(
"/add"
)
@ApiOperation
(
value
=
"获取首页文章列表"
)
public
ObjectRestResponse
add
(
@RequestBody
Article
article
){
baseBiz
.
add
(
article
);
return
ObjectRestResponse
.
succ
();
}
}
}
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