mirror of
https://gitee.com/dromara/dax-pay
synced 2026-08-10 06:46:04 +08:00
fix(cache): 移除反序列化丢失类型的实体缓存注解
This commit is contained in:
@@ -14,7 +14,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
@@ -67,11 +66,6 @@ public class ChannelMerchantManager extends BaseManager<ChannelMerchantMapper, C
|
||||
}
|
||||
|
||||
/// 根据通道商户号查询唯一通道商户(通道商户号为系统生成号, 全局唯一, 不存在返回 empty)
|
||||
///
|
||||
/// 缓存说明: 运行时路由高频调用, 配置态低频修改。写侧通过 @CacheEvict 失效。
|
||||
/// @Cacheable 不缓存 null(由 RedisCacheConfiguration.disableCachingNullValues 保证),
|
||||
/// 但 Optional.empty() 非 null 可正常缓存。
|
||||
@Cacheable(value = "payment:channel-mch", key = "#channelMchNo")
|
||||
public Optional<ChannelMerchant> findByChannelMchNo(String channelMchNo){
|
||||
return this.lambdaQuery()
|
||||
.eq(ChannelMerchant::getChannelMchNo, channelMchNo)
|
||||
|
||||
@@ -41,7 +41,6 @@ import cn.daxpay.open.payment.trade.order.entity.PayTrade;
|
||||
import cn.daxpay.open.payment.trade.order.entity.RefundOrder;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -106,7 +105,6 @@ public class ChannelMerchantService {
|
||||
}
|
||||
|
||||
/// 编辑
|
||||
@CacheEvict(value = "payment:channel-mch", allEntries = true)
|
||||
public void update(ChannelMerchantEditParam param){
|
||||
// 通道: 通道商户不存在
|
||||
var mchInfo = channelMerchantManager.findById(param.getId()).orElseThrow(() -> new DataNotExistException("error.payment.channel.channelMerchantNotExist"));
|
||||
@@ -127,7 +125,6 @@ public class ChannelMerchantService {
|
||||
/// - 通道扩展表(`XxxChannelMerchant` + `XxxKeyConfig`)由各通道子模块通过 SPI 自清理,
|
||||
/// 未实现 SPI 的通道留孤儿数据(主表已删、路由不再命中,对业务无影响)
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@CacheEvict(value = "payment:channel-mch", allEntries = true)
|
||||
public void delete(Long id){
|
||||
// 通道: 通道商户不存在
|
||||
var mchInfo = channelMerchantManager.findById(id)
|
||||
@@ -213,7 +210,6 @@ public class ChannelMerchantService {
|
||||
}
|
||||
|
||||
/// 更新启用状态
|
||||
@CacheEvict(value = "payment:channel-mch", allEntries = true)
|
||||
public void updateEnable(Long id, Boolean enable){
|
||||
// 通道: 通道商户不存在
|
||||
var mchInfo = channelMerchantManager.findById(id).orElseThrow(() -> new DataNotExistException("error.payment.channel.channelMerchantNotExist"));
|
||||
|
||||
@@ -15,8 +15,6 @@ import cn.daxpay.open.platform.core.rest.param.PageParam;
|
||||
import cn.daxpay.open.platform.core.rest.result.PageResult;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
@@ -92,7 +90,6 @@ public class DictItemService {
|
||||
/// 查询指定字典编码下所有启用的字典项完整列表(含多语言字段)
|
||||
/// 供 DictTranslatorImpl 使用
|
||||
/// @return 字典项完整实体列表
|
||||
@Cacheable(value = "system:dict", key = "#dictCode + ':list'")
|
||||
public List<DictItem> findAllEnableByDictCode(String dictCode) {
|
||||
return dictItemManager.findByDictCodeAndEnable(dictCode, true);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user