|
@@ -1,22 +0,0 @@
|
|
|
-package com.caimei365.user.controller;
|
|
|
-
|
|
|
-import org.springframework.http.MediaType;
|
|
|
-import org.springframework.web.bind.annotation.GetMapping;
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
-import reactor.core.publisher.Flux;
|
|
|
-
|
|
|
-import java.time.Duration;
|
|
|
-
|
|
|
-/**
|
|
|
- * 测试
|
|
|
- *
|
|
|
- * @author : Charles
|
|
|
- * @date : 2021/3/12
|
|
|
- */
|
|
|
-@RestController
|
|
|
-public class ApiTest {
|
|
|
- @GetMapping(value = "/test/sse", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
|
|
- private Flux<String> flux() {
|
|
|
- return Flux.interval(Duration.ofMillis(1000)).map(i -> " -> " +i);
|
|
|
- }
|
|
|
-}
|