购物车缓存
parent
49b3695835
commit
3288308225
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
import com.muyu.common.cache.decoration.DecorationKey;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 原子序列缓存基准
|
||||
* @Date 2024-4-1 下午 08:07
|
||||
*/
|
||||
public interface AtomicSequenceCache<K> extends DecorationKey<K> {
|
||||
|
||||
/**
|
||||
* 获取存储的值
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
public Long get(K key);
|
||||
|
||||
/**
|
||||
* 自增
|
||||
*/
|
||||
public Long increment(K key);
|
||||
/**
|
||||
* 自减
|
||||
*/
|
||||
public Long decrement(K key);
|
||||
|
||||
/**
|
||||
* 增加数值
|
||||
*/
|
||||
public Long increment(K key, Long number);
|
||||
|
||||
/**
|
||||
* 减少数值
|
||||
*/
|
||||
public Long decrement(K key, Long number);
|
||||
}
|
|
@ -1,27 +1,13 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
public interface Cache <K, V> {
|
||||
import com.muyu.common.cache.decoration.DecorationKey;
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
public String keyPre();
|
||||
|
||||
|
||||
/**
|
||||
* 编码
|
||||
* @param key ID
|
||||
* @return 键
|
||||
*/
|
||||
public String encode(K key);
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
public K decode(String redisKey);
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 缓存接口基类
|
||||
* @Date 2024-3-26 下午 03:25
|
||||
*/
|
||||
public interface Cache <K, V> extends DecorationKey<K> {
|
||||
|
||||
/**
|
||||
* 通过Key获取value值
|
||||
|
|
|
@ -0,0 +1,97 @@
|
|||
package com.muyu.common.cache;
|
||||
|
||||
import com.muyu.common.cache.decoration.DecorationKey;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: Hash缓存基准
|
||||
* @Date 2024-3-29 下午 03:16
|
||||
*/
|
||||
public interface HashCache <K, HK, HV> extends DecorationKey<K> {
|
||||
|
||||
|
||||
/**
|
||||
* 编码
|
||||
* @param hashKey ID
|
||||
* @return 键
|
||||
*/
|
||||
public String encodeHashKey(HK hashKey);
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisHashKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
public HK decodeHashKey(String redisHashKey);
|
||||
|
||||
/**
|
||||
* 通过Key获取所有的map
|
||||
* @param key 数据库键
|
||||
* @return 所有集合Map
|
||||
*/
|
||||
public Map<HK, HV> get(K key);
|
||||
|
||||
/**
|
||||
* 通过键和hashKey获取数据库hashValue
|
||||
* @param key 键
|
||||
* @param hashKey hash键
|
||||
* @return hash值
|
||||
*/
|
||||
public HV get(K key, HK hashKey);
|
||||
|
||||
/**
|
||||
* 通过键和hashKey获取数据库hashValue
|
||||
* @param key 键
|
||||
* @param hashKeyList hash键集合
|
||||
* @return hash值
|
||||
*/
|
||||
public List<HV> get(K key, HK... hashKeyList);
|
||||
|
||||
/**
|
||||
* 获取hash值集合
|
||||
* @param key 键
|
||||
* @return hash值集合
|
||||
*/
|
||||
public List<HV> getToList(K key);
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
* @param key redis键
|
||||
* @param map hashMap集合
|
||||
*/
|
||||
public void put(K key, Map<HK, HV> map);
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
* @param key redis键
|
||||
* @param dataList 数据值
|
||||
* @param hashKey hash键
|
||||
*/
|
||||
public void put(K key, List<HV> dataList, Function<HV, HK> hashKey);
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
* @param key redis键
|
||||
* @param hashKey hash键
|
||||
* @param hashValue hash值
|
||||
*/
|
||||
public void put(K key, HK hashKey, HV hashValue);
|
||||
|
||||
/**
|
||||
* 通过redis键删除
|
||||
* @param key hash键
|
||||
*/
|
||||
public void remove(K key);
|
||||
|
||||
/**
|
||||
* 通过redis键和hash键删除
|
||||
* @param key redis键
|
||||
* @param hashKey hash键
|
||||
*/
|
||||
public void remove(K key, HK hashKey);
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.muyu.common.cache.abs;
|
||||
|
||||
import com.muyu.common.cache.AtomicSequenceCache;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 原子序列缓存抽象类
|
||||
* @Date 2024-4-1 下午 08:33
|
||||
*/
|
||||
public abstract class AtomicSequenceCacheAbs<K> implements AtomicSequenceCache<K> {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 获取存储的值
|
||||
* @param key 键
|
||||
* @return 值
|
||||
*/
|
||||
@Override
|
||||
public Long get (K key) {
|
||||
return this.redisService.getCacheObject(encode(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 自增
|
||||
* @param key
|
||||
*/
|
||||
@Override
|
||||
public Long increment (K key) {
|
||||
return this.increment(key, 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 自减
|
||||
*
|
||||
* @param key
|
||||
*/
|
||||
@Override
|
||||
public Long decrement (K key) {
|
||||
return this.decrement(key, 1L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 增加数值
|
||||
*
|
||||
* @param key
|
||||
* @param number
|
||||
*/
|
||||
@Override
|
||||
public Long increment (K key, Long number) {
|
||||
Long numberValue = redisService.getCacheObject(encode(key));
|
||||
if (numberValue == null){
|
||||
Long data = getData(key);
|
||||
data = data == null ? 0L : data;
|
||||
redisService.setCacheObject(encode(key), data);
|
||||
}
|
||||
return redisService.increment(encode(key), number);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减少数值
|
||||
*
|
||||
* @param key
|
||||
* @param number
|
||||
*/
|
||||
@Override
|
||||
public Long decrement (K key, Long number) {
|
||||
Long numberValue = redisService.getCacheObject(encode(key));
|
||||
if (numberValue == null){
|
||||
Long data = getData(key);
|
||||
data = data == null ? 0L : data;
|
||||
redisService.setCacheObject(encode(key), data);
|
||||
}
|
||||
return redisService.decrement(encode(key), number);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*
|
||||
* @param key ID
|
||||
*
|
||||
* @return 键
|
||||
*/
|
||||
@Override
|
||||
public String encode (K key) {
|
||||
return keyPre() + key;
|
||||
}
|
||||
|
||||
public abstract Long getData(K key);
|
||||
}
|
|
@ -6,6 +6,11 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 缓存抽象类
|
||||
* @Date 2024-3-27 下午 03:10
|
||||
*/
|
||||
public abstract class CacheAbs<K, V> implements Cache<K, V> {
|
||||
|
||||
@Autowired
|
||||
|
|
|
@ -0,0 +1,212 @@
|
|||
package com.muyu.common.cache.abs;
|
||||
|
||||
import com.muyu.common.cache.HashCache;
|
||||
import com.muyu.common.redis.service.RedisService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: hash缓存抽象类
|
||||
* @Date 2024-3-29 下午 07:40
|
||||
*/
|
||||
public abstract class HashCacheAbs<K, HK, HV> implements HashCache<K, HK, HV> {
|
||||
|
||||
@Autowired
|
||||
private RedisService redisService;
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*
|
||||
* @param key ID
|
||||
*
|
||||
* @return 键
|
||||
*/
|
||||
@Override
|
||||
public String encode (K key) {
|
||||
return keyPre() + key;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码
|
||||
* @param hashKey ID
|
||||
* @return 键
|
||||
*/
|
||||
@Override
|
||||
public String encodeHashKey (HK hashKey) {
|
||||
return hashKey.toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过Key获取所有的map
|
||||
* @param key 数据库键
|
||||
* @return 所有集合Map
|
||||
*/
|
||||
@Override
|
||||
public Map<HK, HV> get (K key) {
|
||||
// 获取为null的情况
|
||||
Map<String, HV> cacheMap = redisService.getCacheMap(encode(key));
|
||||
if (cacheMap == null || cacheMap.isEmpty()){
|
||||
Map<HK, HV> dataMap = getData(key);
|
||||
if (dataMap != null && !dataMap.isEmpty()){
|
||||
cacheMap = encodeMap(dataMap);
|
||||
}else {
|
||||
cacheMap = encodeMap(defaultValue());
|
||||
}
|
||||
redisService.setCacheMap(encode(key), cacheMap);
|
||||
}
|
||||
return decodeMap(cacheMap);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过键和hashKey获取数据库hashValue
|
||||
*
|
||||
* @param key 键
|
||||
* @param hashKey hash键
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
@Override
|
||||
public HV get (K key, HK hashKey) {
|
||||
HV hashValue = redisService.getCacheMapValue(encode(key), encodeHashKey(hashKey));
|
||||
if (hashValue == null){
|
||||
HV dataValue = getData(key, hashKey);
|
||||
hashValue = dataValue != null ? dataValue : defaultHashValue();
|
||||
put(key, hashKey, hashValue);
|
||||
}
|
||||
return hashValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过键和hashKey获取数据库hashValue
|
||||
*
|
||||
* @param key 键
|
||||
* @param hashKeyList hash键集合
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
@Override
|
||||
public List<HV> get (K key, HK... hashKeyList) {
|
||||
List<String> encodeHashKeyList = Arrays.stream(hashKeyList).map(this::encodeHashKey).toList();
|
||||
return redisService.getMultiCacheMapValue(encode(key), encodeHashKeyList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取hash值集合
|
||||
*
|
||||
* @param key 键
|
||||
*
|
||||
* @return hash值集合
|
||||
*/
|
||||
@Override
|
||||
public List<HV> getToList (K key) {
|
||||
Map<HK, HV> hkhvMap = get(key);
|
||||
return hkhvMap.values().stream().toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
*
|
||||
* @param key redis键
|
||||
* @param map hashMap集合
|
||||
*/
|
||||
@Override
|
||||
public void put (K key, Map<HK, HV> map) {
|
||||
redisService.setCacheMap(encode(key), encodeMap(map));
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
*
|
||||
* @param key redis键
|
||||
* @param dataList 数据值
|
||||
* @param hashKey hash键
|
||||
*/
|
||||
@Override
|
||||
public void put (K key, List<HV> dataList, Function<HV, HK> hashKey) {
|
||||
Map<HK, HV> dataMap = new HashMap<>();
|
||||
dataList.forEach((data) -> dataMap.put(hashKey.apply(data), data));
|
||||
redisService.setCacheMap(encode(key), encodeMap(dataMap));
|
||||
}
|
||||
|
||||
/**
|
||||
* 存储数据
|
||||
*
|
||||
* @param key redis键
|
||||
* @param hashKey hash键
|
||||
* @param hashValue hash值
|
||||
*/
|
||||
@Override
|
||||
public void put (K key, HK hashKey, HV hashValue) {
|
||||
redisService.setCacheMapValue(encode(key), encodeHashKey(hashKey), hashValue);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过redis键删除
|
||||
*
|
||||
* @param key hash键
|
||||
*/
|
||||
@Override
|
||||
public void remove (K key) {
|
||||
redisService.deleteObject(encode(key));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过redis键和hash键删除
|
||||
*
|
||||
* @param key redis键
|
||||
* @param hashKey hash键
|
||||
*/
|
||||
@Override
|
||||
public void remove (K key, HK hashKey) {
|
||||
redisService.deleteCacheMapValue(encode(key), encodeHashKey(hashKey));
|
||||
}
|
||||
|
||||
/**
|
||||
* 原始数据转编码数据
|
||||
* @param dataMap 原始数据
|
||||
* @return 编码数据
|
||||
*/
|
||||
private Map<String, HV> encodeMap(Map<HK, HV> dataMap){
|
||||
Map<String, HV> encodeDataMap = new HashMap<>();
|
||||
dataMap.forEach((hashKey, HashValue) -> encodeDataMap.put(encodeHashKey(hashKey), HashValue));
|
||||
return encodeDataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码数据转原始数据
|
||||
* @param encodeDataMap 编码数据
|
||||
* @return 原始数据
|
||||
*/
|
||||
private Map<HK, HV> decodeMap(Map<String, HV> encodeDataMap){
|
||||
Map<HK, HV> dataMap = new HashMap<>();
|
||||
encodeDataMap.forEach((hashKey, hashValue) -> dataMap.put(decodeHashKey(hashKey), hashValue));
|
||||
return dataMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param key 键
|
||||
* @return
|
||||
*/
|
||||
public abstract Map<HK, HV> getData(K key);
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
* @param key 缓存键
|
||||
* @param hashKey hash键
|
||||
* @return hash值
|
||||
*/
|
||||
public abstract HV getData(K key, HK hashKey);
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
public abstract Map<HK, HV> defaultValue();
|
||||
public abstract HV defaultHashValue();
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.common.cache.decoration;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 装饰Key
|
||||
* @Date 2024-3-29 下午 03:19
|
||||
*/
|
||||
public interface DecorationKey <K>{
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
public String keyPre();
|
||||
|
||||
|
||||
/**
|
||||
* 编码
|
||||
* @param key ID
|
||||
* @return 键
|
||||
*/
|
||||
public String encode(K key);
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
public K decode(String redisKey);
|
||||
}
|
|
@ -229,7 +229,7 @@ public class RedisService {
|
|||
*
|
||||
* @return Hash对象集合
|
||||
*/
|
||||
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<Object> hKeys) {
|
||||
public <T> List<T> getMultiCacheMapValue (final String key, final Collection<?> hKeys) {
|
||||
return redisTemplate.opsForHash().multiGet(key, hKeys);
|
||||
}
|
||||
|
||||
|
@ -255,4 +255,23 @@ public class RedisService {
|
|||
public Collection<String> keys (final String pattern) {
|
||||
return redisTemplate.keys(pattern);
|
||||
}
|
||||
|
||||
/**
|
||||
* 减少序列值
|
||||
* @param key key
|
||||
* @param number 值
|
||||
* @return 操作后的值
|
||||
*/
|
||||
public Long decrement (final String key, Long number) {
|
||||
return redisTemplate.opsForValue().decrement(key,number);
|
||||
}
|
||||
/**
|
||||
* 增加序列值
|
||||
* @param key key
|
||||
* @param number 值
|
||||
* @return 操作后的值
|
||||
*/
|
||||
public Long increment (final String key, Long number) {
|
||||
return redisTemplate.opsForValue().increment(key,number);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,36 +1,40 @@
|
|||
package com.muyu.product.cache;
|
||||
|
||||
import com.muyu.common.cache.HashCache;
|
||||
import com.muyu.common.cache.abs.CacheAbs;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.product.cache.datasource.ProjectInfoData;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品缓存
|
||||
* @Date 2024-3-27 下午 03:30
|
||||
*/
|
||||
@Component
|
||||
public class ProjectInfoCache extends CacheAbs<Long, ProjectInfo> {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Long projectId = 10L;
|
||||
HashCache<Long, Long, ProjectSkuInfo> hashCache = null;
|
||||
ArrayList<ProjectSkuInfo> projectSkuInfoList = new ArrayList<>(){{
|
||||
add(new ProjectSkuInfo());
|
||||
add(new ProjectSkuInfo());
|
||||
}};
|
||||
hashCache.put(projectId, projectSkuInfoList, ProjectSkuInfo::getProjectId);
|
||||
Long[] longArr = {10L, 11L, 12L, 13L, 14L, 15L};
|
||||
hashCache.get(projectId, longArr);
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ProjectInfoData projectInfoData;
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
@Override
|
||||
public String keyPre () {
|
||||
return "project:info:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public Long decode(String redisKey){
|
||||
return Convert.toLong(redisKey.replace(keyPre(),""),0L);
|
||||
}
|
||||
|
||||
/**
|
||||
* 从数据库获取数据
|
||||
* @param key ID
|
||||
|
@ -48,4 +52,24 @@ public class ProjectInfoCache extends CacheAbs<Long, ProjectInfo> {
|
|||
public ProjectInfo defaultValue() {
|
||||
return new ProjectInfo();
|
||||
}
|
||||
|
||||
/**
|
||||
* keye前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
@Override
|
||||
public String keyPre() {
|
||||
return "project:info:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public Long decode(String redisKey) {
|
||||
return Convert.toLong(redisKey.replace(keyPre(),""),0L);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
package com.muyu.product.cache;
|
||||
|
||||
import com.muyu.common.cache.abs.HashCacheAbs;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.product.cache.datasource.ProjectSkuData;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品sku基本信息
|
||||
* @Date 2024-3-29 下午 03:06
|
||||
*/
|
||||
@Component
|
||||
public class ProjectSkuCache extends HashCacheAbs<Long, String, ProjectSkuInfo> {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuData projectSkuData;
|
||||
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
@Override
|
||||
public String keyPre () {
|
||||
return "project:sku:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public Long decode (String redisKey) {
|
||||
return Convert.toLong(redisKey.replace(keyPre(), ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisHashKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public String decodeHashKey (String redisHashKey) {
|
||||
return redisHashKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param key 键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, ProjectSkuInfo> getData (Long key) {
|
||||
return projectSkuData.getData(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
* @param key 缓存键
|
||||
* @param hashKey hash键
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
@Override
|
||||
public ProjectSkuInfo getData (Long key, String hashKey) {
|
||||
return projectSkuData.getData(key, hashKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@Override
|
||||
public Map<String, ProjectSkuInfo> defaultValue () {
|
||||
return new HashMap<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProjectSkuInfo defaultHashValue () {
|
||||
return new ProjectSkuInfo();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.product.cache;
|
||||
|
||||
import com.muyu.common.cache.abs.AtomicSequenceCacheAbs;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.product.cache.datasource.ProjectSkuStockData;
|
||||
import com.muyu.product.cache.key.SkuStockKey;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品SKU库存缓存
|
||||
* @Date 2024-3-29 下午 03:06
|
||||
*/
|
||||
@Service
|
||||
public class ProjectSkuStockCache extends AtomicSequenceCacheAbs<SkuStockKey> {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuStockData projectSkuStockData;
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
*
|
||||
* @return key前缀
|
||||
*/
|
||||
@Override
|
||||
public String keyPre () {
|
||||
return "project:sku:stock:";
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编码
|
||||
* @param skuStockKey ID
|
||||
* @return 键
|
||||
*/
|
||||
@Override
|
||||
public String encode (SkuStockKey skuStockKey) {
|
||||
return keyPre() + skuStockKey.getProjectId() + ":" + skuStockKey.getSku();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long getData (SkuStockKey key) {
|
||||
return projectSkuStockData.getData(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public SkuStockKey decode (String redisKey) {
|
||||
String[] split = redisKey.replace(keyPre(), "").split(":");
|
||||
return SkuStockKey.builder()
|
||||
.projectId(Convert.toLong(split[0]))
|
||||
.sku(split[1])
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,7 +1,12 @@
|
|||
package com.muyu.product.cache;
|
||||
package com.muyu.product.cache.datasource;
|
||||
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 缓存数据获取
|
||||
* @Date 2024-3-27 下午 03:34
|
||||
*/
|
||||
public interface ProjectInfoData {
|
||||
|
||||
/**
|
||||
|
@ -10,5 +15,4 @@ public interface ProjectInfoData {
|
|||
* @return 缓存对象
|
||||
*/
|
||||
public ProjectInfo getData (Long key);
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.product.cache.datasource;
|
||||
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品SKU数据库读取
|
||||
* @Date 2024-4-1 上午 11:35
|
||||
*/
|
||||
public interface ProjectSkuData {
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param projectId 商品ID
|
||||
* @return
|
||||
*/
|
||||
public Map<String, ProjectSkuInfo> getData (Long projectId) ;
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
* @param projectId 商品ID
|
||||
* @param projectSku 商品SKU
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
public ProjectSkuInfo getData (Long projectId, String projectSku);
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.muyu.product.cache.datasource;
|
||||
|
||||
import com.muyu.product.cache.key.SkuStockKey;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: SKU库存
|
||||
* @Date 2024-4-2 上午 10:52
|
||||
*/
|
||||
public interface ProjectSkuStockData {
|
||||
|
||||
public Long getData (SkuStockKey key) ;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.product.cache.key;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品SKU库存Key
|
||||
* @Date 2024-4-2 上午 10:41
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SkuStockKey {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* sku
|
||||
*/
|
||||
private String sku;
|
||||
}
|
|
@ -1,11 +1,16 @@
|
|||
package com.muyu.product.cache.impl;
|
||||
|
||||
import com.muyu.product.cache.ProjectInfoData;
|
||||
import com.muyu.product.cache.datasource.ProjectInfoData;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.service.ProjectInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 缓存数据获取
|
||||
* @Date 2024-3-27 下午 03:37
|
||||
*/
|
||||
@Service
|
||||
public class ProjectInfoDataImpl implements ProjectInfoData {
|
||||
|
||||
|
@ -18,8 +23,7 @@ public class ProjectInfoDataImpl implements ProjectInfoData {
|
|||
* @return 缓存对象
|
||||
*/
|
||||
@Override
|
||||
public ProjectInfo getData(Long key) {
|
||||
public ProjectInfo getData (Long key) {
|
||||
return projectInfoService.getById(key);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,52 @@
|
|||
package com.muyu.product.cache.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.product.cache.datasource.ProjectSkuData;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import com.muyu.product.service.ProjectSkuInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 商品SKU实现类
|
||||
* @Date 2024-4-1 上午 11:38
|
||||
*/
|
||||
@Service
|
||||
public class ProjectSkuDataImpl implements ProjectSkuData {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuInfoService projectSkuInfoService;
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param projectId 商品ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, ProjectSkuInfo> getData (Long projectId) {
|
||||
LambdaQueryWrapper<ProjectSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProjectSkuInfo::getProjectId, projectId);
|
||||
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(queryWrapper);
|
||||
return projectSkuInfoList.stream()
|
||||
.collect(Collectors.toMap(ProjectSkuInfo::getSku, projectSkuInfo -> projectSkuInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
* @param projectId 商品ID
|
||||
* @param projectSku 商品SKU
|
||||
* @return hash值
|
||||
*/
|
||||
@Override
|
||||
public ProjectSkuInfo getData (Long projectId, String projectSku) {
|
||||
LambdaQueryWrapper<ProjectSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProjectSkuInfo::getProjectId, projectId);
|
||||
queryWrapper.eq(ProjectSkuInfo::getSku, projectSku);
|
||||
return projectSkuInfoService.getOne(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
package com.muyu.product.cache.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.muyu.product.cache.datasource.ProjectSkuStockData;
|
||||
import com.muyu.product.cache.key.SkuStockKey;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import com.muyu.product.service.ProjectSkuInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: sku库存实现类
|
||||
* @Date 2024-4-2 上午 10:53
|
||||
*/
|
||||
@Service
|
||||
public class ProjectSkuStockDataImpl implements ProjectSkuStockData {
|
||||
|
||||
@Autowired
|
||||
private ProjectSkuInfoService projectSkuInfoService;
|
||||
|
||||
@Override
|
||||
public Long getData (SkuStockKey key) {
|
||||
LambdaQueryWrapper<ProjectSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(ProjectSkuInfo::getProjectId, key.getProjectId());
|
||||
queryWrapper.eq(ProjectSkuInfo::getSku, key.getSku());
|
||||
ProjectSkuInfo projectSkuInfo = projectSkuInfoService.getOne(queryWrapper);
|
||||
return projectSkuInfo.getStock();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.muyu.shop.cart.cache;
|
||||
|
||||
import com.muyu.common.cache.abs.HashCacheAbs;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.shop.cart.cache.key.CartHashKey;
|
||||
import com.muyu.shop.cart.cache.sourcedata.CartData;
|
||||
import com.muyu.shop.cart.domain.CartInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 购物车缓存
|
||||
* @Date 2024-4-2 上午 11:23
|
||||
*/
|
||||
@Component
|
||||
public class CartCache extends HashCacheAbs<Long, CartHashKey, CartInfo> {
|
||||
|
||||
@Autowired
|
||||
private CartData cartData;
|
||||
|
||||
/**
|
||||
* key前缀
|
||||
* @return key前缀
|
||||
*/
|
||||
@Override
|
||||
public String keyPre () {
|
||||
return "cart:info:";
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public Long decode (String redisKey) {
|
||||
return Convert.toLong(redisKey.replace(keyPre(), ""));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编码
|
||||
*
|
||||
* @param hashKey ID
|
||||
*
|
||||
* @return 键
|
||||
*/
|
||||
@Override
|
||||
public String encodeHashKey (CartHashKey hashKey) {
|
||||
return hashKey.getProjectId()+":"+hashKey.getProjectSku();
|
||||
}
|
||||
|
||||
/**
|
||||
* 解码
|
||||
* @param redisHashKey 数据库键
|
||||
* @return ID
|
||||
*/
|
||||
@Override
|
||||
public CartHashKey decodeHashKey (String redisHashKey) {
|
||||
String[] split = redisHashKey.split(":");
|
||||
return CartHashKey.builder()
|
||||
.projectId(Convert.toLong(split[0]))
|
||||
.projectSku(split[1])
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param key 键
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<CartHashKey, CartInfo> getData (Long key) {
|
||||
return cartData.getData(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
*
|
||||
* @param key 缓存键
|
||||
* @param hashKey hash键
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
@Override
|
||||
public CartInfo getData (Long key, CartHashKey hashKey) {
|
||||
return cartData.getData(key, hashKey);
|
||||
}
|
||||
|
||||
/**
|
||||
* 默认值
|
||||
*/
|
||||
@Override
|
||||
public Map<CartHashKey, CartInfo> defaultValue () {
|
||||
throw new ServiceException("购物车无数据", Result.SUCCESS);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CartInfo defaultHashValue () {
|
||||
throw new ServiceException("购物车无数据", Result.SUCCESS);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.shop.cart.cache.key;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 购物车HashKey
|
||||
* @Date 2024-4-2 上午 11:25
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class CartHashKey {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
|
||||
/**
|
||||
* 商品SKU
|
||||
*/
|
||||
private String projectSku;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.muyu.shop.cart.cache.sourcedata;
|
||||
|
||||
import com.muyu.shop.cart.cache.key.CartHashKey;
|
||||
import com.muyu.shop.cart.domain.CartInfo;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author DongZl
|
||||
* @description: 购物车源数据获取
|
||||
* @Date 2024-4-2 上午 11:49
|
||||
*/
|
||||
public interface CartData {
|
||||
|
||||
/**
|
||||
* 通过键获取所有的hash数据
|
||||
* @param key 键
|
||||
* @return
|
||||
*/
|
||||
public Map<CartHashKey, CartInfo> getData (Long key);
|
||||
|
||||
/**
|
||||
* 通过缓存键和hash键获取hash值
|
||||
*
|
||||
* @param key 缓存键
|
||||
* @param hashKey hash键
|
||||
*
|
||||
* @return hash值
|
||||
*/
|
||||
public CartInfo getData (Long key, CartHashKey hashKey);
|
||||
}
|
|
@ -86,7 +86,7 @@ public class CartInfo extends BaseEntity {
|
|||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static CartInfo editBuid(Long id, CartInfoEditReq cartInfoEditReq){
|
||||
public static CartInfo editBuild(Long id, CartInfoEditReq cartInfoEditReq){
|
||||
return CartInfo.builder()
|
||||
.id(id)
|
||||
.projectId(cartInfoEditReq.getProjectId())
|
||||
|
|
|
@ -84,7 +84,12 @@
|
|||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-shop-cart-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 购物车模块 缓存 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-shop-cart-cache</artifactId>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
|
|
@ -1,31 +1,41 @@
|
|||
package com.muyu.shop.cart.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.shop.cart.domain.CartInfo;
|
||||
import com.muyu.shop.cart.domain.req.CartInfoEditReq;
|
||||
import com.muyu.shop.cart.domain.req.CartInfoQueryReq;
|
||||
import com.muyu.shop.cart.domain.req.CartInfoSaveReq;
|
||||
import com.muyu.shop.cart.domain.req.CartInfoEditReq;
|
||||
import com.muyu.shop.cart.service.CartInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 购物车Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-03-29
|
||||
*/
|
||||
@Api(tags = "购物车")
|
||||
@RestController
|
||||
@RequestMapping("/Info")
|
||||
public class CartInfoController extends BaseController {
|
||||
|
||||
@Autowired
|
||||
private CartInfoService cartInfoService;
|
||||
|
||||
|
@ -35,7 +45,7 @@ public class CartInfoController extends BaseController {
|
|||
@ApiOperation("获取购物车列表")
|
||||
@RequiresPermissions("shopCart:Info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CartInfo>> list(CartInfoQueryReq cartInfoQueryReq){
|
||||
public Result<TableDataInfo<CartInfo>> list(CartInfoQueryReq cartInfoQueryReq) {
|
||||
startPage();
|
||||
List<CartInfo> list = cartInfoService.list(CartInfo.queryBuild(cartInfoQueryReq));
|
||||
return getDataTable(list);
|
||||
|
@ -46,9 +56,9 @@ public class CartInfoController extends BaseController {
|
|||
*/
|
||||
@ApiOperation("导出购物车列表")
|
||||
@RequiresPermissions("shopCart:Info:export")
|
||||
@Log(title = "购物车",businessType = BusinessType.EXPORT)
|
||||
@Log(title = "购物车", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response,CartInfo cartInfo){
|
||||
public void export(HttpServletResponse response, CartInfo cartInfo) {
|
||||
List<CartInfo> list = cartInfoService.list(cartInfo);
|
||||
ExcelUtil<CartInfo> util = new ExcelUtil<CartInfo>(CartInfo.class);
|
||||
util.exportExcel(response, list, "购物车数据");
|
||||
|
@ -61,7 +71,7 @@ public class CartInfoController extends BaseController {
|
|||
@RequiresPermissions("shopCart:Info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CartInfo> getInfo(@PathVariable("id") Long id){
|
||||
public Result<CartInfo> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(cartInfoService.getById(id));
|
||||
}
|
||||
|
||||
|
@ -69,10 +79,10 @@ public class CartInfoController extends BaseController {
|
|||
* 新增购物车
|
||||
*/
|
||||
@RequiresPermissions("shopCart:Info:add")
|
||||
@Log(title = "购物车",businessType = BusinessType.INSERT)
|
||||
@Log(title = "购物车", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增购物车")
|
||||
public Result<String> add(@RequestBody CartInfoSaveReq cartInfoSaveReq){
|
||||
public Result<String> add(@RequestBody CartInfoSaveReq cartInfoSaveReq) {
|
||||
return toAjax(cartInfoService.save(CartInfo.saveBuild(cartInfoSaveReq)));
|
||||
}
|
||||
|
||||
|
@ -80,22 +90,22 @@ public class CartInfoController extends BaseController {
|
|||
* 修改购物车
|
||||
*/
|
||||
@RequiresPermissions("shopCart:Info:edit")
|
||||
@Log(title = "购物车",businessType = BusinessType.UPDATE)
|
||||
@Log(title = "购物车", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改购物车")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CartInfoEditReq cartInfoEditReq){
|
||||
return toAjax(cartInfoService.updateById(CartInfo.editBuid(id,cartInfoEditReq)));
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CartInfoEditReq cartInfoEditReq) {
|
||||
return toAjax(cartInfoService.updateById(CartInfo.editBuild(id,cartInfoEditReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除购物车
|
||||
*/
|
||||
@RequiresPermissions("shopCart:Info:remove")
|
||||
@Log(title = "购物车",businessType = BusinessType.DELETE)
|
||||
@Log(title = "购物车", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除购物车")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids){
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(cartInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
<module>muyu-shop-cart-common</module>
|
||||
<module>muyu-shop-cart-remote</module>
|
||||
<module>muyu-shop-cart-server</module>
|
||||
<module>muyu-shop-cart-cache</module>
|
||||
</modules>
|
||||
|
||||
<properties>
|
||||
|
|
42
pom.xml
42
pom.xml
|
@ -143,13 +143,6 @@
|
|||
<version>${transmittable-thread-local.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 缓存基准模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 核心模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
@ -157,6 +150,13 @@
|
|||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 缓存基准模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-common-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 接口模块 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
@ -227,6 +227,34 @@
|
|||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 商品模块 缓存 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-product-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 购物车模块 公共依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-shop-cart-common</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 购物车模块 远程客户端 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-shop-cart-remote</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 购物车模块 缓存 依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
<artifactId>muyu-shop-cart-cache</artifactId>
|
||||
<version>${muyu.version}</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
|
Loading…
Reference in New Issue