From 6a4388f51397f6c3c2f840f7e1b09537f247e224 Mon Sep 17 00:00:00 2001 From: sohot8653 Date: Wed, 13 Aug 2025 15:23:59 +0900 Subject: [PATCH] =?UTF-8?q?[Swagger=20=EC=A0=81=EC=9A=A9]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/member/controller/MemberController.java | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java b/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java index 8394e2a..f2efc0b 100644 --- a/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java +++ b/src/main/java/com/bio/bio_backend/domain/user/member/controller/MemberController.java @@ -1,5 +1,6 @@ package com.bio.bio_backend.domain.user.member.controller; +import com.bio.bio_backend.global.dto.CustomApiResponse; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; @@ -16,6 +17,12 @@ import com.bio.bio_backend.domain.user.member.service.MemberService; import com.bio.bio_backend.domain.user.member.mapper.MemberMapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.responses.ApiResponse; +import io.swagger.v3.oas.annotations.responses.ApiResponses; +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.Schema; + @RestController @RequiredArgsConstructor @@ -26,6 +33,12 @@ public class MemberController { private final MemberMapper memberMapper; private final BCryptPasswordEncoder bCryptPasswordEncoder; + @Operation(summary = "회원 가입", description = "새로운 회원을 등록합니다.", tags = {"Member"}) + @ApiResponses({ + @ApiResponse(responseCode = "201", description = "회원 가입 성공", content = @Content(schema = @Schema(implementation = CreateMemberResponseDto.class))), + @ApiResponse(responseCode = "400", description = "잘못된 요청 데이터", content = @Content(schema = @Schema(implementation = CustomApiResponse.class))), + @ApiResponse(responseCode = "409", description = "중복된 사용자 정보", content = @Content(schema = @Schema(implementation = CustomApiResponse.class))) + }) @PostMapping("/members") public ResponseEntity createMember(@RequestBody @Valid CreateMemberRequestDto requestDto) { MemberDto member = memberMapper.toMemberDto(requestDto);