perf(cms): 优化缓存清除功能并添加日志记录- 在 CmsWebsiteController 中添加缓存清除开始和结束的日志记录

- 优化缓存清除逻辑,确保相关缓存被正确删除
- 在 OrderBusinessService 中删除多余的空行,提高代码可读性
This commit is contained in:
2025-08-29 15:27:33 +08:00
parent e92d1ce42a
commit c74d70bf4d
2 changed files with 2 additions and 1 deletions

View File

@@ -510,10 +510,12 @@ public class CmsWebsiteController extends BaseController {
@Operation(summary = "清除缓存")
@DeleteMapping("/clearSiteInfo/{key}")
public ApiResult<?> clearSiteInfo(@PathVariable("key") String key) {
log.info("清除缓存开始key: {}", key);
// 清除指定key
redisUtil.delete(key);
// 清除缓存
redisUtil.delete(SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
log.info("清除缓存结束key: {}", SITE_INFO_KEY_PREFIX.concat(getTenantId().toString()));
// 清除小程序缓存
redisUtil.delete(MP_INFO_KEY_PREFIX.concat(getTenantId().toString()));
// 选择支付方式

View File

@@ -405,7 +405,6 @@ public class OrderBusinessService {
log.info("使用用户第一个收货地址地址ID{}用户ID{}", firstAddress.getId(), loginUser.getUserId());
return;
}
// 5. 如果用户没有任何收货地址,抛出异常
throw new BusinessException("请先添加收货地址");