好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > Redis實戰之商城購物車功能的實現代碼

Redis實戰之商城購物車功能的實現代碼

熱門標簽:魔獸2青云地圖標注 北京400電話辦理收費標準 十堰營銷電銷機器人哪家便宜 日本中國地圖標注 貴州電銷卡外呼系統 鄭州人工智能電銷機器人系統 超呼電話機器人 宿遷便宜外呼系統平臺 山東外呼銷售系統招商

目標

利用Redis實現商城購物車功能。

功能

根據用戶編號查詢購物車列表,且各個商品需要跟在對應的店鋪下;統計購物車中的商品總數;新增或刪減購物車商品;增加或減少購物車中的商品數量。


分析

Hash數據類型:值為多組映射,相當于JAVA中的Map。適合存儲對象數據類型。因為用戶ID作為唯一的身份標識,所以可以把模塊名稱+用戶ID作為Redis的鍵;商品ID作為商品的唯一標識,可以把店鋪編號+商品ID作為Hash元素的鍵,商品數量為元素的值。


代碼實現

控制層

package com.shoppingcart.controller;
 
import com.shoppingcart.service.ShoppingCartServer;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
 
/**
 * redis實現購物車功能
 */
@RestController
@RequestMapping("/shoppingCart")
public class ShoppingCartController {
 @Resource
 private ShoppingCartServer shoppingCartServer;
 
 /**
  * http://localhost:8099/shoppingCart/addCommodity?userId=001shopId=1234560commodityId=001commodityNum=336
  * 添加商品
  * @return
  * @param: userId 用戶ID
  * @param: [{shopId:商鋪id,commodityId:商品id,commodityNum:商品數量},{shopId:商鋪id,commodityId:商品id,commodityNum:商品數量}]
  * 測試數據:
  [
  {
  "shopId": 123,
  "commodityId": 145350,
  "commodityNum": 155.88
  },
  {
  "shopId": 123,
  "commodityId": 6754434,
  "commodityNum": 945.09
  },
  {
  "shopId": 123,
  "commodityId": 7452,
  "commodityNum": 2445.09
  },
  {
  "shopId": 3210,
  "commodityId": 98766,
  "commodityNum": 2345.09
  },
  {
  "shopId": 456,
  "commodityId": 2435640,
  "commodityNum": 11945.09
  }
  ]
  */
 @GetMapping("/addCommodity")
 public MapString, Object> addCommodity(
   @RequestParam(value = "userId", required = true) String userId,
   @RequestBody ListMapString, Object>> list
 ) {
  MapString, Object> map = shoppingCartServer.addCommodity(userId, list);
  return map;
 }
 
 /**
  * 購物車列表
  * http://localhost:8099/shoppingCart/shoppingCartList?userId=001
  *
  * @param userId
  * @return 返回{店鋪ID:商品ID=商品數量}的map。
  */
 @GetMapping("/shoppingCartList")
 public MapObject, Object> shoppingCartList(
   @RequestParam(value = "userId", required = true) String userId,
   @RequestParam(value = "pageNo", defaultValue = "0") Long pageNo,
   @RequestParam(value = "pageSize", defaultValue = "10") Long pageSize
 ) {
  MapObject, Object> map = shoppingCartServer.shoppingCartList(userId, pageNo, pageSize);
  return map;
 }
 
 /**
  * http://localhost:8099/shoppingCart/updateNum?userId=001shopId=01comId=123456num=342
  * 修改商品數量。
  *
  * @param userId  用戶id
  * @param commodityId 商品id
  * @param commodityNum 商品數量
  * @return
  */
 @GetMapping("/updateNum")
 public MapString, Object> updateNum(
   @RequestParam(value = "userId", required = true) String userId,
   @RequestParam(value = "shopId", required = true) Long shopId,
   @RequestParam(value = "commodityId", required = true) Long commodityId,
   @RequestParam(value = "commodityNum", required = true) Double commodityNum
 ) {
  return shoppingCartServer.updateNum(userId, shopId, commodityId, commodityNum);
 }
 
