Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
platform
/
platform-shopmall-parent
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit fb762e15
authored
Apr 26, 2023
by
刘宇峰
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
查询商品详情-新增从云中鹤查商品详情接口,方便跟踪信息
1 parent
36ae66b9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
5 deletions
platform-shopmall/src/main/java/cn/com/glsx/admin/modules/api/GoodsApiController.java
platform-shopmall/src/main/java/cn/com/glsx/admin/modules/service/GoodsService.java
platform-shopmall/src/test/java/cn/com/glsx/admin/modules/service/GoodsServiceTest.java
platform-shopmall/src/main/java/cn/com/glsx/admin/modules/api/GoodsApiController.java
View file @
fb762e1
...
...
@@ -11,6 +11,8 @@ import io.swagger.v3.oas.annotations.Operation;
import
io.swagger.v3.oas.annotations.tags.Tag
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.http.MediaType
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -41,10 +43,16 @@ public class GoodsApiController implements ShopmallGoodsApiService {
return
goodsService
.
queryGoodsListByCondition
(
req
);
}
@Operation
(
summary
=
"获取商品详情信息接口
"
,
description
=
"查询获取云中鹤平台商城商品详情信息
"
)
@Operation
(
summary
=
"获取商品详情信息接口
(本地库)"
,
description
=
"查询获取云中鹤平台商城商品详情信息(本地库同步数据)
"
)
@Override
public
List
<
QueryGoodsDetailResponse
>
queryGoodsDetail
(
@NotEmpty
@RequestParam
(
"goodsSkuCodes"
)
List
<
String
>
goodsSkuCodes
)
{
return
goodsService
.
queryGoodsDetail
(
goodsSkuCodes
);
return
goodsService
.
queryGoodsDetail
(
goodsSkuCodes
,
false
);
}
@Operation
(
summary
=
"获取商品详情信息接口(云中鹤)"
,
description
=
"查询获取云中鹤平台商城商品详情信息(云中鹤接口数据)"
)
@GetMapping
(
value
=
"goods/queryCraneGoodsDetail"
,
produces
=
MediaType
.
APPLICATION_JSON_VALUE
)
public
List
<
QueryGoodsDetailResponse
>
queryCraneGoodsDetail
(
@NotEmpty
@RequestParam
(
"goodsSkuCodes"
)
List
<
String
>
goodsSkuCodes
)
{
return
goodsService
.
queryGoodsDetail
(
goodsSkuCodes
,
true
);
}
@Operation
(
summary
=
"获取商品图片列表接口"
,
description
=
"查询获取云中鹤平台商城商品图片信息列表"
)
...
...
platform-shopmall/src/main/java/cn/com/glsx/admin/modules/service/GoodsService.java
View file @
fb762e1
...
...
@@ -109,9 +109,11 @@ public class GoodsService implements InitializingBean {
* @author huangch
* @date 2023/4/11 10:12
*/
public
List
<
QueryGoodsDetailResponse
>
queryGoodsDetail
(
List
<
String
>
goodsSkuCodes
)
{
public
List
<
QueryGoodsDetailResponse
>
queryGoodsDetail
(
List
<
String
>
goodsSkuCodes
,
boolean
isFromCrane
)
{
Assert
.
notEmpty
(
goodsSkuCodes
,
"goodsSkuCodes cannot be empty."
);
// cloudCraneService.queryGoodsDetail(goodsSkuCodes);
if
(
isFromCrane
)
{
return
cloudCraneService
.
queryGoodsDetail
(
goodsSkuCodes
);
}
List
<
Goods
>
goodsList
=
goodsMapper
.
queryGoodsDetail
(
goodsSkuCodes
);
List
<
QueryGoodsDetailResponse
>
goodsDetailList
=
goodsList
.
parallelStream
().
map
(
GoodsConverter
.
INSTANCE
::
toGoodsDetailResponse
).
collect
(
Collectors
.
toList
());
...
...
platform-shopmall/src/test/java/cn/com/glsx/admin/modules/service/GoodsServiceTest.java
View file @
fb762e1
...
...
@@ -41,7 +41,7 @@ public class GoodsServiceTest {
@Test
public
void
testQueryGoodsInfo
()
{
List
<
String
>
goodsSkuCodes
=
Lists
.
newArrayList
(
"2888888889106479"
);
List
<
QueryGoodsDetailResponse
>
goodsDetailList
=
goodsService
.
queryGoodsDetail
(
goodsSkuCodes
);
List
<
QueryGoodsDetailResponse
>
goodsDetailList
=
goodsService
.
queryGoodsDetail
(
goodsSkuCodes
,
false
);
System
.
out
.
println
(
goodsDetailList
);
// System.out.println(goodsService.queryGoodsImageList(goodsSkuCodes));
// System.out.println(goodsService.queryGoodsShelvesList(goodsSkuCodes));
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment