Similar documents
Modern Javascript

FreeBSD Handbook

09-interface.key

PowerPoint Presentation

¾Æ½Ã¾ÆÀú³Î8È£-ÅëÇÕ

fundamentalOfCommandPattern_calmglow_pattern_jstorm_1.0_f…

Interstage5 SOAP서비스 설정 가이드

rmi_박준용_final.PDF

신림프로그래머_클린코드.key

Spring Data JPA Many To Many 양방향 관계 예제

PowerPoint 프레젠테이션

05-class.key

14-Servlet

어댑터뷰

@OneToOne(cascade = = "addr_id") private Addr addr; public Emp(String ename, Addr addr) { this.ename = ename; this.a

JMF3_심빈구.PDF


5장.key

Spring Boot/JDBC JdbcTemplate/CRUD 예제

ilist.add(new Integer(1))과 같이 사용하지 않고 ilist.add(1)과 같이 사용한 것은 자바 5.0에 추가된 기본 자료형과 해당 객체 자료 형과의 오토박싱/언박싱 기능을 사용한 것으로 오토박싱이란 자바 컴파일러가 객체를 요구하는 곳에 기본 자료형

비긴쿡-자바 00앞부속

2

No Slide Title

I T C o t e n s P r o v i d e r h t t p : / / w w w. h a n b i t b o o k. c o. k r

OOP 소개

C++ Programming

* Factory class for query and DML clause creation * tiwe * */ public class JPAQueryFactory implements JPQLQueryFactory private f

3ÆÄÆ®-14

歯JavaExceptionHandling.PDF

PowerPoint 프레젠테이션

쉽게 풀어쓴 C 프로그래밍

12-file.key

Embeddedsystem(8).PDF

Chap12

내장서버로사용. spring-boot-starter-data-jpa : Spring Data JPA 사용을위한설정 spring-boot-devtools : 개발자도구를제공, 이도구는응용프로그램개발모드에서유 용한데코드가변경된경우서버를자동으로다시시작하는일들을한다. spri

13ÀåÃß°¡ºÐ

부산, 글로벌과 로컬의 사이에서

JAVA PROGRAMMING 실습 08.다형성

q 이장에서다룰내용 1 객체지향프로그래밍의이해 2 객체지향언어 : 자바 2

Microsoft PowerPoint - 04-UDP Programming.ppt

10장.key

Network seminar.key

- 목차 - - ios 개발환경및유의사항. - 플랫폼 ios Project. - Native Controller와플랫폼화면연동. - 플랫폼 Web(js)-Native 간데이터공유. - 플랫폼확장 WN Interface 함수개발. - Network Manager clas

자바GUI실전프로그래밍2_장대원.PDF

제8장 자바 GUI 프로그래밍 II

JavaGeneralProgramming.PDF

Design Issues

Chap7.PDF

11 템플릿적용 - Java Program Performance Tuning (김명호기술이사)

Microsoft PowerPoint - TimeTable System.pptx

제11장 프로세스와 쓰레드

공공도서관도큐06

ch09

Microsoft PowerPoint - Java7.pptx

01-OOPConcepts(2).PDF

JMF2_심빈구.PDF

PowerPoint 프레젠테이션

Microsoft PowerPoint - Smart CRM v4.0_TM 소개_ pptx

Secure Programming Lecture1 : Introduction

PowerPoint 프레젠테이션

Intro to Servlet, EJB, JSP, WS

KYO_SCCD.PDF

chap10.PDF

282서비스업관리-마트

- JPA를사용하는경우의스프링설정파일에다음을기술한다. <bean id="entitymanagerfactory" class="org.springframework.orm.jpa.localentitymanagerfactorybean" p:persistenceunitname=

본 발명은 중공코어 프리캐스트 슬래브 및 그 시공방법에 관한 것으로, 자세하게는 중공코어로 형성된 프리캐스트 슬래브 에 온돌을 일체로 구성한 슬래브 구조 및 그 시공방법에 관한 것이다. 이를 위한 온돌 일체형 중공코어 프리캐스트 슬래브는, 공장에서 제작되는 중공코어 프

Network Programming

자바 프로그래밍

유니티 변수-함수.key

목차 JEUS EJB Session Bean가이드 stateful session bean stateful sample 가이드 sample source 결과확인 http session에

Java

Web Service Computing

예제 2) Test.java class A intvar= 10; void method() class B extends A intvar= 20; 1"); void method() 2"); void method1() public class Test 3"); args) A

