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
fc871e29
Commit
fc871e29
authored
Dec 08, 2020
by
unset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增官网咨询和banner
parent
e97282fc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
7 deletions
+20
-7
ArticleBiz.java
.../src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
+17
-5
ArticleController.java
...n/java/com/xxfc/platform/uccn/rest/ArticleController.java
+3
-2
No files found.
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/biz/ArticleBiz.java
View file @
fc871e29
...
...
@@ -3,17 +3,16 @@ package com.xxfc.platform.uccn.biz;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.xxfc.platform.uccn.comstnt.UrlType
;
import
com.xxfc.platform.uccn.entity.Article
;
import
com.xxfc.platform.uccn.mapper.ArticleMapper
;
import
com.xxfc.platform.uccn.vo.ArticleQuery
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
java.security.SecureRandom
;
import
java.util.*
;
...
...
@@ -43,10 +42,23 @@ public class ArticleBiz extends BaseBiz<ArticleMapper, Article> {
* @param type
* @return
*/
public
PageInfo
getArticleList
(
Integer
page
,
Integer
limit
,
Integer
type
,
String
title
)
{
public
PageInfo
getArticleList
(
Integer
page
,
Integer
limit
,
Integer
type
,
String
title
,
Integer
typeId
)
{
PageHelper
.
startPage
(
page
,
limit
);
List
articleList
=
mapper
.
getArticleList
(
type
,
null
,
null
,
title
);
return
PageInfo
.
of
(
articleList
);
Example
example
=
new
Example
(
Article
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
type
!=
null
)
{
criteria
.
andEqualTo
(
"type"
,
type
);
}
if
(
StringUtils
.
isNotBlank
(
title
))
{
criteria
.
andEqualTo
(
"title"
,
"%"
+
title
+
"%"
);
}
if
(
typeId
!=
null
)
{
criteria
.
andEqualTo
(
"typeId"
,
typeId
);
}
criteria
.
andEqualTo
(
"isDel"
,
0
);
criteria
.
andEqualTo
(
"status"
,
1
);
example
.
orderBy
(
"weight"
).
asc
();
return
PageInfo
.
of
(
mapper
.
selectByExample
(
example
));
}
/**
...
...
xx-uccn/xx-uccn-server/src/main/java/com/xxfc/platform/uccn/rest/ArticleController.java
View file @
fc871e29
...
...
@@ -26,8 +26,9 @@ public class ArticleController extends BaseController<ArticleBiz, Article> {
@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
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getArticleList
(
page
,
limit
,
type
,
title
));
@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"
)
...
...
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