fix some type and change spring boot version to 2.0.1 from 2.0.0
This commit is contained in:
parent
0da695fba5
commit
6cbe92600d
|
@ -13,7 +13,7 @@
|
|||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.0.0.RELEASE</version>
|
||||
<version>2.0.1.RELEASE</version>
|
||||
<relativePath /> <!-- lookup parent from repository -->
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@ import reactor.core.publisher.Flux;
|
|||
public class EventStreamController {
|
||||
|
||||
@GetMapping(value = "/events", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public Flux<Event> getMessages() {
|
||||
public Flux<Event> getEvents() {
|
||||
return Flux.interval(Duration.ofMillis(1000))
|
||||
.map(tick -> new Event(tick, "This is Message #" + tick));
|
||||
.map(tick -> new Event(tick, "This is Event #" + tick));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -32,12 +32,12 @@
|
|||
var data = JSON.parse(event.data);
|
||||
var table = document.getElementById("events-table");
|
||||
var row = table.insertRow(1);
|
||||
var cell1 = row.insertCell(0);
|
||||
var cell2 = row.insertCell(1);
|
||||
var cellId = row.insertCell(0);
|
||||
var cellBody = row.insertCell(1);
|
||||
|
||||
|
||||
cell1.innerHTML = '<td>' + data.id + '</td>';
|
||||
cell2.innerHTML = '<td>' + data.body + '</td>';
|
||||
cellId.innerHTML = '<td>' + data.id + '</td>';
|
||||
cellBody.innerHTML = '<td>' + data.body + '</td>';
|
||||
}
|
||||
</script>
|
||||
|
||||
|
|
Loading…
Reference in New Issue