 /**
  * http://localhost:8099/shoppingCart/delCom?userId=001shopId=01comId=123457
  * 刪除購物車中的商品
  * @return
  * @param: userId 用戶id
  * @param: [{shopId:商鋪id,commodityId:商品id},{shopId:商鋪id,commodityId:商品id}]
  */
 @PostMapping("/delCommodity")
 public MapString, Object> delCommodity(
   @RequestParam(value = "userId", required = true) String userId,
   @RequestBody ListMapString, Object>> list
 ) {
  return shoppingCartServer.delCommodity(userId, list);
 }
}

業務層

package com.shoppingcart.service;
 
import java.util.List;
import java.util.Map;
 
public interface ShoppingCartServer {
 //購物車列表
 public MapObject, Object> shoppingCartList(String userId,Long pageNo,Long pageSize);
 MapString,Object> updateNum(String userId,Long shopId, Long commodityId, Double commodityNum);
 MapString, Object> delCommodity(String userId, ListMapString , Object>> list);
 MapString, Object> addCommodity(String userId, ListMapString , Object>> list);
}
package com.shoppingcart.service.impl;
 
import com.shoppingcart.service.ShoppingCartServer;
import com.shoppingcart.utils.RedisService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
 
@Service
public class ShoppingCartServerImpl implements ShoppingCartServer {
 @Autowired
 private RedisService redisService;
 //購物車鍵名前綴
 public static final String SHOPPING_CART = "shoppingCart:";
 //購物車的元素鍵名前綴
 public static final String SHOP_ID = "shopId";
 
 //添加商品
 @Override
 public MapString, Object> addCommodity(String userId, ListMapString, Object>> list) {
  //記錄:list中有哪些商品在購物車中已經存在。
  ListString> existCommoditys = new ArrayList>();
  //todo 購物車key
  String key = SHOPPING_CART + userId;
  for (int i = 0; i  list.size(); i++) {
   String commodityKey = SHOP_ID + list.get(i).get("shopId") + ":" + list.get(i).get("commodityId");
   //todo 添加商品
   boolean boo = redisService.hsetnx(key, commodityKey, Double.parseDouble(list.get(i).get("commodityNum") + ""));
   if (!boo) {
    existCommoditys.add(commodityKey);
   }
  }
  MapString, Object> m = new HashMapString, Object>() {
   {
    put("existCommoditys", existCommoditys);
    put("existCommoditysMsg", "這些商品在購物車中已經存在,重復數量:"+existCommoditys.size()+"。");
   }
  };
  MapString, Object> map = new HashMapString, Object>();
  map.put("data", m);
  map.put("code", 0);
  return map;
 }
 
 //購物車列表
 @Override
 public MapObject, Object> shoppingCartList(String userId, Long pageNo, Long pageSize) {
  //返回{店鋪ID:商品ID=商品數量}的map。
  MapObject, Object> map = redisService.hmget(SHOPPING_CART + userId);
  return map;
 }
 
 //修改商品數量
 @Override
 public MapString, Object> updateNum(String userId, Long shopId, Long commodityId, Double commodityNum) {
  MapString, Object> map = new HashMapString, Object>();
  //todo 購物車key
  String key = SHOPPING_CART + userId;
  //todo 商品key
  String commodityKey = SHOP_ID + shopId + ":" + commodityId;
  //修改購物車的數量
  boolean boo = redisService.hset(key, commodityKey, commodityNum);
  MapString, Object> m = new HashMapString, Object>() {
   {
    put("key", key);
    put("commodityKey", commodityKey);
    put("commodityNum", commodityNum);
   }
  };
  map.put("data", m);
  map.put("msg", boo == true ? "修改購物車商品數量成功。" : "修改購物車商品數量失敗。");
  map.put("code", boo == true ? 0 : 1);
  return map;
 }
 
 //刪除商品
 @Override
 public MapString, Object> delCommodity(String userId, ListMapString, Object>> list) {
  MapString, Object> map = new HashMapString, Object>();
  String[] commodityIds = new String[list.size()];
  for (int i = 0; i  list.size(); i++) {
   //todo 商品key
   commodityIds[i] = SHOP_ID + list.get(i).get("shopId") + ":" + list.get(i).get("commodityId");
  }
  //todo 購物車key
  String key = SHOPPING_CART + userId;
  //刪除商品的數量
  Long num = redisService.hdel(key, commodityIds);
  map.put("msg", "刪除購物車的商品數量:" + num);
  map.put("code", 0);
  return map;
 }
}

 

