Skip to content

Commit

Permalink
[refactor] #5 컨트롤러 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
seokjun01 committed Jan 3, 2025
1 parent c91b96a commit 4a7cb27
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@
import com.example.eatmate.app.domain.member.service.MemberService;
import com.example.eatmate.global.response.GlobalResponseDto;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.servlet.http.Cookie;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.annotation.AuthenticationPrincipal;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;

Expand All @@ -19,13 +22,11 @@ public class AuthController {
private final MemberService memberService;

//회원가입
@PostMapping("/register")
@PostMapping("/signup") //매핑 경로 수정
@Operation(summary = "회원가입", description = "회원가입을 합니다.")
public ResponseEntity<GlobalResponseDto<String>> register(@RequestBody MemberSignUpRequestDto memberSignUpRequestDto) {
public ResponseEntity<GlobalResponseDto<Void>> register(@RequestBody MemberSignUpRequestDto memberSignUpRequestDto, @AuthenticationPrincipal UserDetails userDetails) {

memberService.completeRegistration(memberSignUpRequestDto);

return ResponseEntity.status(HttpStatus.CREATED).body(GlobalResponseDto.success(memberService.register(memberSignUpRequestDto) , HttpStatus.CREATED.value()));
return ResponseEntity.status(HttpStatus.CREATED).body(GlobalResponseDto.success(memberService.completeRegistration(memberSignUpRequestDto, userDetails) , HttpStatus.CREATED.value()));
}


Expand Down

0 comments on commit 4a7cb27

Please sign in to comment.