Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2bf556f5
authored
Sep 26, 2023
by
李小龙
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:告警配置更新
parent
e110043c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletions
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmConfigController.java
server-service/src/main/java/com/makeit/utils/AlarmConfigCacheUtil.java
server-module/src/main/java/com/makeit/module/controller/alarm/PlatAlarmConfigController.java
View file @
2bf556f5
...
@@ -7,7 +7,10 @@ import com.makeit.common.response.ApiResponseEntity;
...
@@ -7,7 +7,10 @@ import com.makeit.common.response.ApiResponseEntity;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.common.response.ApiResponseUtils
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigDTOVO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO
;
import
com.makeit.dto.platform.alarm.PlatAlarmConfigQueryDTO
;
import
com.makeit.global.annotation.AuthIgnore
;
import
com.makeit.global.aspect.tenant.TenantIdIgnore
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.service.platform.alarm.PlatAlarmConfigService
;
import
com.makeit.utils.AlarmConfigCacheUtil
;
import
com.makeit.vo.platform.alarm.PlatAlarmConfigListVO
;
import
com.makeit.vo.platform.alarm.PlatAlarmConfigListVO
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -81,6 +84,16 @@ public class PlatAlarmConfigController {
...
@@ -81,6 +84,16 @@ public class PlatAlarmConfigController {
platAlarmConfigService
.
changeStatus
(
dto
);
platAlarmConfigService
.
changeStatus
(
dto
);
return
ApiResponseUtils
.
success
();
return
ApiResponseUtils
.
success
();
}
}
@Autowired
private
AlarmConfigCacheUtil
alarmConfigCacheUtil
;
@ApiOperation
(
"测试"
)
@PostMapping
(
"test"
)
@TenantIdIgnore
@AuthIgnore
public
ApiResponseEntity
<?>
test
(
@Validated
@RequestBody
PlatAlarmConfigDTOVO
dto
)
{
alarmConfigCacheUtil
.
get
(
dto
.
getOrgId
(),
dto
.
getAlarmType
());
return
ApiResponseUtils
.
success
();
}
}
}
...
...
server-service/src/main/java/com/makeit/utils/AlarmConfigCacheUtil.java
View file @
2bf556f5
...
@@ -37,7 +37,8 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
...
@@ -37,7 +37,8 @@ public class AlarmConfigCacheUtil implements ApplicationRunner {
return
list
;
return
list
;
}
}
public
void
put
(
PlatAlarmConfig
alarmConfig
)
{
public
void
put
(
PlatAlarmConfig
alarmConfigVO
)
{
PlatAlarmConfig
alarmConfig
=
platAlarmConfigService
.
getById
(
alarmConfigVO
.
getId
());
if
(
StringUtils
.
equals
(
CommonEnum
.
YES
.
getValue
(),
alarmConfig
.
getStatus
()))
{
if
(
StringUtils
.
equals
(
CommonEnum
.
YES
.
getValue
(),
alarmConfig
.
getStatus
()))
{
RedisUtil
.
set
(
RedisConst
.
ALARM_CONFIG_ORG_ID
+
alarmConfig
.
getOrgId
()
+
":"
+
alarmConfig
.
getAlarmType
(),
alarmConfig
);
RedisUtil
.
set
(
RedisConst
.
ALARM_CONFIG_ORG_ID
+
alarmConfig
.
getOrgId
()
+
":"
+
alarmConfig
.
getAlarmType
(),
alarmConfig
);
}
else
{
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment