1
0
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:
flystar32
2018-07-27 19:18:12 +08:00
parent b4b0cceb66
commit 0ce2df89ab
34 changed files with 2151 additions and 1 deletions

View File

@@ -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);
}
}

View File

@@ -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";
}
}

View File

@@ -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