Commit e67f78ea authored by 王亮's avatar 王亮

add nacos online method.

parent b1dfb6ec
...@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment