This file contains hidden or 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
| curl -X POST http://localhost:8080/todos -H 'Content-Type: application/json' -d '{ "content" : "λ΄μ©1" }' |
This file contains hidden or 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
| { | |
| "id": 3, | |
| "content": "λ΄μ©1", | |
| "done": false, | |
| "createdAt": "2019-08-28T19:57:51.298743", | |
| "modifiedAt": "2019-08-28T19:57:51.298743" | |
| } |
This file contains hidden or 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
| package org.springframework.data.repository.reactive; | |
| import org.reactivestreams.Publisher; | |
| import org.springframework.data.repository.NoRepositoryBean; | |
| import org.springframework.data.repository.Repository; | |
| import reactor.core.publisher.Flux; | |
| import reactor.core.publisher.Mono; | |
| @NoRepositoryBean | |
| public interface ReactiveCrudRepository<T, ID> extends Repository<T, ID> { |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
| <modelVersion>4.0.0</modelVersion> | |
| <parent> | |
| <groupId>org.springframework.boot</groupId> | |
| <artifactId>spring-boot-starter-parent</artifactId> | |
| <version>2.2.0.M6</version> | |
| <relativePath/> <!-- lookup parent from repository --> | |
| </parent> |
This file contains hidden or 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
| <dependency> | |
| <groupId>org.springframework.boot.experimental</groupId> | |
| <artifactId>spring-boot-starter-data-r2dbc</artifactId> | |
| <version>${spring-boot-data-r2dbc.version}</version> | |
| </dependency> | |
| <dependency> | |
| <groupId>org.springframework.boot.experimental</groupId> | |
| <artifactId>spring-boot-starter-r2dbc-h2</artifactId> | |
| <version>${spring-boot-data-r2dbc.version}</version> | |
| </dependency> |
This file contains hidden or 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
| <repositories> | |
| <repository> | |
| <id>spring-snapshots</id> | |
| <name>Spring Snapshots</name> | |
| <url>https://repo.spring.io/snapshot</url> | |
| <snapshots> | |
| <enabled>true</enabled> | |
| </snapshots> | |
| </repository> | |
| <repository> |
This file contains hidden or 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
| spring: | |
| profiles: | |
| active: dev | |
| main: | |
| allow-bean-definition-overriding: true |
This file contains hidden or 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
| drop table if exists todos; | |
| create table todos ( | |
| id bigint generated by default as identity, | |
| content varchar(2000), | |
| created_at timestamp, | |
| done boolean, | |
| modified_at timestamp, | |
| primary key (id) | |
| ); |
This file contains hidden or 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
| package com.digimon.demo.config | |
| import io.r2dbc.h2.H2ConnectionConfiguration | |
| import io.r2dbc.h2.H2ConnectionFactory | |
| import io.r2dbc.spi.ConnectionFactory | |
| import org.springframework.context.annotation.Configuration | |
| import org.springframework.data.r2dbc.config.AbstractR2dbcConfiguration | |
| import org.springframework.data.r2dbc.repository.config.EnableR2dbcRepositories | |
| @Configuration |
This file contains hidden or 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
| package com.digimon.demo.domain.todo | |
| import org.springframework.data.annotation.Id | |
| import org.springframework.data.relational.core.mapping.Table | |
| import java.time.LocalDateTime | |
| @Table("todos") | |
| data class Todo( | |
| @Id | |
| var id: Long? = null, |