工具類

package com.shoppingcart.utils;
 
import java.text.SimpleDateFormat;
import java.util.Date;
 
public class DateUtils {
 // 日期轉字符串,返回指定的格式
 public static String dateToString(Date date, String dateFormat) {
  SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
  return sdf.format(date);
 }
}
package com.shoppingcart.utils;
 
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.connection.RedisZSetCommands;
import org.springframework.data.redis.connection.SortParameters;
import org.springframework.data.redis.core.DefaultTypedTuple;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.ZSetOperations;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.w3c.dom.ranges.Range;
 
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;
 
@Service
public class RedisService {
 
 @Autowired
 private RedisTemplateString, Object> redisTemplate;
 
 // =============================common============================
 
 /**
  * 指定緩存失效時間
  *
  * @param key 鍵
  * @param time 時間(秒)
  * @return
  */
 public boolean expire(String key, long time) {
  try {
   if (time > 0) {
    redisTemplate.expire(key, time, TimeUnit.SECONDS);
   }
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 根據key 獲取過期時間
  *
  * @param key 鍵 不能為null
  * @return 時間(秒) 返回0代表為永久有效
  */
 public long getExpire(String key) {
  return redisTemplate.getExpire(key, TimeUnit.SECONDS);
 }
 
 /**
  * 判斷key是否存在
  *
  * @param key 鍵
  * @return true 存在 false不存在
  */
 public boolean hasKey(String key) {
  try {
   return redisTemplate.hasKey(key);
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 刪除緩存
  *
  * @param key 可以傳一個值 或多個
  */
 @SuppressWarnings("unchecked")
 public void del(String... key) {
  if (key != null  key.length > 0) {
   if (key.length == 1) {
    redisTemplate.delete(key[0]);
   } else {
    ListString> list = new ArrayList>(Arrays.asList(key));
    redisTemplate.delete(list);
   }
  }
 }
 
 /**
  * 刪除緩存
  *
  * @param keys 可以傳一個值 或多個
  */
 @SuppressWarnings("unchecked")
 public void del(Collection keys) {
  if (org.apache.commons.collections4.CollectionUtils.isNotEmpty(keys)) {
   redisTemplate.delete(keys);
  }
 }
 
 // ============================String=============================
 
 /**
  * 普通緩存獲取
  *
  * @param key 鍵
  * @return 值
  */
 public Object get(String key) {
  return key == null ? null : redisTemplate.opsForValue().get(key);
 }
 
 /**
  * 普通緩存放入
  *
  * @param key 鍵
  * @param value 值
  * @return true成功 false失敗
  */
 public boolean set(String key, Object value) {
  try {
   redisTemplate.opsForValue().set(key, value);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 普通緩存放入并設置時間
  *
  * @param key 鍵
  * @param value 值
  * @param time 時間(秒) time要大于0 如果time小于等于0 將設置無限期
  * @return true成功 false 失敗
  */
 public boolean set(String key, Object value, long time) {
  try {
   if (time > 0) {
    redisTemplate.opsForValue().set(key, value, time, TimeUnit.SECONDS);
   } else {
    set(key, value);
   }
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 遞增
  *
  * @param key 鍵
  * @param delta 要增加幾(大于0)
  * @return
  */
 public long incr(String key, long delta) {
  if (delta  0) {
   throw new RuntimeException("遞增因子必須大于0");
  }
  return redisTemplate.opsForValue().increment(key, delta);
 }
 
 /**
  * 遞減
  *
  * @param key 鍵
  * @param delta 要減少幾(小于0)
  * @return
  */
 public long decr(String key, long delta) {
  if (delta  0) {
   throw new RuntimeException("遞減因子必須大于0");
  }
  return redisTemplate.opsForValue().increment(key, -delta);
 }
 
 // ================================Hash=================================
 
 /**
  * HashGet
  *
  * @param key 鍵 不能為null
  * @param item 項 不能為null
  * @return 值
  */
 public Object hget(String key, String item) {
  return redisTemplate.opsForHash().get(key, item);
 }
 
 /**
  * 獲取hashKey對應的所有鍵值
  *
  * @param key 鍵
  * @return 對應的多個鍵值
  */
 public MapObject, Object> hmget(String key) {
  MapObject, Object> entries = redisTemplate.opsForHash().entries(key);
  return entries;
 }
 
 /**
  * HashSet
  *
  * @param key 鍵
  * @param map 對應多個鍵值
  * @return true 成功 false 失敗
  */
 public boolean hmset(String key, MapString, Object> map) {
  try {
   redisTemplate.opsForHash().putAll(key, map);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * HashSet 并設置時間
  *
  * @param key 鍵
  * @param map 對應多個鍵值
  * @param time 時間(秒)
  * @return true成功 false失敗
  */
 public boolean hmset(String key, MapString, Object> map, long time) {
  try {
   redisTemplate.opsForHash().putAll(key, map);
   if (time > 0) {
    expire(key, time);
   }
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 
 /**
  * 向一張hash表中放入數據,如果存在就覆蓋原來的值。
  *
  * @param key 鍵
  * @param item 項
  * @param value 值
  * @return true 成功 false失敗
  */
 public boolean hset(String key, String item, Object value) {
  try {
   redisTemplate.opsForHash().put(key, item, value);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 向一張hash表中放入數據,如果存在就覆蓋原來的值。
  *
  * @param key 鍵
  * @param item 項
  * @param value 值
  * @param time 時間(秒) 注意:如果已存在的hash表有時間,這里將會替換原有的時間
  * @return true 成功 false失敗
  */
 public boolean hset(String key, String item, Object value, long time) {
  try {
   redisTemplate.opsForHash().put(key, item, value);
   if (time > 0) {
    expire(key, time);
   }
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 刪除hash表中的值
  *
  * @param key 鍵 不能為null
  * @param item 項 可以使多個 不能為null
  *    返回被刪除的數量
  */
 public Long hdel(String key, Object... item) {
  return redisTemplate.opsForHash().delete(key, item);
 }
 
 /**
  * 刪除hash表中的值
  *
  * @param key 鍵 不能為null
  * @param items 項 可以使多個 不能為null
  */
 public void hdel(String key, Collection items) {
  redisTemplate.opsForHash().delete(key, items.toArray());
 }
 
 /**
  * 判斷hash表中是否有該項的值
  *
  * @param key 鍵 不能為null
  * @param item 項 不能為null
  * @return true 存在 false不存在
  */
 public boolean hHasKey(String key, String item) {
  return redisTemplate.opsForHash().hasKey(key, item);
 }
 
 /**
  * hash數據類型:給元素一個增量 如果不存在,就會創建一個 并把新增后的值返回
  *
  * @param key 鍵
  * @param item 項
  * @param delta 要增加幾(大于0)
  * @return
  */
 public double hincr(String key, String item, double delta) {
  return redisTemplate.opsForHash().increment(key, item, delta);
 }
 // ============================set=============================
 
 /**
  * 根據key獲取Set中的所有值
  *
  * @param key 鍵
  * @return
  */
 public SetObject> sGet(String key) {
  try {
   return redisTemplate.opsForSet().members(key);
  } catch (Exception e) {
   e.printStackTrace();
   return null;
  }
 }
 
 /**
  * 根據value從一個set中查詢,是否存在
  *
  * @param key 鍵
  * @param value 值
  * @return true 存在 false不存在
  */
 public boolean sHasKey(String key, Object value) {
  try {
   return redisTemplate.opsForSet().isMember(key, value);
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 將數據放入set緩存
  *
  * @param key 鍵
  * @param values 值 可以是多個
  * @return 成功個數
  */
 public long sSet(String key, Object... values) {
  try {
   return redisTemplate.opsForSet().add(key, values);
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 /**
  * 將數據放入set緩存
  *
  * @param key 鍵
  * @param values 值 可以是多個
  * @return 成功個數
  */
 public long sSet(String key, Collection values) {
  try {
   return redisTemplate.opsForSet().add(key, values.toArray());
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 /**
  * 將set數據放入緩存
  *
  * @param key 鍵
  * @param time 時間(秒)
  * @param values 值 可以是多個
  * @return 成功個數
  */
 public long sSetAndTime(String key, long time, Object... values) {
  try {
   Long count = redisTemplate.opsForSet().add(key, values);
   if (time > 0)
    expire(key, time);
   return count;
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 /**
  * 獲取set緩存的長度
  *
  * @param key 鍵
  * @return
  */
 public long sGetSetSize(String key) {
  try {
   return redisTemplate.opsForSet().size(key);
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 /**
  * 移除值為value的
  *
  * @param key 鍵
  * @param values 值 可以是多個
  * @return 移除的個數
  */
 public long setRemove(String key, Object... values) {
  try {
   Long count = redisTemplate.opsForSet().remove(key, values);
   return count;
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 // ===============================list=================================
 
 /**
  * 獲取list緩存的內容
  *
  * @param key 鍵
  * @param start 開始
  * @param end 結束 0 到 -1代表所有值
  * @return
  */
 public ListObject> lGet(String key, long start, long end) {
  try {
   return redisTemplate.opsForList().range(key, start, end);
  } catch (Exception e) {
   e.printStackTrace();
   return null;
  }
 }
 
 /**
  * 獲取list緩存的長度
  *
  * @param key 鍵
  * @return
  */
 public long lGetListSize(String key) {
  try {
   return redisTemplate.opsForList().size(key);
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 
 /**
  * 通過索引 獲取list中的值
  *
  * @param key 鍵
  * @param index 索引 index>=0時, 0 表頭,1 第二個元素,依次類推;index0時,-1,表尾,-2倒數第二個元素,依次類推
  * @return
  */
 public Object lGetIndex(String key, long index) {
  try {
   return redisTemplate.opsForList().index(key, index);
  } catch (Exception e) {
   e.printStackTrace();
   return null;
  }
 }
 
 /**
  * 將list放入緩存
  *
  * @param key 鍵
  * @param value 值
  * @return
  */
 public boolean lSet(String key, Object value) {
  try {
   redisTemplate.opsForList().rightPush(key, value);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 將list放入緩存
  *
  * @param key 鍵
  * @param value 值
  * @param time 時間(秒)
  * @return
  */
 public boolean lSet(String key, Object value, long time) {
  try {
   redisTemplate.opsForList().rightPush(key, value);
   if (time > 0)
    expire(key, time);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 將list放入緩存
  *
  * @param key 鍵
  * @param value 值
  * @return
  */
 public boolean lSet(String key, ListObject> value) {
  try {
   redisTemplate.opsForList().rightPushAll(key, value);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 將list放入緩存
  *
  * @param key 鍵
  * @param value 值
  * @param time 時間(秒)
  * @return
  */
 public boolean lSet(String key, ListObject> value, long time) {
  try {
   redisTemplate.opsForList().rightPushAll(key, value);
   if (time > 0)
    expire(key, time);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 根據索引修改list中的某條數據
  *
  * @param key 鍵
  * @param index 索引
  * @param value 值
  * @return
  */
 public boolean lUpdateIndex(String key, long index, Object value) {
  try {
   redisTemplate.opsForList().set(key, index, value);
   return true;
  } catch (Exception e) {
   e.printStackTrace();
   return false;
  }
 }
 
 /**
  * 移除N個值為value
  *
  * @param key 鍵
  * @param count 移除多少個
  * @param value 值
  * @return 移除的個數
  */
 public long lRemove(String key, long count, Object value) {
  try {
   Long remove = redisTemplate.opsForList().remove(key, count, value);
   return remove;
  } catch (Exception e) {
   e.printStackTrace();
   return 0;
  }
 }
 // ===============================Zset=================================
 
 /**
  * 給key鍵的value增加value分數,沒有則會創建。
  *
  * @param key 鍵
  * @param value 值
  * @param score 分數
  */
 public Double incrementScore(String key, String value, double score) {
  //Boolean add = redisTemplate.boundZSetOps(key).add(value, score);
  Double add = redisTemplate.boundZSetOps(key).incrementScore(value, score);
  return add;
 }
 
 /**
  * 獲得指定Zset元素的分數
  *
  * @param key
  * @param value
  * @return
  */
 public Double score(String key, String value) {
  Double score = redisTemplate.boundZSetOps(key).score(value);
  return score;
 }
 
 /**
  * 升序查詢key集合內[endTop,startTop]如果是負數表示倒數
  * endTop=-1,startTop=0表示獲取所有數據。
  *
  * @param key
  * @param startPage
  * @param endPage
  */
 public SetZSetOperations.TypedTupleObject>> rangeWithScores(String key, int startPage, int endPage) {
  SetZSetOperations.TypedTupleObject>> set = redisTemplate.boundZSetOps(key).rangeWithScores(startPage, endPage);
  return set;
 }
 
 /**
  * 降序查詢key集合內[endTop,startTop],如果是負數表示倒數
  * endTop=-1,startTop=0表示獲取所有數據。
  *
  * @param key
  * @param startPage
  * @param endPage
  */
 public SetZSetOperations.TypedTupleObject>> reverseRangeWithScores(String key, int startPage, int endPage) {
  SetZSetOperations.TypedTupleObject>> set = redisTemplate.boundZSetOps(key).reverseRangeWithScores(startPage, endPage);
  return set;
 }
 
 /**
  * 批量新增數據
  *
  * @param key
  * @param set
  * @return
  */
 public Long zsetAdd(String key, Set set) {
  Long add = redisTemplate.boundZSetOps(key).add(set);
  return add;
 }
 
 /**
  * 刪除指定鍵的指定下標范圍數據
  *
  * @param key
  * @param startPage
  * @param endPage
  */
 public Long zsetRemoveRange(String key, int startPage, int endPage) {
  Long l = redisTemplate.boundZSetOps(key).removeRange(startPage, endPage);
  return l;
 }
 /**
  * 刪除指定鍵的指定值
  *
  * @param key
  * @param value
  */
 public Long zsetRemove(String key, String value) {
  Long remove = redisTemplate.boundZSetOps(key).remove(value);
  return remove;
 }
}

到此這篇關于Redis實戰之商城購物車功能的實現代碼的文章就介紹到這了,更多相關Redis商城購物車內容請搜索腳本之家以前的文章或繼續瀏覽下面的相關文章希望大家以后多多支持腳本之家!

您可能感興趣的文章:
  • java redis 實現簡單的用戶簽到功能
  • 使用redis的increment()方法實現計數器功能案例
  • Java使用Redis實現秒殺功能
  • 多個SpringBoot項目采用redis實現Session共享功能
  • 使用Redis實現微信步數排行榜功能
  • 基于Redis實現抽獎功能及問題小結

標簽:北京 江蘇 吉安 楊凌 果洛 臺州 大慶 朝陽

巨人網絡通訊聲明:本文標題《Redis實戰之商城購物車功能的實現代碼》,本文關鍵詞  Redis,實戰,之,商城,購物車,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《Redis實戰之商城購物車功能的實現代碼》相關的同類信息!
  • 本頁收集關于Redis實戰之商城購物車功能的實現代碼的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 彭丹《邪杀》在线播放| 欧美黄色性生活片| 亚洲国产成人久久一区久久| 欧美肥婆做爰XXXⅩ性| 国产在线拍偷自揄拍精品| 国产区91| 日韩免费一区二区| 日本乱熟BBBBBBBBB| 国产精品久久久久久一级毛片军妓| 日本高清不卡二区| 国产精品久久九九| 久久综合精品国产二区无码不卡| 高跟91????白丝| 美女黄频视频a美女大全| 欧美日韩一本大道香蕉欧美| 国产精品美女免费视频大全| 色欲XXOO久久久精产国品| 日本无遮挡h肉动漫地址| 插插哦哦| 色爱aⅴ久久欧美丝袜综合竹菊| 少妇边喂奶边被躁BD| 漂亮护士穿白丝袜让我爽| 香蕉视频app下载| 欧美激情精品久久久久久大尺度 | 97夜夜操| 成人免费淫片在线费观看| 仓本c仔国内精品ol女职员| 村长撕开乳罩吸奶头在线观看| 农村诱奷箩莉合集一区二区| 老大太grαnnychinesebbw| 福利网站在线播放| 厨房挺进美妇市长雪臀| 秘书婬荡呻吟揉捏丰满奶头电影 | 国产精品秘?久久久精品| 缅甸黄色片| 成人区色情综合小说| 色88久久高潮综合合影院| 国产三级电影免费看| 美女调教踩踏vk| 隔壁的老师呻吟声| 欧美另类丰满熟妇乱XXXXX|