From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java index cbfea98..3841bc4 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_property/src/main/java/com/panzhihua/service_property/service/impl/ComPropertyAlarmSettingServiceImpl.java @@ -7,6 +7,7 @@ import com.panzhihua.service_property.dao.ComPropertyAlarmSettingDao; import com.panzhihua.service_property.service.ComPropertyAlarmSettingService; import lombok.extern.slf4j.Slf4j; +import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.stereotype.Service; import javax.annotation.Resource; @@ -22,6 +23,8 @@ public class ComPropertyAlarmSettingServiceImpl extends ServiceImpl<ComPropertyAlarmSettingDao, ComPropertyAlarmSetting> implements ComPropertyAlarmSettingService { @Resource private ComPropertyAlarmSettingDao comPropertyAlarmSettingDao; + @Resource + private StringRedisTemplate stringRedisTemplate; @Override public R pageList(CommonPage commonPage) { return null; @@ -31,4 +34,17 @@ public R getByCommunityId(Long communityId) { return R.ok(comPropertyAlarmSettingDao.getByCommunityId(communityId)); } + + @Override + public R insert(ComPropertyAlarmSetting comPropertyAlarmSetting) { + boolean result=this.saveOrUpdate(comPropertyAlarmSetting); + if(result){ + if(stringRedisTemplate.hasKey(comPropertyAlarmSetting.getCommunityId().toString())){ + stringRedisTemplate.boundValueOps(comPropertyAlarmSetting.getCommunityId().toString()).set(comPropertyAlarmSetting.getTriggerTime().toString()); + } + return R.ok(); + } + + return R.fail(); + } } -- Gitblit v1.7.1