fix some type and change spring boot version to 2.0.1 from 2.0.0

This commit is contained in:
Erdem 2018-04-25 01:37:08 +03:00
parent 0da695fba5
commit 6cbe92600d
3 changed files with 7 additions and 7 deletions

View File

@ -13,7 +13,7 @@
<parent> <parent>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId> <artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.RELEASE</version> <version>2.0.1.RELEASE</version>
<relativePath /> <!-- lookup parent from repository --> <relativePath /> <!-- lookup parent from repository -->
</parent> </parent>

View File

@ -12,9 +12,9 @@ import reactor.core.publisher.Flux;
public class EventStreamController { public class EventStreamController {
@GetMapping(value = "/events", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @GetMapping(value = "/events", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<Event> getMessages() { public Flux<Event> getEvents() {
return Flux.interval(Duration.ofMillis(1000)) return Flux.interval(Duration.ofMillis(1000))
.map(tick -> new Event(tick, "This is Message #" + tick)); .map(tick -> new Event(tick, "This is Event #" + tick));
} }
} }

View File

@ -32,12 +32,12 @@
var data = JSON.parse(event.data); var data = JSON.parse(event.data);
var table = document.getElementById("events-table"); var table = document.getElementById("events-table");
var row = table.insertRow(1); var row = table.insertRow(1);
var cell1 = row.insertCell(0); var cellId = row.insertCell(0);
var cell2 = row.insertCell(1); var cellBody = row.insertCell(1);
cell1.innerHTML = '<td>' + data.id + '</td>'; cellId.innerHTML = '<td>' + data.id + '</td>';
cell2.innerHTML = '<td>' + data.body + '</td>'; cellBody.innerHTML = '<td>' + data.body + '</td>';
} }
</script> </script>