Microsoft PowerPoint - 14주차 강의자료

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

iii. Design Tab 을 Click 하여 WindowBuilder 가자동으로생성한 GUI 프로그래밍환경을확인한다.

Java Programing Environment

thesis

PowerPoint Presentation

AMP는 어떻게 빠른 성능을 내나.key

개발을 통한 자기수양

mytalk

final_thesis

MPLAB C18 C


Mobile Service > IAP > Android SDK [ ] IAP SDK TOAST SDK. IAP SDK. Android Studio IDE Android SDK Version (API Level 10). Name Reference V

교육자료

Microsoft Word - java19-1-midterm-answer.doc

9장.key

02 C h a p t e r Java

PowerPoint Presentation

Microsoft PowerPoint - 2강

PowerPoint 프레젠테이션

API STORE 키발급및 API 사용가이드 Document Information 문서명 : API STORE 언어별 Client 사용가이드작성자 : 작성일 : 업무영역 : 버전 : 1 st Draft. 서브시스템 : 문서번호 : 단계 : Docum

FreeBSD Handbook

ThisJava ..

gnu-lee-oop-kor-lec10-1-chap10

1

Microsoft PowerPoint - web-part03-ch19-node.js기본.pptx

PowerPoint Presentation

Transcription:

http://www.springcamp.io/2017/

ü ö

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface RouterFunction<T extends ServerResponse> { Mono<HandlerFunction<T>> route(serverrequest request);

@FunctionalInterface public interface HandlerFunction<T extends ServerResponse> { Mono<T> handle(serverrequest request); }

@FunctionalInterface public interface HandlerFunction<T extends ServerResponse> { Mono<T> handle(serverrequestrequest); }

@FunctionalInterface public interface HandlerFunction<T extends ServerResponse> { Mono<T> handle(serverrequestrequest); }

@FunctionalInterface public interface HandlerFunction<T extends ServerResponse> { Mono<T> handle(serverrequest request); }

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; };

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; }; Mono<T> handle(serverrequestrequest);

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; };

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; };

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; };

HandlerFunction hellohandler = req -> { String name = req.pathvariable("name"); Mono<String> result = Mono.just("Hello " + name); Mono<ServerResponse> res = ServerResponse.ok().body(result, String.class); return res; };

HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

@RestController public class MyController { @GetMapping("/hello/{name}") String hello(@pathvariable String name) { return "Hello " + name; } }

RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty();

RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty();

RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty();

RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty();

RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty(); Mono<HandlerFunction<T>> route(serverrequest request);

RouterFunction router = RouterFunctions.route(RequestPredicates.path("/hello/{name}"), req -> ServerResponse.ok().body(fromObject("Hello " + req.pathvariable("name"))));

RouterFunction router = RouterFunctions.route(RequestPredicates.path("/hello/{name}"), req -> ServerResponse.ok().body(fromObject("Hello " + req.pathvariable("name")))); RouterFunction router = req -> RequestPredicates.path("/hello/{name}").test(req)? Mono.just(helloHandler) : Mono.empty();

RouterFunction router = RouterFunctions.route(RequestPredicates.path("/hello/{name}"), req -> ServerResponse.ok().body(fromObject("Hello " + req.pathvariable("name")))); HandlerFunction hellohandler = req -> ok().body(fromobject("hello " + req.pathvariable("name")));

@Bean RouterFunction hellopathvarrouter() { return route(requestpredicates.path("/hello/{name}"), req -> ok().body(fromobject("hello " + req.pathvariable("name")))); }

HandlerFunction handler = req -> { String res = myservice.hello(req.pathvariable("name")); return ok().body(fromobject(res)); }; return route(path("/hello/{name}"), handler);

