记得上下班打卡 | git大法好,push需谨慎
Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liquidnet-bus-v1
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
董敬伟
liquidnet-bus-v1
Commits
dd1f7480
Commit
dd1f7480
authored
Aug 07, 2026
by
wangyifan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c端 专题相关接口
parent
50070970
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
603 additions
and
2 deletions
+603
-2
GoblinFrontArtistTopicDetailVo.java
...service/goblin/dto/vo/GoblinFrontArtistTopicDetailVo.java
+62
-0
GoblinFrontArtistTopicHomeVo.java
...t/service/goblin/dto/vo/GoblinFrontArtistTopicHomeVo.java
+45
-0
GoblinFrontArtistTopicListPageVo.java
...rvice/goblin/dto/vo/GoblinFrontArtistTopicListPageVo.java
+48
-0
GoblinFrontArtistTopicController.java
...e/goblin/controller/GoblinFrontArtistTopicController.java
+67
-0
GoblinFrontController.java
...dnet/service/goblin/controller/GoblinFrontController.java
+17
-0
GoblinFrontArtistTopicServiceImpl.java
...oblin/service/impl/GoblinFrontArtistTopicServiceImpl.java
+305
-0
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+59
-2
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinFrontArtistTopicDetailVo.java
0 → 100644
View file @
dd1f7480
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.util.ArrayList
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinFrontArtistTopicDetailVo"
,
description
=
"C端艺人专题详情"
)
@Data
public
class
GoblinFrontArtistTopicDetailVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"专题ID"
)
private
String
topicId
;
@ApiModelProperty
(
"专题名称"
)
private
String
topicName
;
@ApiModelProperty
(
"关联艺人ID"
)
private
String
artistId
;
@ApiModelProperty
(
"艺人名称"
)
private
String
artistName
;
@ApiModelProperty
(
"艺人头像"
)
private
String
avatarUrl
;
@ApiModelProperty
(
"模版类型 1双列 2单列"
)
private
Integer
templateType
;
@ApiModelProperty
(
"专题banner"
)
private
String
bannerUrl
;
@ApiModelProperty
(
"banner高度px"
)
private
Integer
bannerHeight
;
@ApiModelProperty
(
"上架区间开始"
)
private
LocalDateTime
onSaleStart
;
@ApiModelProperty
(
"上架区间结束"
)
private
LocalDateTime
onSaleEnd
;
@ApiModelProperty
(
"商品列表(仅已上架可售)"
)
private
List
<
GoodsItem
>
goods
=
new
ArrayList
<>();
@Data
public
static
class
GoodsItem
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"商品SPU ID"
)
private
String
spuId
;
@ApiModelProperty
(
"商品名称"
)
private
String
name
;
@ApiModelProperty
(
"商品头图"
)
private
String
coverPic
;
@ApiModelProperty
(
"销售价"
)
private
BigDecimal
sellPrice
;
@ApiModelProperty
(
"价格区间MIN"
)
private
BigDecimal
priceGe
;
@ApiModelProperty
(
"价格区间MAX"
)
private
BigDecimal
priceLe
;
@ApiModelProperty
(
"专题内排序"
)
private
Integer
sort
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinFrontArtistTopicHomeVo.java
0 → 100644
View file @
dd1f7480
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinFrontArtistTopicHomeVo"
,
description
=
"C端艺人专题首页入口"
)
@Data
public
class
GoblinFrontArtistTopicHomeVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"推荐位专题(按推荐号位升序)"
)
private
List
<
TopicItem
>
topics
=
new
ArrayList
<>();
@ApiModelProperty
(
"可见专题总数(更多入口)"
)
private
long
total
;
@Data
public
static
class
TopicItem
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"专题ID"
)
private
String
topicId
;
@ApiModelProperty
(
"专题名称"
)
private
String
topicName
;
@ApiModelProperty
(
"专题banner"
)
private
String
bannerUrl
;
@ApiModelProperty
(
"banner高度px"
)
private
Integer
bannerHeight
;
@ApiModelProperty
(
"推荐号位1~5"
)
private
Integer
recommendPosition
;
@ApiModelProperty
(
"关联艺人ID"
)
private
String
artistId
;
@ApiModelProperty
(
"艺人名称"
)
private
String
artistName
;
@ApiModelProperty
(
"艺人头像"
)
private
String
avatarUrl
;
}
}
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinFrontArtistTopicListPageVo.java
0 → 100644
View file @
dd1f7480
package
com
.
liquidnet
.
service
.
goblin
.
dto
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
@ApiModel
(
value
=
"GoblinFrontArtistTopicListPageVo"
,
description
=
"C端艺人专题列表分页"
)
@Data
public
class
GoblinFrontArtistTopicListPageVo
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"页码"
)
private
int
page
;
@ApiModelProperty
(
"每页条数"
)
private
int
size
;
@ApiModelProperty
(
"总数"
)
private
long
total
;
@ApiModelProperty
(
"专题列表"
)
private
List
<
TopicItem
>
list
=
new
ArrayList
<>();
@Data
public
static
class
TopicItem
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
"专题ID"
)
private
String
topicId
;
@ApiModelProperty
(
"专题名称"
)
private
String
topicName
;
@ApiModelProperty
(
"专题banner"
)
private
String
bannerUrl
;
@ApiModelProperty
(
"banner高度px"
)
private
Integer
bannerHeight
;
@ApiModelProperty
(
"推荐号位1~5"
)
private
Integer
recommendPosition
;
@ApiModelProperty
(
"关联艺人ID"
)
private
String
artistId
;
@ApiModelProperty
(
"艺人名称"
)
private
String
artistName
;
@ApiModelProperty
(
"艺人头像"
)
private
String
avatarUrl
;
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontArtistTopicController.java
0 → 100644
View file @
dd1f7480
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.liquidnet.service.base.ResponseDto
;
import
com.liquidnet.service.goblin.dto.vo.GoblinFrontArtistTopicDetailVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinFrontArtistTopicHomeVo
;
import
com.liquidnet.service.goblin.dto.vo.GoblinFrontArtistTopicListPageVo
;
import
com.liquidnet.service.goblin.service.impl.GoblinFrontArtistTopicServiceImpl
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.validation.annotation.Validated
;
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
;
import
javax.validation.constraints.Min
;
import
javax.validation.constraints.NotBlank
;
/**
* C 端-艺人专题(周边商城)
*/
@Api
(
tags
=
"C端艺人专题"
)
@Slf4j
@Validated
@RestController
@RequestMapping
(
"front/artistTopic"
)
public
class
GoblinFrontArtistTopicController
{
@Autowired
private
GoblinFrontArtistTopicServiceImpl
artistTopicService
;
@GetMapping
(
"home"
)
@ApiOperation
(
"首页入口(推荐位专题+更多)"
)
public
ResponseDto
<
GoblinFrontArtistTopicHomeVo
>
home
()
{
return
artistTopicService
.
home
();
}
@GetMapping
(
"list"
)
@ApiOperation
(
"专题列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码"
,
dataType
=
"int"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"size"
,
value
=
"每页条数"
,
dataType
=
"int"
,
required
=
true
),
})
public
ResponseDto
<
GoblinFrontArtistTopicListPageVo
>
list
(
@Min
(
1
)
@RequestParam
(
defaultValue
=
"1"
)
int
page
,
@Min
(
1
)
@RequestParam
(
defaultValue
=
"20"
)
int
size
)
{
return
artistTopicService
.
list
(
page
,
size
);
}
@GetMapping
(
"detail"
)
@ApiOperation
(
"专题详情(商品支持 default/price 排序)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"topicId"
,
value
=
"专题ID"
,
dataType
=
"String"
,
required
=
true
),
@ApiImplicitParam
(
name
=
"sortType"
,
value
=
"商品排序 default-默认排序 price-价格排序"
,
dataType
=
"String"
,
allowableValues
=
"default,price"
),
@ApiImplicitParam
(
name
=
"sortOrder"
,
value
=
"价格排序方向 asc-升序 desc-降序(sortType=price时生效)"
,
dataType
=
"String"
,
allowableValues
=
"asc,desc"
),
})
public
ResponseDto
<
GoblinFrontArtistTopicDetailVo
>
detail
(
@NotBlank
(
message
=
"专题ID不能为空"
)
@RequestParam
String
topicId
,
@RequestParam
(
required
=
false
,
defaultValue
=
"default"
)
String
sortType
,
@RequestParam
(
required
=
false
,
defaultValue
=
"asc"
)
String
sortOrder
)
{
return
artistTopicService
.
detail
(
topicId
,
sortType
,
sortOrder
);
}
}
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontController.java
View file @
dd1f7480
package
com
.
liquidnet
.
service
.
goblin
.
controller
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.CurrentUtil
;
import
com.liquidnet.commons.lang.util.StringUtil
;
...
...
@@ -74,6 +75,22 @@ public class GoblinFrontController {
return
ResponseDto
.
success
(
goblinFrontService
.
getSelectGoods
(
pageNumber
,
pageSize
));
}
@GetMapping
(
"getSelectGoodsPage"
)
@ApiOperation
(
"商城商品真分页列表(page从1开始)"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"page"
,
value
=
"页码,从1开始"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"每页条数"
,
dataType
=
"int"
),
@ApiImplicitParam
(
name
=
"sortType"
,
value
=
"排序类型 default-默认排序 price-价格排序"
,
dataType
=
"String"
,
allowableValues
=
"default,price"
),
@ApiImplicitParam
(
name
=
"sortOrder"
,
value
=
"价格排序方向 asc-升序 desc-降序(sortType=price时生效)"
,
dataType
=
"String"
,
allowableValues
=
"asc,desc"
),
})
public
ResponseDto
<
PageInfo
<
GoblinGoodsInfoVo
>>
getSelectGoodsPage
(
@RequestParam
(
name
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
name
=
"pageSize"
,
required
=
false
,
defaultValue
=
"20"
)
int
pageSize
,
@RequestParam
(
name
=
"sortType"
,
required
=
false
,
defaultValue
=
"default"
)
String
sortType
,
@RequestParam
(
name
=
"sortOrder"
,
required
=
false
,
defaultValue
=
"asc"
)
String
sortOrder
)
{
return
ResponseDto
.
success
(
goblinFrontService
.
getSelectGoodsPage
(
page
,
pageSize
,
sortType
,
sortOrder
));
}
@GetMapping
(
"getGoodsDetail"
)
@ApiOperation
(
"获得商品详情"
)
@ApiImplicitParams
({
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontArtistTopicServiceImpl.java
0 → 100644
View file @
dd1f7480
This diff is collapsed.
Click to expand it.
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
dd1f7480
...
...
@@ -2,6 +2,7 @@ package com.liquidnet.service.goblin.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.github.pagehelper.PageInfo
;
import
com.liquidnet.common.cache.redis.util.RedisUtil
;
import
com.liquidnet.common.exception.LiquidnetServiceException
;
import
com.liquidnet.commons.lang.util.*
;
...
...
@@ -1027,8 +1028,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
if
(
StringUtil
.
isNotBlank
(
spuids
))
{
query
.
addCriteria
(
Criteria
.
where
(
"spuId"
).
nin
(
spuids
.
split
(
","
)));
}
query
.
addCriteria
(
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"marketId"
).
is
(
null
)
.
and
(
"spuType"
).
ne
(
33
).
and
(
"showInMall"
).
ne
(
0
).
and
(
"cateFid"
).
nin
(
"22196120924543"
,
"22196122839313"
).
and
(
"name"
).
not
().
regex
(
Pattern
.
compile
(
SELECT_GOODS_EXCLUDE_NAME
)));
query
.
addCriteria
(
selectGoodsCriteria
());
//redis里面获取排序规则 1、上架时间2、销量3、价格高到低4、价格低到高
...
...
@@ -1318,6 +1318,63 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
// return null;
}
/**
* 商城商品真分页列表:sortType default-后台配置排序 price-价格排序(page 从1开始)
*/
public
PageInfo
<
GoblinGoodsInfoVo
>
getSelectGoodsPage
(
int
page
,
int
pageSize
,
String
sortType
,
String
sortOrder
)
{
Query
query
=
new
Query
(
selectGoodsCriteria
());
long
total
=
mongoTemplate
.
count
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
Sort
sort
;
if
(
"price"
.
equals
(
sortType
))
{
Sort
.
Direction
direction
=
"desc"
.
equals
(
sortOrder
)
?
Sort
.
Direction
.
DESC
:
Sort
.
Direction
.
ASC
;
sort
=
Sort
.
by
(
direction
,
"priceGe"
);
query
.
collation
(
numericCollation
());
}
else
{
sort
=
configSort
(
query
);
}
query
.
with
(
PageRequest
.
of
(
Math
.
max
(
page
-
1
,
0
),
pageSize
,
sort
));
List
<
GoblinGoodsInfoVo
>
list
=
mongoTemplate
.
find
(
query
,
GoblinGoodsInfoVo
.
class
,
GoblinGoodsInfoVo
.
class
.
getSimpleName
());
PageInfo
<
GoblinGoodsInfoVo
>
pageInfo
=
new
PageInfo
<>(
list
);
pageInfo
.
setPageNum
(
page
);
pageInfo
.
setPageSize
(
pageSize
);
pageInfo
.
setTotal
(
total
);
pageInfo
.
setPages
((
int
)
((
total
+
pageSize
-
1
)
/
pageSize
));
return
pageInfo
;
}
/** 后台配置排序规则 1、上架时间 2、销量 3、价格高到低 4、价格低到高(同 getspuId) */
private
Sort
configSort
(
Query
query
)
{
int
sortType
=
0
;
if
(
redisUtil
.
hasKey
(
GoblinRedisConst
.
SELECT_GOODS_SORT
))
{
sortType
=
(
int
)
redisUtil
.
get
(
GoblinRedisConst
.
SELECT_GOODS_SORT
);
}
if
(
sortType
==
1
)
{
return
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"shelvesAt"
);
}
if
(
sortType
==
2
)
{
return
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"count"
,
"createdAt"
);
}
query
.
collation
(
numericCollation
());
return
sortType
==
3
?
Sort
.
by
(
Sort
.
Direction
.
DESC
,
"priceGe"
)
:
Sort
.
by
(
Sort
.
Direction
.
ASC
,
"priceGe"
);
}
/** 数值排序 collation(priceGe 字符串存储) */
private
Collation
numericCollation
()
{
Document
source
=
new
Document
();
source
.
put
(
"locale"
,
"zh"
);
source
.
put
(
"numericOrdering"
,
true
);
return
Collation
.
from
(
source
);
}
/** 精选商品过滤口径(与存量精选/首页货架一致) */
private
Criteria
selectGoodsCriteria
()
{
return
Criteria
.
where
(
"delFlg"
).
is
(
"0"
).
and
(
"shelvesStatus"
).
is
(
"3"
).
and
(
"spuAppear"
).
is
(
"0"
).
and
(
"marketId"
).
is
(
null
)
.
and
(
"spuType"
).
ne
(
33
).
and
(
"showInMall"
).
ne
(
0
).
and
(
"cateFid"
).
nin
(
"22196120924543"
,
"22196122839313"
)
.
and
(
"name"
).
not
().
regex
(
Pattern
.
compile
(
SELECT_GOODS_EXCLUDE_NAME
));
}
@Override
public
GoblinSqbPerformanceSelectGoodVo
getPerformanceSelectGoods
(
String
performancesId
,
int
page
,
int
pageSize
)
{
GoblinSqbPerformanceSelectGoodVo
respVo
=
GoblinSqbPerformanceSelectGoodVo
.
getNew
();
...
...
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