Skip to content

Commit

Permalink
Init: Add member controller
Browse files Browse the repository at this point in the history
createMember 컨트롤러를 생성함.
파라미터로 패스워드와 이메일 유효성 검증이 된 dto를 받음
Github issue #3
  • Loading branch information
honeyl3ee committed Oct 25, 2023
1 parent 3280d12 commit eaec1e8
Showing 1 changed file with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit eaec1e8

Please sign in to comment.