From eaec1e82691981c75bd35710088c6157a6555bc8 Mon Sep 17 00:00:00 2001 From: Danbi Date: Wed, 25 Oct 2023 19:44:06 +0900 Subject: [PATCH] Init: Add member controller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit createMember 컨트롤러를 생성함. 파라미터로 패스워드와 이메일 유효성 검증이 된 dto를 받음 Github issue #3 --- .../member/controller/MemberController.java | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/main/java/beforespring/socialfeed/member/controller/MemberController.java b/src/main/java/beforespring/socialfeed/member/controller/MemberController.java index 50f2235..c9c1718 100644 --- a/src/main/java/beforespring/socialfeed/member/controller/MemberController.java +++ b/src/main/java/beforespring/socialfeed/member/controller/MemberController.java @@ -1,2 +1,24 @@ -package beforespring.socialfeed.member.controller;public class MemberController { +package beforespring.socialfeed.member.controller; + +import beforespring.socialfeed.member.controller.dto.CreateMemberDto; +import beforespring.socialfeed.member.service.MemberService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +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 javax.validation.Valid; + +@RestController +@RequiredArgsConstructor +public class MemberController { + + private final MemberService memberService; + @PostMapping("/api/member/new") + public CreateMemberDto.Response createMember(@RequestBody @Valid CreateMemberDto.Request request) { + Long requestId = memberService.join(request); + return new CreateMemberDto.Response(requestId); + } }