记得上下班打卡 | 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
a0c0e466
Commit
a0c0e466
authored
Jan 21, 2022
by
胡佳晨
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev_goblin' into dev_goblin
parents
017f2036
9921fd14
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
GoblinShoppingCartVoo.java
...iquidnet/service/goblin/dto/vo/GoblinShoppingCartVoo.java
+1
-1
GoblinFrontLoginController.java
...service/goblin/controller/GoblinFrontLoginController.java
+7
-7
GoblinFrontServiceImpl.java
...t/service/goblin/service/impl/GoblinFrontServiceImpl.java
+10
-10
No files found.
liquidnet-bus-api/liquidnet-service-goblin-api/src/main/java/com/liquidnet/service/goblin/dto/vo/GoblinShoppingCartVoo.java
View file @
a0c0e466
...
...
@@ -24,7 +24,7 @@ public class GoblinShoppingCartVoo implements Serializable {
private
String
goblinShoppingCartId
;
//mongodb userid
private
String
userId
;
private
Integer
type
;
private
String
type
;
private
int
shoopingCount
;
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/controller/GoblinFrontLoginController.java
View file @
a0c0e466
...
...
@@ -29,13 +29,13 @@ public class GoblinFrontLoginController {
@GetMapping
(
"addShopCart"
)
@ApiOperation
(
"加入购物车"
)
public
ResponseDto
addShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
addShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
addShoopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
}
@GetMapping
(
"updateShopCart"
)
@ApiOperation
(
"修改购物车"
)
public
ResponseDto
updateShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
updateShopCart
(
@RequestParam
(
name
=
"spuId"
,
required
=
true
)
String
spuId
,
@RequestParam
(
name
=
"storeId"
,
required
=
true
)
String
storeId
,
@RequestParam
(
name
=
"skuId"
,
required
=
true
)
String
skuId
,
@RequestParam
(
name
=
"number"
,
required
=
false
)
Integer
number
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
updateShopCart
(
spuId
,
storeId
,
skuId
,
number
,
userId
,
type
));
}
...
...
@@ -43,25 +43,25 @@ public class GoblinFrontLoginController {
@GetMapping
(
"getShopCartCount"
)
@ApiOperation
(
"获取购物车数量"
)
public
ResponseDto
getShopCartCount
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
getShopCartCount
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getShopCartCount
(
userId
,
type
));
}
@PostMapping
(
"deleteShopCart"
)
@ApiOperation
(
"删除购物车"
)
public
ResponseDto
deleteShopCart
(
@RequestParam
(
name
=
"skuIds"
,
required
=
false
)
String
skuIds
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
deleteShopCart
(
@RequestParam
(
name
=
"skuIds"
,
required
=
false
)
String
skuIds
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
delteShoppingCart
(
skuIds
.
split
(
","
),
userId
,
type
));
}
@PostMapping
(
"saveData"
)
@ApiOperation
(
"保存数据购物车过度"
)
public
ResponseDto
saveData
(
@RequestParam
(
name
=
"data"
,
required
=
false
)
String
data
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
saveData
(
@RequestParam
(
name
=
"data"
,
required
=
false
)
String
data
,
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
saveDate
(
data
,
userId
,
type
));
}
@PostMapping
(
"getData"
)
@ApiOperation
(
"获得购物车过度"
)
public
ResponseDto
getData
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
getData
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getDate
(
userId
,
type
));
}
...
...
@@ -69,7 +69,7 @@ public class GoblinFrontLoginController {
@GetMapping
(
"getShopCart"
)
@ApiOperation
(
"获得购物车列表"
)
public
ResponseDto
<
GoblinShoppingCartVoo
>
getShopCart
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
Integer
type
)
{
public
ResponseDto
<
GoblinShoppingCartVoo
>
getShopCart
(
@RequestParam
(
name
=
"type"
,
required
=
true
)
String
type
)
{
String
userId
=
CurrentUtil
.
getCurrentUid
();
return
ResponseDto
.
success
(
goblinFrontService
.
getShoppCart
(
userId
,
type
));
}
...
...
liquidnet-bus-service/liquidnet-service-goblin/liquidnet-service-goblin-impl/src/main/java/com/liquidnet/service/goblin/service/impl/GoblinFrontServiceImpl.java
View file @
a0c0e466
...
...
@@ -794,7 +794,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* @Description:添加购物车
* @date 2022/1/11 下午4:16
*/
public
boolean
addShoopCart
(
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
Integer
type
){
public
boolean
addShoopCart
(
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
String
type
){
if
(
null
==
number
||
number
<=
0
){
return
false
;
}
...
...
@@ -874,7 +874,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* @Description: 修改 购物车里 数量
* @date 2022/1/11 下午6:24
*/
public
boolean
updateShopCart
(
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
Integer
type
){
public
boolean
updateShopCart
(
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
String
type
){
if
(
null
==
number
||
number
<=
0
){
return
false
;
}
...
...
@@ -902,7 +902,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
return
true
;
}
public
int
getShopCartCount
(
String
userId
,
Integer
type
){
public
int
getShopCartCount
(
String
userId
,
String
type
){
log
.
info
(
"获取商品数量{}"
,
userId
);
int
count
=
0
;
GoblinShoppingCartVoo
goblinShoppingCartVoo
=
(
GoblinShoppingCartVoo
)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
).
concat
(
type
.
toString
()));
...
...
@@ -922,11 +922,11 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* @Description:存储信息
* @date 2022/1/17 下午4:55
*/
public
boolean
saveDate
(
String
data
,
String
userId
,
Integer
type
)
{
public
boolean
saveDate
(
String
data
,
String
userId
,
String
type
)
{
redisUtil
.
set
(
GoblinRedisConst
.
FRONT_SHOPCART_TWO
.
concat
(
userId
).
concat
(
type
.
toString
()),
data
,
60
*
60
*
24
);
return
true
;
}
public
String
getDate
(
String
userId
,
Integer
type
)
{
public
String
getDate
(
String
userId
,
String
type
)
{
if
(
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART_TWO
.
concat
(
userId
).
concat
(
type
.
toString
()))==
null
){
return
""
;
}
...
...
@@ -935,7 +935,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
/**
* 删除购物车里面的商品
*/
public
boolean
delteShoppingCart
(
String
[]
skuIds
,
String
userId
,
Integer
type
)
{
public
boolean
delteShoppingCart
(
String
[]
skuIds
,
String
userId
,
String
type
)
{
boolean
isDeleteAll
=
false
;
GoblinShoppingCartVoo
goblinShoppingCartVoo
=
(
GoblinShoppingCartVoo
)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
));
if
(
null
!=
goblinShoppingCartVoo
)
{
...
...
@@ -981,7 +981,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
* @Description: 获得购物车列表
* @date 2022/1/12 下午2:36
*/
public
GoblinShoppingCartVoo
getShoppCart
(
String
userId
,
Integer
type
){
public
GoblinShoppingCartVoo
getShoppCart
(
String
userId
,
String
type
){
//判断该用户 redis里是否有购物车
GoblinShoppingCartVoo
goblinShoppingCartVoo
=
(
GoblinShoppingCartVoo
)
redisUtil
.
get
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
).
concat
(
type
.
toString
()));
if
(
null
==
goblinShoppingCartVoo
){
...
...
@@ -1014,7 +1014,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
goblinShoppingCartVoDetail
.
setUpdatedAt
(
LocalDateTime
.
now
());
return
goblinShoppingCartVoDetail
;
}
public
void
saveRedisMongodbMysqlShop
(
GoblinShoppingCartVoo
goblinShoppingCartVoo
,
String
userId
,
Integer
type
){
public
void
saveRedisMongodbMysqlShop
(
GoblinShoppingCartVoo
goblinShoppingCartVoo
,
String
userId
,
String
type
){
goblinShoppingCartVoo
.
setUserId
(
userId
);
//redis存储
redisUtil
.
set
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
).
concat
(
type
.
toString
()),
goblinShoppingCartVoo
);
...
...
@@ -1033,7 +1033,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
//mysql 消息队列
}
//删除redis 删除mongodb
public
void
deleteRedisMongodbMysqlShop
(
GoblinShoppingCartVoo
goblinShoppingCartVoo
,
String
userId
,
String
[]
skuIds
,
Integer
type
){
public
void
deleteRedisMongodbMysqlShop
(
GoblinShoppingCartVoo
goblinShoppingCartVoo
,
String
userId
,
String
[]
skuIds
,
String
type
){
//redis存储
redisUtil
.
del
(
GoblinRedisConst
.
FRONT_SHOPCART
.
concat
(
userId
).
concat
(
type
.
toString
()));
//mongodb 删除
...
...
@@ -1051,7 +1051,7 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
log
.
debug
(
"sql信息{}"
,
sqlDatas
);
queueUtils
.
sendMsgByRedis
(
MQConst
.
GoblinQueue
.
GOBLIN_SHOP_CART
.
getKey
(),
sqlDatas
);
}
public
void
insertShopCartMysql
(
String
carId
,
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
Integer
type
){
public
void
insertShopCartMysql
(
String
carId
,
String
spuId
,
String
storeId
,
String
skuId
,
Integer
number
,
String
userId
,
String
type
){
LinkedList
<
String
>
sqls
=
CollectionUtil
.
linkedListString
();
sqls
.
add
(
SqlMapping
.
get
(
"goblin_shop.cart.insert"
));
LinkedList
<
Object
[]>
sqlData
=
CollectionUtil
.
linkedListObjectArr
();
...
...
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