Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
device-new-platform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
device-new-platform
Commits
9c52ffc3
Commit
9c52ffc3
authored
Jun 23, 2022
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改redis 过期事件通知
parent
a94e573c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
21 deletions
+24
-21
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
...als/xhx/module/device/service/impl/DeviceServiceImpl.java
+22
-19
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
.../java/com/mortals/httpclient/device/DeviceController.http
+2
-2
No files found.
device-manager/src/main/java/com/mortals/xhx/module/device/service/impl/DeviceServiceImpl.java
View file @
9c52ffc3
...
...
@@ -51,8 +51,6 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
return
data
.
getDeviceCode
();
}
@Autowired
private
MessageService
messageService
;
@Autowired
...
...
@@ -222,27 +220,32 @@ public class DeviceServiceImpl extends AbstractCRUDCacheServiceImpl<DeviceDao, D
protected
void
removeBefore
(
Long
[]
ids
,
Context
context
)
throws
AppException
{
Arrays
.
asList
(
ids
).
stream
().
forEach
(
id
->
{
DeviceEntity
deviceEntity
=
this
.
get
(
id
,
context
);
TbQueueCallback
callback
=
new
TbQueueCallback
()
{
@Override
public
void
onSuccess
(
TbQueueMsgMetadata
metadata
)
{
log
.
info
(
"队列删除成功"
);
}
if
(!
ObjectUtils
.
isEmpty
(
deviceEntity
))
{
@Override
public
void
onFailure
(
Throwable
t
)
{
log
.
error
(
"队列删除失败"
,
t
);
}
};
messageService
.
delQueue
(
Constant
.
UPLOAD_TOPIC
+
deviceEntity
.
getDeviceCode
(),
callback
);
messageService
.
delQueue
(
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
callback
);
TbQueueCallback
callback
=
new
TbQueueCallback
()
{
@Override
public
void
onSuccess
(
TbQueueMsgMetadata
metadata
)
{
log
.
info
(
"队列删除成功"
);
}
@Override
public
void
onFailure
(
Throwable
t
)
{
log
.
error
(
"队列删除失败"
,
t
);
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//新增设备通知第三方平台
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceStatusEnum
.
DEL
);
}
};
messageService
.
delQueue
(
Constant
.
UPLOAD_TOPIC
+
deviceEntity
.
getDeviceCode
(),
callback
);
messageService
.
delQueue
(
Constant
.
DOWN_TOPIC
+
deviceEntity
.
getDeviceCode
(),
callback
);
PlatformEntity
platformEntity
=
platformService
.
get
(
deviceEntity
.
getPlatformId
());
ProductEntity
productEntity
=
productService
.
get
(
deviceEntity
.
getProductId
());
if
(!
ObjectUtils
.
isEmpty
(
platformEntity
)
&&
!
ObjectUtils
.
isEmpty
(
productEntity
))
{
//新增设备通知第三方平台
sendThirdParty
(
deviceEntity
,
productEntity
,
platformEntity
,
DeviceStatusEnum
.
DEL
);
}
//删除扩展extKey
this
.
removeCache
(
deviceEntity
.
getDeviceCode
());
}
});
super
.
removeBefore
(
ids
,
context
);
...
...
device-manager/src/test/java/com/mortals/httpclient/device/DeviceController.http
View file @
9c52ffc3
...
...
@@ -71,7 +71,7 @@ POST {{baseUrl}}/api/register
Content-Type: application/json
{
"deviceCode": "
b
12345678"
"deviceCode": "
c
12345678"
}
> {%
...
...
@@ -108,7 +108,7 @@ Content-Type: application/json
Authorization: {{authToken}}
{
"deviceCode": "
b
12345678",
"deviceCode": "
c
12345678",
"action": "upload"
}
...
...
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