Skip to content

Commit

Permalink
[#51] Member에 Swagger 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
ggamD00 committed Mar 29, 2024
1 parent 8fa0000 commit e5939cd
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package com.example.memetory.domain.member.controller;

import com.example.memetory.domain.member.dto.MemberSignUpRequest;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.responses.ApiResponse;
import io.swagger.v3.oas.annotations.responses.ApiResponses;
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;

@Tag(name = "Member")
public interface MemberApi {

@Operation(
summary = "회원가입",
description = "첫 소셜로그인 후 추가 정보 기입",
security = {@SecurityRequirement(name = "access_token")}
)
@ApiResponses(value = {
@ApiResponse(
responseCode = "200",
description = "회원가입 성공!"
)
})
ResponseEntity<HttpStatus> register(
MemberSignUpRequest memberSignUpRequest,
@Parameter(hidden = true) String email
);
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

import com.example.memetory.domain.member.dto.MemberServiceDto;
import com.example.memetory.domain.member.dto.MemberSignUpRequest;
import com.example.memetory.domain.member.entity.Member;
import com.example.memetory.domain.member.service.MemberService;
import com.example.memetory.global.annotation.LoginMemberEmail;

import lombok.RequiredArgsConstructor;

@RestController
@RequiredArgsConstructor
public class MemberController {
public class MemberController implements MemberApi {

private final MemberService memberService;
private final MemberService memberService;

@PostMapping("/sign-up")
public ResponseEntity<HttpStatus> register(@RequestBody MemberSignUpRequest memberSignUpRequest,
@LoginMemberEmail String email) {
MemberServiceDto memberServiceDto = memberSignUpRequest.toServiceDto(email);
@PostMapping("/sign-up")
@Override
public ResponseEntity<HttpStatus> register(@RequestBody MemberSignUpRequest memberSignUpRequest,
@LoginMemberEmail String email) {
MemberServiceDto memberServiceDto = memberSignUpRequest.toServiceDto(email);

memberService.register(memberServiceDto);
memberService.register(memberServiceDto);

return ResponseEntity.status(HttpStatus.OK).build();
}
return ResponseEntity.status(HttpStatus.OK).build();
}
}

0 comments on commit e5939cd

Please sign in to comment.