From c9063bbb75829bf5f1c514a52397031537a24eb9 Mon Sep 17 00:00:00 2001 From: "296196709@qq.com" <296196709@qq.com> Date: Thu, 5 Jul 2018 01:13:59 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B3=A8=E9=87=8A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/burt/domain/Person.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/burt/domain/Person.java b/src/main/java/com/burt/domain/Person.java index e644d0c..d760055 100644 --- a/src/main/java/com/burt/domain/Person.java +++ b/src/main/java/com/burt/domain/Person.java @@ -7,6 +7,8 @@ import lombok.Setter; import lombok.ToString; /** + * Person + * * @author luowei1 * @date 2018/7/4 15:21 */ -- Gitee From 652f3ec37e13070db1438a6f5be21cea1cce21ff Mon Sep 17 00:00:00 2001 From: "296196709@qq.com" <296196709@qq.com> Date: Thu, 5 Jul 2018 01:16:12 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=B3=A8=E9=87=8A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/burt/controller/PersonRestController.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/burt/controller/PersonRestController.java b/src/main/java/com/burt/controller/PersonRestController.java index 4d085c4..131e916 100644 --- a/src/main/java/com/burt/controller/PersonRestController.java +++ b/src/main/java/com/burt/controller/PersonRestController.java @@ -2,12 +2,19 @@ package com.burt.controller; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.MediaType; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import com.burt.domain.Person; import com.burt.repository.PersonRepository; /** + * PersonRestController + * * @author luowei1 * @date 2018/7/4 15:59 */ -- Gitee From 37ac3166a8dd814f5cb03cd2cb4709cc697be79b Mon Sep 17 00:00:00 2001 From: "296196709@qq.com" <296196709@qq.com> Date: Thu, 5 Jul 2018 01:19:56 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/burt/webflux/PersonHandler.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/burt/webflux/PersonHandler.java b/src/main/java/com/burt/webflux/PersonHandler.java index 3bd15f2..deabc6e 100644 --- a/src/main/java/com/burt/webflux/PersonHandler.java +++ b/src/main/java/com/burt/webflux/PersonHandler.java @@ -8,6 +8,7 @@ import org.springframework.web.reactive.function.server.ServerResponse; import com.burt.domain.Person; import com.burt.repository.PersonRepository; +import lombok.extern.log4j.Log4j2; import reactor.core.publisher.Mono; /** @@ -16,6 +17,7 @@ import reactor.core.publisher.Mono; * @author luowei1 * @date 2018/7/4 16:58 */ +@Log4j2 @Component public class PersonHandler { -- Gitee From abc3455cc764aa278fd9b80cee84373e2e8d4f37 Mon Sep 17 00:00:00 2001 From: "296196709@qq.com" <296196709@qq.com> Date: Wed, 18 Jul 2018 23:28:15 +0800 Subject: [PATCH 4/4] =?UTF-8?q?WebApplicationType=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 13 +++++++------ .../burt/HttpMessageConverterDemoApplication.java | 8 ++++++-- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 02b5d45..76dd971 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,6 @@ - 4.0.0 @@ -30,11 +31,11 @@ spring-boot-starter-webflux - - - - - + + + org.springframework.boot + spring-boot-starter-web + diff --git a/src/main/java/com/burt/HttpMessageConverterDemoApplication.java b/src/main/java/com/burt/HttpMessageConverterDemoApplication.java index b8d37b8..470a565 100644 --- a/src/main/java/com/burt/HttpMessageConverterDemoApplication.java +++ b/src/main/java/com/burt/HttpMessageConverterDemoApplication.java @@ -1,12 +1,16 @@ package com.burt; -import org.springframework.boot.SpringApplication; +import org.springframework.boot.WebApplicationType; import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.boot.builder.SpringApplicationBuilder; @SpringBootApplication public class HttpMessageConverterDemoApplication { public static void main(String[] args) { - SpringApplication.run(HttpMessageConverterDemoApplication.class, args); + // SpringApplication.run(HttpMessageConverterDemoApplication.class, args); + // new SpringApplicationBuilder(HttpMessageConverterDemoApplication.class).run(args); + new SpringApplicationBuilder(HttpMessageConverterDemoApplication.class).web(WebApplicationType.REACTIVE) + .run(args); } } -- Gitee