-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,14 +18,16 @@ Support for grayscale publishing of functions, service downgrade, Automated oper | |
</dependency> | ||
``` | ||
|
||
**_ServiceApplication_** | ||
**_controller_** | ||
|
||
``` | ||
/** | ||
* 输出随机字符串 | ||
* | ||
* @author [email protected] | ||
*/ | ||
package com.github.xincao9.jswitcher.sample.controller; | ||
import org.apache.commons.lang3.RandomStringUtils; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
@RestController | ||
public class RootController { | ||
|
@@ -34,6 +36,25 @@ public class RootController { | |
return ResponseEntity.ok(RandomStringUtils.randomAscii(128)); | ||
} | ||
} | ||
``` | ||
|
||
**_service application_** | ||
|
||
``` | ||
package com.github.xincao9.jswitcher.sample; | ||
import com.github.xincao9.jswitcher.api.service.SwitcherService; | ||
import com.github.xincao9.jswitcher.api.vo.QoS; | ||
import com.github.xincao9.jswitcher.spring.boot.starter.EnableJswitcher; | ||
import java.util.concurrent.TimeUnit; | ||
import org.apache.commons.lang3.RandomStringUtils; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.CommandLineRunner; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
import org.springframework.context.annotation.Bean; | ||
@SpringBootApplication | ||
@EnableJswitcher | ||
|