Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gic-webapp-plug
Overview
Overview
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
base_platform_enterprise
gic-webapp-plug
Commits
f6a70f9b
Commit
f6a70f9b
authored
Sep 12, 2019
by
xub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签分页
parent
1d187edd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
GoodsTagController.java
...com/gic/plug/web/controller/goods/GoodsTagController.java
+12
-8
No files found.
src/main/java/com/gic/plug/web/controller/goods/GoodsTagController.java
View file @
f6a70f9b
package
com
.
gic
.
plug
.
web
.
controller
.
goods
;
import
com.gic.api.base.commons.Page
;
import
com.gic.api.base.commons.ServiceResponse
;
import
com.gic.commons.util.EntityUtil
;
import
com.gic.commons.util.PageHelperUtils
;
import
com.gic.commons.webapi.reponse.RestResponse
;
import
com.gic.goods.api.dto.ErrorCode
;
import
com.gic.goods.api.dto.GoodsTagDTO
;
import
com.gic.goods.api.dto.StandardDTO
;
import
com.gic.goods.api.service.TagApiService
;
import
com.gic.plug.web.vo.goods.GoodsTagVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.List
;
...
...
@@ -31,16 +35,16 @@ public class GoodsTagController {
* @author xub
*/
@GetMapping
(
"list-tag"
)
public
RestResponse
findList
(
Long
goodsDomainId
)
{
public
RestResponse
findList
(
@RequestParam
(
value
=
"currentPage"
,
defaultValue
=
"1"
)
Integer
currentPage
,
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"20"
)
Integer
pageSize
,
Long
goodsDomainId
)
{
if
(
goodsDomainId
==
null
)
{
return
RestResponse
.
failure
(
ErrorCode
.
UNKNOW_ERROR
.
getCode
(),
"参数不全"
);
}
ServiceResponse
<
List
<
GoodsTagDTO
>>
serviceResponse
=
tagApiService
.
listAll
(
goodsDomainId
);
List
<
GoodsTagDTO
>
result
=
serviceResponse
.
getResult
();
if
(
CollectionUtils
.
isEmpty
(
result
))
{
return
RestResponse
.
success
();
}
List
<
GoodsTagVO
>
list
=
EntityUtil
.
changeEntityListByOrika
(
GoodsTagVO
.
class
,
result
);
return
RestResponse
.
success
(
list
);
ServiceResponse
<
Page
<
GoodsTagDTO
>>
serviceResponse
=
tagApiService
.
listByPage
(
currentPage
,
pageSize
,
goodsDomainId
);
Page
<
GoodsTagVO
>
voPage
=
PageHelperUtils
.
changePageToCurrentPage
(
serviceResponse
.
getResult
(),
GoodsTagVO
.
class
);
return
RestResponse
.
success
(
voPage
);
}
}
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