Toggle navigation
Toggle navigation
This project
Loading...
Sign in
ufo
/
ufo-platform
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
wujiexiang
5 years ago
Commit
1f128822cf988b9e2995d614b0b9e8347b51825d
1 parent
899c15c2
添加请求注解
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
coupon/src/main/java/com/yoho/ufo/coupon/service/ProductServiceCaller.java
product/src/main/java/com/yoho/ufo/controller/brand/BrandSeriesController.java
product/src/main/java/com/yoho/ufo/controller/commoditybasicrules/productsort/ProductSortController.java
coupon/src/main/java/com/yoho/ufo/coupon/service/ProductServiceCaller.java
View file @
1f12882
...
...
@@ -2,7 +2,6 @@ package com.yoho.ufo.coupon.service;
import
com.yoho.core.rest.client.ServiceCaller
;
import
com.yoho.error.exception.ServiceException
;
import
com.yoho.ufo.coupon.service.impl.CouponServiceImpl
;
import
com.yohobuy.ufo.model.common.BatchRequest
;
import
com.yohobuy.ufo.model.request.brand.BrandSeriesResponseBo
;
import
com.yohobuy.ufo.model.response.productsort.ProductSortResponseBo
;
...
...
@@ -18,7 +17,7 @@ import java.util.stream.Collectors;
@Service
public
class
ProductServiceCaller
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
CouponServiceImpl
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
ProductServiceCaller
.
class
);
@Autowired
private
ServiceCaller
serviceCaller
;
...
...
@@ -30,7 +29,7 @@ public class ProductServiceCaller {
*/
public
List
<
String
>
getFullCategoryIdsBySubIds
(
List
<
Integer
>
subIds
)
{
logger
.
info
(
"getFullCategoryIdsBySubIds params:{}"
,
subIds
);
BatchRequest
batchRequest
=
new
BatchRequest
();
BatchRequest
<
Integer
>
batchRequest
=
new
BatchRequest
<>
();
batchRequest
.
setParams
(
subIds
);
ProductSortResponseBo
[]
bos
=
serviceCaller
.
call
(
"ufoPlatform.getBaseSortsById"
,
batchRequest
,
ProductSortResponseBo
[].
class
);
List
<
String
>
fullIds
=
Arrays
.
stream
(
bos
).
map
(
bo
->
new
StringBuilder
().
append
(
bo
.
getParentId
()).
append
(
"-"
).
append
(
bo
.
getId
()).
toString
()).
collect
(
Collectors
.
toList
());
...
...
@@ -48,7 +47,7 @@ public class ProductServiceCaller {
*/
public
List
<
String
>
getFullSeriesIdsBySubIds
(
List
<
Integer
>
subIds
)
{
logger
.
info
(
"getFullSeriesIdsBySubIds params:{}"
,
subIds
);
BatchRequest
batchRequest
=
new
BatchRequest
();
BatchRequest
<
Integer
>
batchRequest
=
new
BatchRequest
<>
();
batchRequest
.
setParams
(
subIds
);
BrandSeriesResponseBo
[]
bos
=
serviceCaller
.
call
(
"ufoPlatform.getBrandSeriesByIds"
,
batchRequest
,
BrandSeriesResponseBo
[].
class
);
List
<
String
>
fullIds
=
Arrays
.
stream
(
bos
).
map
(
bo
->
new
StringBuilder
().
append
(
bo
.
getBrandId
()).
append
(
"-"
).
append
(
bo
.
getId
()).
toString
()).
collect
(
Collectors
.
toList
());
...
...
product/src/main/java/com/yoho/ufo/controller/brand/BrandSeriesController.java
View file @
1f12882
...
...
@@ -8,6 +8,7 @@ import com.yohobuy.ufo.model.request.brand.BrandSeriesRequestBo;
import
com.yohobuy.ufo.model.request.brand.BrandSeriesResponseBo
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -64,7 +65,7 @@ public class BrandSeriesController {
}
@RequestMapping
(
value
=
"/getBrandSeriesByIds"
)
public
List
<
BrandSeriesResponseBo
>
getBrandSeriesByIds
(
BatchRequest
<
Integer
>
batchRequest
)
{
public
List
<
BrandSeriesResponseBo
>
getBrandSeriesByIds
(
@RequestBody
BatchRequest
<
Integer
>
batchRequest
)
{
LOGGER
.
info
(
"getBrandSeriesByIds param = {}"
,
batchRequest
.
getParams
());
return
brandSeriesService
.
getBrandSeriesByIds
(
batchRequest
.
getParams
());
}
...
...
product/src/main/java/com/yoho/ufo/controller/commoditybasicrules/productsort/ProductSortController.java
View file @
1f12882
...
...
@@ -12,6 +12,7 @@ import com.yohobuy.ufo.model.response.productsort.ProductSortTreeViewResponseBo;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -146,7 +147,7 @@ public class ProductSortController {
// 根据分类id集合查询分类的信息
@RequestMapping
(
value
=
"/getBaseSortsById"
)
public
List
<
ProductSortResponseBo
>
getBaseSortsById
(
BatchRequest
<
Integer
>
batchRequest
)
{
public
List
<
ProductSortResponseBo
>
getBaseSortsById
(
@RequestBody
BatchRequest
<
Integer
>
batchRequest
)
{
LOGGER
.
info
(
"getBaseSortsById param = {}"
,
batchRequest
.
getParams
());
return
productSortService
.
getBaseSortsById
(
batchRequest
.
getParams
());
}
...
...
Please
register
or
login
to post a comment