mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
refactor import in greenwich
This commit is contained in:
@@ -16,7 +16,9 @@
|
||||
|
||||
package com.alibaba.cloud.examples;
|
||||
|
||||
import static org.springframework.web.reactive.function.BodyInserters.fromObject;
|
||||
import com.alibaba.csp.sentinel.adapter.spring.webflux.callback.BlockRequestHandler;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -25,9 +27,7 @@ import org.springframework.http.MediaType;
|
||||
import org.springframework.web.reactive.function.server.ServerResponse;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
import com.alibaba.csp.sentinel.adapter.spring.webflux.callback.BlockRequestHandler;
|
||||
|
||||
import reactor.core.publisher.Mono;
|
||||
import static org.springframework.web.reactive.function.BodyInserters.fromObject;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
|
||||
|
@@ -16,14 +16,14 @@
|
||||
|
||||
package com.alibaba.cloud.examples;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.csp.sentinel.adapter.reactor.SentinelReactorTransformer;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:fangjian0423@gmail.com">Jim</a>
|
||||
*/
|
||||
@@ -37,12 +37,12 @@ public class SentinelWebFluxController {
|
||||
.transform(new SentinelReactorTransformer<>("mono"));
|
||||
}
|
||||
|
||||
@GetMapping("/test")
|
||||
public Mono<String> test() {
|
||||
return Mono.just("simple string")
|
||||
// transform the publisher here.
|
||||
.transform(new SentinelReactorTransformer<>("test"));
|
||||
}
|
||||
@GetMapping("/test")
|
||||
public Mono<String> test() {
|
||||
return Mono.just("simple string")
|
||||
// transform the publisher here.
|
||||
.transform(new SentinelReactorTransformer<>("test"));
|
||||
}
|
||||
|
||||
@GetMapping("/flux")
|
||||
public Flux<String> flux() {
|
||||
|
Reference in New Issue
Block a user