解决产品发布未发布redis缓存问题

This commit is contained in:
1 2025-07-20 17:25:36 +08:00
parent 2681ae08e3
commit 287852caf5
3 changed files with 12 additions and 7 deletions

View File

@ -109,9 +109,9 @@ public class SwaggerConfig
// 用ApiInfoBuilder进行定制
return new ApiInfoBuilder()
// 设置标题
.title("FastBee物联网平台接口文档")
.title("芯程物联网平台接口文档")
// 描述
.description("描述:FastBee物联网平台")
.description("描述:芯程物联网平台接口文档")
// 作者信息
.contact(new Contact(ruoyiConfig.getName(), null, null))
// 版本

View File

@ -5,7 +5,7 @@ fastbee:
copyrightYear: 2023 # 版权年份
demoEnabled: true # 实例演示开关
# 文件路径以uploadPath结尾 示例( Windows配置 D:/uploadPathLinux配置 /uploadPath
profile: /uploadPath
profile: D:/uploadPath
addressEnabled: true # 获取ip地址开关
captchaType: math # 验证码类型 math 数组计算 char 字符验证
@ -76,8 +76,8 @@ spring:
keep-alive: 60
# 缓存配置
cache:
enable: false
type: none # none=不使用缓存 redis=使用redis缓存
enable: true
type: redis # none=不使用缓存 redis=使用redis缓存
ttl: 1800 # 缓存过期时间默认60秒
datasource:
druid:
@ -103,7 +103,7 @@ user:
token:
header: Authorization # 令牌自定义标识
secret: abcdefghijklfastbeesmartrstuvwxyz # 令牌密钥
expireTime: 1440 # 令牌有效期默认30分钟1440为一天
expireTime: 10080 # 令牌有效期默认30分钟1440为一天
# MyBatis配置
#mybatis:

View File

@ -392,8 +392,13 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper,Product> imple
* @param model
* @return 结果
*/
@Override
@Caching(evict = {
@CacheEvict(cacheNames = "product", key = "'selectProductByProductId:' + #model.productId"),
@CacheEvict(cacheNames = "product", key = "'selectDeviceCountByProductId:' + #model.productId"),
@CacheEvict(cacheNames = "product", key = "'getProtocolByProductId:' + #model.productId")
})
@Transactional
@Override
public AjaxResult changeProductStatus(ChangeProductStatusModel model) {
if (model.getStatus() != 1 && model.getStatus() != 2) {
return AjaxResult.error(MessageUtils.message("product.status.update.fail.value.fail"));