Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
iot-service
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SuperHive
back-end
iot-service
Commits
4670bb4c
Commit
4670bb4c
authored
Aug 04, 2020
by
huangcb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调整生成Topic代码
parent
c54b9127
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
24 deletions
+6
-24
InstanceTopicServiceImpl.java
.../module/omodel/service/impl/InstanceTopicServiceImpl.java
+2
-4
application-demo.yml
src/main/resources/application-demo.yml
+1
-5
application-dev.yml
src/main/resources/application-dev.yml
+1
-5
application-local.yml
src/main/resources/application-local.yml
+1
-5
application-test.yml
src/main/resources/application-test.yml
+1
-5
No files found.
src/main/java/com/esv/datacenter/iot/module/omodel/service/impl/InstanceTopicServiceImpl.java
View file @
4670bb4c
...
@@ -14,13 +14,11 @@ import org.springframework.stereotype.Service;
...
@@ -14,13 +14,11 @@ import org.springframework.stereotype.Service;
@RefreshScope
@RefreshScope
public
class
InstanceTopicServiceImpl
extends
ServiceImpl
<
InstanceTopicDao
,
InstanceTopicEntity
>
implements
InstanceTopicService
{
public
class
InstanceTopicServiceImpl
extends
ServiceImpl
<
InstanceTopicDao
,
InstanceTopicEntity
>
implements
InstanceTopicService
{
@Value
(
"${mqtt.topic.instance.data-upload}"
)
private
static
final
String
TOPIC_PREFIX
=
"$esv/iot/"
;
private
String
instanceDataUploadTopic
;
@Override
@Override
public
void
insertTopic
(
Long
modelId
,
Long
instanceId
)
{
public
void
insertTopic
(
Long
modelId
,
Long
instanceId
)
{
String
topic
=
instanceDataUploadTopic
.
replaceFirst
(
"[model_id]"
,
String
.
valueOf
(
modelId
))
String
topic
=
TOPIC_PREFIX
+
modelId
+
"/"
+
instanceId
+
"/data/upload"
;
.
replaceFirst
(
"[instance_id]"
,
String
.
valueOf
(
instanceId
));
InstanceTopicEntity
entity
=
new
InstanceTopicEntity
();
InstanceTopicEntity
entity
=
new
InstanceTopicEntity
();
entity
.
setModelId
(
modelId
);
entity
.
setModelId
(
modelId
);
entity
.
setInstanceId
(
instanceId
);
entity
.
setInstanceId
(
instanceId
);
...
...
src/main/resources/application-demo.yml
View file @
4670bb4c
...
@@ -85,8 +85,4 @@ timescale:
...
@@ -85,8 +85,4 @@ timescale:
max-lifetime
:
0
max-lifetime
:
0
table-field
:
table-field
:
map
:
string-text,number-numeric,boolean-bit(1)
map
:
string-text,number-numeric,boolean-bit(1)
table-prefix
:
iot_model_
table-prefix
:
iot_model_
mqtt
:
\ No newline at end of file
topic
:
instance
:
data-upload
:
$esv/iot/[model_id]/[instance_id]/data/upload
\ No newline at end of file
src/main/resources/application-dev.yml
View file @
4670bb4c
...
@@ -85,8 +85,4 @@ timescale:
...
@@ -85,8 +85,4 @@ timescale:
max-lifetime
:
0
max-lifetime
:
0
table-field
:
table-field
:
map
:
string-text,number-numeric,boolean-bit(1)
map
:
string-text,number-numeric,boolean-bit(1)
table-prefix
:
iot_model_
table-prefix
:
iot_model_
mqtt
:
\ No newline at end of file
topic
:
instance
:
data-upload
:
$esv/iot/[model_id]/[instance_id]/data/upload
\ No newline at end of file
src/main/resources/application-local.yml
View file @
4670bb4c
...
@@ -85,8 +85,4 @@ timescale:
...
@@ -85,8 +85,4 @@ timescale:
max-lifetime
:
0
max-lifetime
:
0
table-field
:
table-field
:
map
:
string-text,number-numeric,boolean-bit(1)
map
:
string-text,number-numeric,boolean-bit(1)
table-prefix
:
iot_model_
table-prefix
:
iot_model_
mqtt
:
\ No newline at end of file
topic
:
instance
:
data-upload
:
$esv/iot/[model_id]/[instance_id]/data/upload
\ No newline at end of file
src/main/resources/application-test.yml
View file @
4670bb4c
...
@@ -85,8 +85,4 @@ timescale:
...
@@ -85,8 +85,4 @@ timescale:
max-lifetime
:
0
max-lifetime
:
0
table-field
:
table-field
:
map
:
string-text,number-numeric,boolean-bit(1)
map
:
string-text,number-numeric,boolean-bit(1)
table-prefix
:
iot_model_
table-prefix
:
iot_model_
mqtt
:
\ No newline at end of file
topic
:
instance
:
data-upload
:
$esv/iot/[model_id]/[instance_id]/data/upload
\ No newline at end of file
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