HandlerFunction handler = req -> { String res = myservice.hello(req.pathvariable("name")); return ok().body(fromobject(res)); }; return route(path("/hello/{name}"), handler);

@Component public class HelloHandler { @AutowiredMyService myservice; } Mono<ServerResponse> hello(serverrequest req) { String res = myservice.hello(req.pathvariable("name")); return ok().body(fromobject(res)); }

@Component public class HelloHandler { @AutowiredMyService myservice; Mono<ServerResponse> hello(serverrequest req) { String res = myservice.hello(req.pathvariable("name")); return ok().body(fromobject(res)); } }

@Bean RouterFunction hellorouter(@autowired HelloHandler hellohandler) { return route(path("/hello/{name}"), hellohandler::hello); }

@Bean RouterFunction hellorouter(@autowired HelloHandler hellohandler) { return route(path("/hello/{name}"), hellohandler::hello); }

@Bean RouterFunction hellorouter(@autowired HelloHandler hellohandler) { return route(path("/hello/{name}"), hellohandler::hello); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

public RouterFunction<?> routingfunction() { return nest(pathprefix("/person"), nest(accept(application_json), route(get("/{id}"), handler::getperson).androute(method(httpmethod.get), handler::listpeople) ).androute(post("/").and(contenttype(application_json)), handler::createperson)); }

@RestController public static class MyController { @RequestMapping("/hello/{name}") Mono<ServerResponse> hello(serverrequest req) { return ok().body(fromobject(req.pathvariable("name"))); }

@RestController public static class MyController { @RequestMapping("/hello/{name}") Mono<ServerResponse> hello(serverrequest req) { return ok().body(fromobject(req.pathvariable("name"))); }

@RestController public static class MyController { @RequestMapping("/hello/{name}") Mono<ServerResponse> hello(serverrequest req) { return ok().body(fromobject(req.pathvariable("name"))); }

@GetMapping("/hello/{name}") Mono<String> hello(@pathvariable String name) { return Mono.just("Hello " + name); }

@GetMapping("/hello/{name}") Mono<String> hello(@pathvariable String name) { return Mono.just("Hello " + name); }

@GetMapping("/hello/{name}") Mono<String> hello(@pathvariable String name) { return Mono.just("Hello " + name); }

@GetMapping("/hello/{name}") Mono<String> hello(@pathvariable String name) { return Mono.just("Hello " + name); }

@RequestMapping("/hello") Mono<String> hello(user user) { return Mono.just("Hello " + user.getname()); }

@RequestMapping("/hello") Mono<String> hello(user user) { return Mono.just("Hello " + user.getname()); }

@RequestMapping("/hello") Mono<String> hello(@requestbody User user) { return Mono.just("Hello " + user.getname()); }

@RequestMapping("/hello") Mono<String> hello(@requestbody User user) { return Mono.just("Hello " + user.getname()); }

@RequestMapping("/hello") Mono<String> hello(@requestbody Mono<User> user) { return user.map(u -> "Hello " + u.getname()); }

@RequestMapping("/hello") Mono<String> hello(@requestbody Mono<User> user) { return user.map(u -> "Hello " + u.getname()); }

@RequestMapping("/hello") Mono<String> hello(@requestbody Mono<User> user) { return user.map(u -> "Hello " + u.getname()); }

@PostMapping(value = "/hello") Flux<String> hello(@requestbody Flux<User> users) { return users.map(u -> "Hello " + u.getname()); }

@PostMapping(value = "/hello") Flux<String> hello(@requestbody Flux<User> users) { return users.map(u -> "Hello " + u.getname()); }

@PostMapping(value = "/hello") Flux<String> hello(@requestbody Flux<User> users) { return users.map(u -> "Hello " + u.getname()); }

@Async CompletableFuture<User> findonebyfirstname(string firstname);

@Async CompletableFuture<User> findonebyfirstname(string firstname);

@GetMapping Mono<User> finduser(string name) { return Mono.fromCompletionStage(myRepository.findOneByFirstName(name)); }

@GetMapping Mono<User> finduser(string name) { return Mono.fromCompletionStage(myRepository.findOneByFirstName(name)); }

@GetMapping Mono<User> finduser(string name) { return Mono.fromCompletionStage(myRepository.findOneByFirstName(name)); }

public interface ReactivePersonRepository extends ReactiveCrudRepository<Person, String> { Flux<Person> findbylastname(mono<string> lastname); @Query("{ 'firstname':?0, 'lastname':?1}") Mono<Person> findbyfirstnameandlastname(string firstname, String lastname); }

public interface ReactivePersonRepository extends ReactiveCrudRepository<Person, String> { Flux<Person> findbylastname(mono<string> lastname); @Query("{ 'firstname':?0, 'lastname':?1}") Mono<Person> findbyfirstnameandlastname(string firstname, String lastname); }

public interface ReactivePersonRepository extends ReactiveCrudRepository<Person, String> { Flux<Person> findbylastname(mono<string> lastname); @Query("{ 'firstname':?0, 'lastname':?1}") Mono<Person> findbyfirstnameandlastname(string firstname, String lastname); }

public interface ReactivePersonRepository extends ReactiveCrudRepository<Person, String> { Flux<Person> findbylastname(mono<string> lastname); @Query("{ 'firstname':?0, 'lastname':?1}") Mono<Person> findbyfirstnameandlastname(string firstname, String lastname); }

@AutowiredUserRepository userrepository; @GetMapping Flux<User> users() { return userrepository.findall(); }

@AutowiredUserRepository userrepository; @GetMapping Flux<User> users() { return userrepository.findall(); } Flux<T> findall();

@GetMapping Flux<String> users() { return userrepository.findall().map(u -> "Hello " + u.getname()); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

public Mono<ServerResponse> getperson(serverrequest request) { int personid = Integer.valueOf(request.pathVariable("id")); Mono<ServerResponse> notfound = ServerResponse.notFound().build(); Mono<Person> personmono = this.repository.getperson(personid); return personmono.flatmap(person -> ServerResponse.ok().contentType(APPLICATION_JSON).body(fromObject( person))).switchifempty(notfound); }

@GetMapping("/webclient") Mono<String> webclien() { return WebClient.create("http://localhost:8080").get().uri("/hello/{name}", "Spring").accept(MediaType.TEXT_PLAIN).exchange().flatMap(r -> r.bodytomono(string.class)).map(d -> d.touppercase()).flatmap(d -> hellorepository.save(d)); }

@GetMapping("/webclient") Mono<String> webclient() { WebClient wc = WebClient.create("http://localhost:8080"); UriSpec<RequestHeadersSpec<?>> urispec = wc.get(); RequestHeadersSpec<?> headerspec = urispec.uri("/hello/{name}", "Spring"); RequestHeadersSpec<?> headerspec2 = headerspec.accept(mediatype.text_plain); Mono<ClientResponse> res = headerspec2.exchange(); Mono<String> data = res.flatmap(r -> r.bodytomono(string.class)); Mono<String> upperdata = data.map(d -> d.touppercase()); return upperdata.flatmap(d -> hellorepository.save(d)); }

WebClient wc = WebClient.create("http://localhost:8080");

UriSpec<RequestHeadersSpec<?>> urispec = wc.get();

RequestHeadersSpec<?> headerspec = urispec.uri("/hello/{name}", "Spring");

RequestHeadersSpec<?> headerspec2 = headerspec.accept(mediatype.text_plain);

Mono<ClientResponse> res = headerspec2.exchange();

Mono<String> data = res.flatmap(r -> r.bodytomono(string.class));

Mono<String> upperdata = data.map(d -> d.touppercase());

return upperdata.flatmap(d -> hellorepository.save(d));

@GetMapping("/webclient") Mono<String> webclien() { return WebClient.create("http://localhost:8080").get().uri("/hello/{name}", "Spring").accept(MediaType.TEXT_PLAIN).exchange().flatMap(r -> r.bodytomono(string.class)).map(d -> d.touppercase()).flatmap(d -> hellorepository.save(d)); }