mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
hello, spring cloud alibaba
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
package org.springframework.cloud.alibaba.cloud.examples;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class ServiceApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ServiceApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,25 @@
|
||||
package org.springframework.cloud.alibaba.cloud.examples;
|
||||
|
||||
import org.springframework.cloud.alibaba.sentinel.custom.EnableSentinel;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author xiaojing
|
||||
*/
|
||||
@RestController
|
||||
public class TestController {
|
||||
|
||||
@RequestMapping(value = "/hello", method = RequestMethod.GET)
|
||||
@EnableSentinel("resource")
|
||||
public String hello() {
|
||||
return "Hello";
|
||||
}
|
||||
|
||||
@RequestMapping(value = "/test", method = RequestMethod.GET)
|
||||
public String test1() {
|
||||
return "Hello test";
|
||||
}
|
||||
|
||||
}
|
@@ -0,0 +1,5 @@
|
||||
spring.application.name=sentinel-example
|
||||
server.port=18083
|
||||
management.endpoints.web.exposure.include=*
|
||||
spring.cloud.sentinel.port=8721
|
||||
spring.cloud.sentinel.dashboard=localhost:8080
|
Reference in New Issue
Block a user