记得上下班打卡 | git大法好,push需谨慎

Commit 4c733f66 authored by zhengfuxin's avatar zhengfuxin

修改购物车

parent f5841133
......@@ -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 = false) 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) Integer 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 = false) 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) Integer 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 = false)Integer type) {
public ResponseDto getShopCartCount(@RequestParam(name = "type", required = true)Integer 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 = false) Integer type) {
public ResponseDto deleteShopCart(@RequestParam(name = "skuIds", required = false) String skuIds,@RequestParam(name = "type", required = true) Integer 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 = false)Integer type) {
public ResponseDto saveData(@RequestParam(name = "data", required = false)String data,@RequestParam(name = "type", required = true)Integer type) {
String userId=CurrentUtil.getCurrentUid();
return ResponseDto.success(goblinFrontService.saveDate(data,userId,type));
}
@PostMapping("getData")
@ApiOperation("获得购物车过度")
public ResponseDto getData(@RequestParam(name = "type", required = false)Integer type) {
public ResponseDto getData(@RequestParam(name = "type", required = true)Integer 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 = false)Integer type) {
public ResponseDto<GoblinShoppingCartVoo> getShopCart(@RequestParam(name = "type", required = true)Integer type) {
String userId=CurrentUtil.getCurrentUid();
return ResponseDto.success(goblinFrontService.getShoppCart(userId,type));
}
......
......@@ -937,7 +937,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
GoblinShoppingCartVoo goblinShoppingCartVoo = (GoblinShoppingCartVoo) redisUtil.get(GoblinRedisConst.FRONT_SHOPCART.concat(userId));
if (null != goblinShoppingCartVoo) {
List<GoblinShoppingCartVo> shopList = goblinShoppingCartVoo.getShopList();
Iterator<GoblinShoppingCartVo> shopIter = shopList.iterator();
while (shopIter.hasNext()){
GoblinShoppingCartVo goblinShoppingCartVo=shopIter.next();
......@@ -1046,9 +1045,8 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
}
String sqlDatas = SqlMapping.gets(sqls, sqlData);
log.info("sql信息{}",sqlDatas);
log.debug("sql信息{}",sqlDatas);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SHOP_CART.getKey(), sqlDatas);
log.info("发送购物车消息队列完毕");
}
public void insertShopCartMysql(String carId ,String spuId, String storeId,String skuId,Integer number,String userId,Integer type){
LinkedList<String> sqls = CollectionUtil.linkedListString();
......@@ -1060,7 +1058,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
String sqlDatas = SqlMapping.gets(sqls, sqlData);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SHOP_CART.getKey(), sqlDatas);
log.info("发送购物车消息队列完毕");
}
public void updateShopCartMysql(String carId ,Integer number,String userId){
LinkedList<String> sqls = CollectionUtil.linkedListString();
......@@ -1072,7 +1069,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
});
String sqlDatas = SqlMapping.gets(sqls, sqlData);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SHOP_CART.getKey(), sqlDatas);
log.info("发送购物车消息队列完毕");
}
//删除
......@@ -1089,7 +1085,6 @@ public class GoblinFrontServiceImpl implements GoblinFrontService {
String sqlDatas = SqlMapping.gets(sqls, sqlData);
log.info(sqlDatas);
queueUtils.sendMsgByRedis(MQConst.GoblinQueue.GOBLIN_SHOP_CART.getKey(), sqlDatas);
log.info("发送购物车消息队列完毕");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment