mirror of
https://github.com/continew-org/continew-admin.git
synced 2025-09-12 03:00:53 +08:00
perf: 对查询参数信息接口增加缓存处理
This commit is contained in:
@@ -20,10 +20,13 @@ import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
|
||||
import top.charles7c.cnadmin.common.constant.CacheConsts;
|
||||
import top.charles7c.cnadmin.common.util.helper.QueryHelper;
|
||||
import top.charles7c.cnadmin.system.mapper.OptionMapper;
|
||||
import top.charles7c.cnadmin.system.model.entity.OptionDO;
|
||||
@@ -41,6 +44,7 @@ import top.charles7c.cnadmin.system.service.OptionService;
|
||||
*/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
@CacheConfig(cacheNames = CacheConsts.OPTION_KEY_PREFIX)
|
||||
public class OptionServiceImpl implements OptionService {
|
||||
|
||||
private final OptionMapper baseMapper;
|
||||
@@ -51,11 +55,13 @@ public class OptionServiceImpl implements OptionService {
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
public void update(List<OptionRequest> request) {
|
||||
baseMapper.updateBatchById(BeanUtil.copyToList(request, OptionDO.class));
|
||||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(allEntries = true)
|
||||
public void resetValue(ResetOptionValueRequest request) {
|
||||
baseMapper.lambdaUpdate().set(OptionDO::getValue, null).in(OptionDO::getCode, request.getCode()).update();
|
||||
}
|
||||
|
Reference in New Issue
Block a user