Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
ioc_sixiang_license
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zengtianlai3
ioc_sixiang_license
Commits
23386991
Commit
23386991
authored
Jul 15, 2022
by
AfirSraftGarrier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
fc99621e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
OperateController.java
...ava/iot/sixiang/license/controller/OperateController.java
+0
-6
AlarmServiceImpl.java
...va/iot/sixiang/license/service/impl/AlarmServiceImpl.java
+6
-0
No files found.
license/src/main/java/iot/sixiang/license/controller/OperateController.java
View file @
23386991
...
...
@@ -101,15 +101,9 @@ public class OperateController {
@GetMapping
(
"alarm/list"
)
@MyLog
(
title
=
"获取告警列表"
,
businessType
=
BusinessType
.
SELECT
)
public
ResResult
<
List
<
AlarmVo
>>
getAlarmList
()
{
response
.
setHeader
(
"Set-Cookie"
,
"cookiename=cookievalue; path=/; Domain=domainvaule; Max-age=seconds; HttpOnly"
);
String
user
=
UserUtils
.
getLoginUserId
();
int
userI
=
Integer
.
valueOf
(
user
);
List
<
AlarmVo
>
alarmList
=
alarmService
.
getAlarmList
(
userI
);
if
(
alarmList
!=
null
&&
!
alarmList
.
isEmpty
())
{
for
(
AlarmVo
alarmVo
:
alarmList
)
{
alarmVo
.
setContent
(
ESAPI
.
encoder
().
encodeForHTML
(
alarmVo
.
getContent
()));
}
}
return
ResResult
.
success
().
goRecord
(
alarmList
);
}
...
...
license/src/main/java/iot/sixiang/license/service/impl/AlarmServiceImpl.java
View file @
23386991
...
...
@@ -7,6 +7,7 @@ import iot.sixiang.license.handler.IotLicenseException;
import
iot.sixiang.license.mapper.AlarmMapper
;
import
iot.sixiang.license.model.vo.AlarmVo
;
import
iot.sixiang.license.service.AlarmService
;
import
org.owasp.esapi.ESAPI
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
...
...
@@ -31,6 +32,11 @@ public class AlarmServiceImpl extends ServiceImpl<AlarmMapper, Alarm> implements
}
List
<
AlarmVo
>
alarmVos
=
alarmMapper
.
getAlarmList
(
uI
);
alarmVos
=
alarmVos
.
stream
().
sorted
(
Comparator
.
comparing
(
AlarmVo:
:
getCreateTime
,
Comparator
.
reverseOrder
())).
collect
(
Collectors
.
toList
());
if
(
alarmVos
!=
null
&&
!
alarmVos
.
isEmpty
())
{
for
(
AlarmVo
alarmVo
:
alarmVos
)
{
alarmVo
.
setContent
(
ESAPI
.
encoder
().
encodeForHTML
(
alarmVo
.
getContent
()));
}
}
return
alarmVos
;
}
}
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