Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
commons
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
3
Merge Requests
3
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DevOps
commons
Commits
e67f78ea
Commit
e67f78ea
authored
May 16, 2022
by
王亮
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add nacos online method.
parent
b1dfb6ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
ServiceDeployEndpoint.java
...c/main/java/cn/quantgroup/boot/ServiceDeployEndpoint.java
+6
-0
No files found.
qg-discovery-starter/src/main/java/cn/quantgroup/boot/ServiceDeployEndpoint.java
View file @
e67f78ea
...
@@ -3,6 +3,7 @@ package cn.quantgroup.boot;
...
@@ -3,6 +3,7 @@ package cn.quantgroup.boot;
import
com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration
;
import
com.alibaba.cloud.nacos.registry.NacosAutoServiceRegistration
;
import
org.springframework.boot.actuate.endpoint.annotation.ReadOperation
;
import
org.springframework.boot.actuate.endpoint.annotation.ReadOperation
;
import
org.springframework.boot.actuate.endpoint.annotation.WriteOperation
;
import
org.springframework.boot.actuate.endpoint.web.annotation.WebEndpoint
;
import
org.springframework.boot.actuate.endpoint.web.annotation.WebEndpoint
;
import
org.springframework.context.annotation.Configuration
;
import
org.springframework.context.annotation.Configuration
;
...
@@ -19,4 +20,9 @@ public class ServiceDeployEndpoint {
...
@@ -19,4 +20,9 @@ public class ServiceDeployEndpoint {
public
void
offLine
()
{
public
void
offLine
()
{
nacosAutoServiceRegistration
.
stop
();
nacosAutoServiceRegistration
.
stop
();
}
}
@WriteOperation
public
void
onLine
(){
nacosAutoServiceRegistration
.
start
();
}
}
}
\ 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