Просмотр исходного кода

Merge remote-tracking branch 'origin/master'

bing 1 год назад
Родитель
Сommit
e31c843b17

+ 4 - 0
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java

@@ -89,4 +89,8 @@ public interface CacheNames {
      */
     String PT_PARAMETER = "pt_parameter";
 
+    /**
+     * 卡片类别
+     */
+    String PT_CARD_TYPE = "pt_card_type";
 }

+ 3 - 0
ruoyi-modules/ruoyi-backstage/src/main/java/org/dromara/backstage/basics/service/impl/PtCardtypeServiceImpl.java

@@ -3,6 +3,7 @@ package org.dromara.backstage.basics.service.impl;
 import cn.hutool.core.convert.Convert;
 import cn.hutool.core.util.ObjectUtil;
 import org.dromara.backstage.payment.domain.vo.PtUserAccountVo;
+import org.dromara.common.core.constant.CacheNames;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.SpringUtils;
@@ -13,6 +14,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 import org.dromara.backstage.basics.domain.bo.PtCardtypeBo;
 import org.dromara.backstage.basics.domain.vo.PtCardtypeVo;
@@ -43,6 +45,7 @@ public class PtCardtypeServiceImpl implements IPtCardtypeService {
      * @param typeId 主键
      * @return 卡片类别
      */
+    @Cacheable(cacheNames = CacheNames.PT_CARD_TYPE, key = "#typeId")
     @Override
     public PtCardtypeVo queryById(Long typeId){
         return baseMapper.selectVoById(typeId);