Skip to content

Instantly share code, notes, and snippets.

View digimon1740's full-sized avatar
🎯
Focusing

sanghoon lee digimon1740

🎯
Focusing
View GitHub Profile
curl -X POST http://localhost:8080/todos -H 'Content-Type: application/json' -d '{ "content" : "λ‚΄μš©1" }'
{
"id": 3,
"content": "λ‚΄μš©1",
"done": false,
"createdAt": "2019-08-28T19:57:51.298743",
"modifiedAt": "2019-08-28T19:57:51.298743"
}
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> {
@digimon1740
digimon1740 / pom.xml
Last active September 15, 2019 12:50
<?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>
<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>
<repositories>
<repository>
<id>spring-snapshots</id>
<name>Spring Snapshots</name>
<url>https://repo.spring.io/snapshot</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
spring:
profiles:
active: dev
main:
allow-bean-definition-overriding: true
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)
);
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
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,