@@ -18,14 +18,16 @@ Support for grayscale publishing of functions, service downgrade, Automated oper
18
18
</dependency>
19
19
```
20
20
21
- ** _ ServiceApplication _ **
21
+ ** _ controller _ **
22
22
23
23
```
24
- /**
25
- * 输出随机字符串
26
- *
27
- * @author xincao9@gmail.com
28
- */
24
+ package com.github.xincao9.jswitcher.sample.controller;
25
+
26
+ import org.apache.commons.lang3.RandomStringUtils;
27
+ import org.springframework.http.ResponseEntity;
28
+ import org.springframework.web.bind.annotation.GetMapping;
29
+ import org.springframework.web.bind.annotation.RestController;
30
+
29
31
@RestController
30
32
public class RootController {
31
33
@@ -34,6 +36,25 @@ public class RootController {
34
36
return ResponseEntity.ok(RandomStringUtils.randomAscii(128));
35
37
}
36
38
}
39
+ ```
40
+
41
+ ** _ service application_ **
42
+
43
+ ```
44
+ package com.github.xincao9.jswitcher.sample;
45
+
46
+ import com.github.xincao9.jswitcher.api.service.SwitcherService;
47
+ import com.github.xincao9.jswitcher.api.vo.QoS;
48
+ import com.github.xincao9.jswitcher.spring.boot.starter.EnableJswitcher;
49
+ import java.util.concurrent.TimeUnit;
50
+ import org.apache.commons.lang3.RandomStringUtils;
51
+ import org.slf4j.Logger;
52
+ import org.slf4j.LoggerFactory;
53
+ import org.springframework.beans.factory.annotation.Autowired;
54
+ import org.springframework.boot.CommandLineRunner;
55
+ import org.springframework.boot.SpringApplication;
56
+ import org.springframework.boot.autoconfigure.SpringBootApplication;
57
+ import org.springframework.context.annotation.Bean;
37
58
38
59
@SpringBootApplication
39
60
@EnableJswitcher
0 commit comments