From 287852caf5d28aa3485af5fdbf333fb003ef5286 Mon Sep 17 00:00:00 2001 From: 1 <13958863+jayjiajun@user.noreply.gitee.com> Date: Sun, 20 Jul 2025 17:25:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E4=BA=A7=E5=93=81=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E6=9C=AA=E5=8F=91=E5=B8=83redis=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fastbee/web/core/config/SwaggerConfig.java | 4 ++-- fastbee-admin/src/main/resources/application.yml | 8 ++++---- .../com/fastbee/iot/service/impl/ProductServiceImpl.java | 7 ++++++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/fastbee-admin/src/main/java/com/fastbee/web/core/config/SwaggerConfig.java b/fastbee-admin/src/main/java/com/fastbee/web/core/config/SwaggerConfig.java index 74e092d..2255e59 100644 --- a/fastbee-admin/src/main/java/com/fastbee/web/core/config/SwaggerConfig.java +++ b/fastbee-admin/src/main/java/com/fastbee/web/core/config/SwaggerConfig.java @@ -109,9 +109,9 @@ public class SwaggerConfig // 用ApiInfoBuilder进行定制 return new ApiInfoBuilder() // 设置标题 - .title("FastBee物联网平台接口文档") + .title("芯程物联网平台接口文档") // 描述 - .description("描述:FastBee物联网平台") + .description("描述:芯程物联网平台接口文档") // 作者信息 .contact(new Contact(ruoyiConfig.getName(), null, null)) // 版本 diff --git a/fastbee-admin/src/main/resources/application.yml b/fastbee-admin/src/main/resources/application.yml index d4b3962..866feec 100644 --- a/fastbee-admin/src/main/resources/application.yml +++ b/fastbee-admin/src/main/resources/application.yml @@ -5,7 +5,7 @@ fastbee: copyrightYear: 2023 # 版权年份 demoEnabled: true # 实例演示开关 # 文件路径,以uploadPath结尾 示例( Windows配置 D:/uploadPath,Linux配置 /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: diff --git a/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/ProductServiceImpl.java b/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/ProductServiceImpl.java index 51da1cf..69f52aa 100644 --- a/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/ProductServiceImpl.java +++ b/fastbee-service/fastbee-iot-service/src/main/java/com/fastbee/iot/service/impl/ProductServiceImpl.java @@ -392,8 +392,13 @@ public class ProductServiceImpl extends ServiceImpl 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"));