diff --git a/src/main/kotlin/com/devooks/backend/auth/v1/domain/TokenGroup.kt b/src/main/kotlin/com/devooks/backend/auth/v1/domain/TokenGroup.kt index c869d74..aeb3808 100644 --- a/src/main/kotlin/com/devooks/backend/auth/v1/domain/TokenGroup.kt +++ b/src/main/kotlin/com/devooks/backend/auth/v1/domain/TokenGroup.kt @@ -1,9 +1,13 @@ package com.devooks.backend.auth.v1.domain +import io.swagger.v3.oas.annotations.media.Schema + typealias AccessToken = String typealias RefreshToken = String data class TokenGroup( + @Schema(description = "액세스 토큰") val accessToken: AccessToken, + @Schema(description = "리프래시 토큰") val refreshToken: RefreshToken, -) \ No newline at end of file +) diff --git a/src/main/kotlin/com/devooks/backend/category/v1/domain/Category.kt b/src/main/kotlin/com/devooks/backend/category/v1/domain/Category.kt index 55f3e1c..f9ac891 100644 --- a/src/main/kotlin/com/devooks/backend/category/v1/domain/Category.kt +++ b/src/main/kotlin/com/devooks/backend/category/v1/domain/Category.kt @@ -1,13 +1,16 @@ package com.devooks.backend.category.v1.domain import com.devooks.backend.category.v1.entity.CategoryEntity +import io.swagger.v3.oas.annotations.media.Schema import java.util.* class Category( + @Schema(description = "카테고리 식별자") val id: UUID, + @Schema(description = "카테고리 이름") val name: String, ) { companion object { fun CategoryEntity.toDomain() = Category(id = this.id!!, name = this.name) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/devooks/backend/common/dto/ImageDto.kt b/src/main/kotlin/com/devooks/backend/common/dto/ImageDto.kt index f1be90a..a5e5de4 100644 --- a/src/main/kotlin/com/devooks/backend/common/dto/ImageDto.kt +++ b/src/main/kotlin/com/devooks/backend/common/dto/ImageDto.kt @@ -6,11 +6,16 @@ import com.devooks.backend.common.domain.ImageExtension.Companion.validateImageE import com.devooks.backend.common.error.CommonError import com.devooks.backend.common.error.validateImageOrder import com.devooks.backend.common.error.validateNotBlank +import io.swagger.v3.oas.annotations.media.Schema data class ImageDto( + @Schema(description = "base64 프로필 사진", required = true, nullable = false) val base64Raw: String?, + @Schema(description = "확장자 (ex. JPG, PNG, JPEG)", required = true, nullable = false) val extension: String?, + @Schema(description = "파일 크기 (byte, 최대 50MB)", required = true, nullable = false) val byteSize: Long?, + @Schema(description = "파일 순서", required = true, nullable = false) val order: Int? ) { fun toDomain(): Image = @@ -20,4 +25,4 @@ data class ImageDto( byteSize = byteSize.validateByteSize(), order = order.validateImageOrder() ) -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/devooks/backend/common/error/CommonError.kt b/src/main/kotlin/com/devooks/backend/common/error/CommonError.kt index c635c67..3091b21 100644 --- a/src/main/kotlin/com/devooks/backend/common/error/CommonError.kt +++ b/src/main/kotlin/com/devooks/backend/common/error/CommonError.kt @@ -9,7 +9,13 @@ enum class CommonError(val exception: GeneralException) { INVALID_PAGE(GeneralException("COMMON-400-1", BAD_REQUEST, "페이지는 1부터 조회할 수 있습니다.")), INVALID_COUNT(GeneralException("COMMON-400-2", BAD_REQUEST, "개수는 1~1000 까지 조회할 수 있습니다.")), REQUIRED_BASE64RAW(GeneralException("COMMON-400-3", BAD_REQUEST, "이미지 내용이 반드시 필요합니다.")), - INVALID_IMAGE_EXTENSION(GeneralException("COMMON-400-4", BAD_REQUEST, "유효하지 않은 이미지 확장자입니다.")), + INVALID_IMAGE_EXTENSION( + GeneralException( + "COMMON-400-4", + BAD_REQUEST, + "유효하지 않은 이미지 확장자입니다. JPG, PNG, JPEG만 가능합니다." + ) + ), INVALID_BYTE_SIZE(GeneralException("COMMON-400-5", BAD_REQUEST, "50MB 이하의 영상만 저장이 가능합니다.")), REQUIRED_IMAGE(GeneralException("COMMON-400-6", BAD_REQUEST, "이미지가 반드시 필요합니다.")), INVALID_IMAGE_ORDER(GeneralException("COMMON-400-7", BAD_REQUEST, "유효하지 않은 이미지 순서입니다.")), @@ -23,4 +29,4 @@ enum class CommonError(val exception: GeneralException) { override fun toString(): String { return "CommonError(exception=$exception)" } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberController.kt b/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberController.kt index 46c50b0..62c3590 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberController.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberController.kt @@ -27,11 +27,6 @@ import com.devooks.backend.member.v1.dto.WithdrawMemberResponse import com.devooks.backend.member.v1.service.FavoriteCategoryService import com.devooks.backend.member.v1.service.MemberInfoService import com.devooks.backend.member.v1.service.MemberService -import io.swagger.v3.oas.annotations.Operation -import io.swagger.v3.oas.annotations.media.Content -import io.swagger.v3.oas.annotations.media.Schema -import io.swagger.v3.oas.annotations.responses.ApiResponse -import io.swagger.v3.oas.annotations.responses.ApiResponses import io.swagger.v3.oas.annotations.tags.Tag import java.util.* import org.springframework.http.HttpHeaders.AUTHORIZATION @@ -54,38 +49,11 @@ class MemberController( private val categoryService: CategoryService, private val favoriteCategoryService: FavoriteCategoryService, private val tokenService: TokenService, -) { +): MemberControllerDocs { - @Operation(summary = "회원가입") - @ApiResponses( - value = [ - ApiResponse(responseCode = "200", description = "OK"), - ApiResponse( - responseCode = "400", - description = - "- AUTH-400-1 : 인증 코드(authorizationCode)가 NULL이거나 빈 문자일 경우\n" + - "- AUTH-400-2 : 인증 유형(oauthType)이 NAVER, KAKAO, GOOGLE 이 아닐 경우\n" + - "- MEMBER-400-1 : 닉네임(nickname)이 2~12 글자가 아닐 경우\n" + - "- MEMBER-400-2 : 관심 카테고리(favoriteCategories)가 NULL일 경우", - content = arrayOf(Content(schema = Schema(hidden = true))) - ), - ApiResponse( - responseCode = "403", - description = - "- MEMBER-403-1 : 정지된 회원일 경우\n" + - "- MEMBER-403-2 : 탈퇴한 회원일 경우", - content = arrayOf(Content(schema = Schema(hidden = true))) - ), - ApiResponse( - responseCode = "409", - description = "- MEMBER-409-1 : 닉네임이 이미 존재할 경우", - content = arrayOf(Content(schema = Schema(hidden = true))) - ) - ] - ) @Transactional @PostMapping("/signup") - suspend fun signUp( + override suspend fun signUp( @RequestBody request: SignUpRequest, ): SignUpResponse { @@ -103,7 +71,7 @@ class MemberController( @Transactional @PatchMapping("/account") - suspend fun modifyAccountInfo( + override suspend fun modifyAccountInfo( @RequestBody request: ModifyAccountInfoRequest, @RequestHeader(AUTHORIZATION) @@ -117,7 +85,7 @@ class MemberController( @Transactional @PatchMapping("/image") - suspend fun modifyProfileImage( + override suspend fun modifyProfileImage( @RequestBody request: ModifyProfileImageRequest, @RequestHeader(AUTHORIZATION) @@ -131,7 +99,7 @@ class MemberController( @Transactional @PatchMapping("/nickname") - suspend fun modifyNickname( + override suspend fun modifyNickname( @RequestBody request: ModifyNicknameRequest, @RequestHeader(AUTHORIZATION) @@ -145,7 +113,7 @@ class MemberController( @Transactional @PatchMapping("/profile") - suspend fun modifyProfile( + override suspend fun modifyProfile( @RequestBody request: ModifyProfileRequest, @RequestHeader(AUTHORIZATION) @@ -163,8 +131,8 @@ class MemberController( } @GetMapping("/{memberId}/profile") - suspend fun getProfile( - @PathVariable + override suspend fun getProfile( + @PathVariable(required = true) memberId: UUID, ): GetProfileResponse { val member: Member = memberService.findById(memberId) @@ -175,7 +143,7 @@ class MemberController( @Transactional @PatchMapping("/withdrawal") - suspend fun withdrawMember( + override suspend fun withdrawMember( @RequestBody request: WithdrawMemberRequest, @RequestHeader(AUTHORIZATION) diff --git a/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberControllerDocs.kt b/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberControllerDocs.kt new file mode 100644 index 0000000..9469f6f --- /dev/null +++ b/src/main/kotlin/com/devooks/backend/member/v1/controller/MemberControllerDocs.kt @@ -0,0 +1,372 @@ +package com.devooks.backend.member.v1.controller + +import com.devooks.backend.common.exception.ErrorResponse +import com.devooks.backend.member.v1.dto.GetProfileResponse +import com.devooks.backend.member.v1.dto.ModifyAccountInfoRequest +import com.devooks.backend.member.v1.dto.ModifyAccountInfoResponse +import com.devooks.backend.member.v1.dto.ModifyNicknameRequest +import com.devooks.backend.member.v1.dto.ModifyNicknameResponse +import com.devooks.backend.member.v1.dto.ModifyProfileImageRequest +import com.devooks.backend.member.v1.dto.ModifyProfileImageResponse +import com.devooks.backend.member.v1.dto.ModifyProfileRequest +import com.devooks.backend.member.v1.dto.ModifyProfileResponse +import com.devooks.backend.member.v1.dto.SignUpRequest +import com.devooks.backend.member.v1.dto.SignUpResponse +import com.devooks.backend.member.v1.dto.WithdrawMemberRequest +import com.devooks.backend.member.v1.dto.WithdrawMemberResponse +import io.swagger.v3.oas.annotations.Operation +import io.swagger.v3.oas.annotations.media.Content +import io.swagger.v3.oas.annotations.media.Schema +import io.swagger.v3.oas.annotations.responses.ApiResponse +import io.swagger.v3.oas.annotations.responses.ApiResponses +import java.util.* +import org.springframework.http.MediaType.APPLICATION_JSON_VALUE + +interface MemberControllerDocs { + + @Operation(summary = "회원가입") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = SignUpResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- AUTH-400-1 : 인증 코드(authorizationCode)가 NULL이거나 빈 문자일 경우\n" + + "- AUTH-400-2 : 인증 유형(oauthType)이 NAVER, KAKAO, GOOGLE 이 아닐 경우\n" + + "- MEMBER-400-1 : 닉네임(nickname)이 2~12 글자가 아닐 경우\n" + + "- MEMBER-400-2 : 관심 카테고리(favoriteCategories)가 NULL일 경우", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "403", + description = + "- MEMBER-403-1 : 정지된 회원일 경우\n" + + "- MEMBER-403-2 : 탈퇴한 회원일 경우", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "409", + description = "- MEMBER-409-1 : 닉네임이 이미 존재할 경우", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ) + ] + ) + suspend fun signUp( + request: SignUpRequest, + ): SignUpResponse + + @Operation(summary = "계좌 정보 수정") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ModifyAccountInfoResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- MEMBER-400-4 : 이름이 반드시 필요합니다.\n" + + "- MEMBER-400-5 : 은행이 반드시 필요합니다.\n" + + "- MEMBER-400-6 : 계좌번호가 반드시 필요합니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-2 : 회원 정보를 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ) + ] + ) + suspend fun modifyAccountInfo( + request: ModifyAccountInfoRequest, + @Schema(description = "액세스 토큰", required = true, nullable = false) + authorization: String, + ): ModifyAccountInfoResponse + + @Operation(summary = "프로필 사진 수정") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ModifyProfileResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- COMMON-400-3 : 이미지 내용이 반드시 필요합니다.\n" + + "- COMMON-400-4 : 유효하지 않은 이미지 확장자입니다. JPG, PNG, JPEG만 가능합니다.\n" + + "- COMMON-400-5 : 50MB 이하의 영상만 저장이 가능합니다.\n" + + "- COMMON-400-6 : 이미지가 반드시 필요합니다.\n" + + "- COMMON-400-7 : 유효하지 않은 이미지 순서입니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-3 : 회원을 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "500", + description = + "- COMMON-500-2 : 파일 저장을 실패했습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ] + ) + suspend fun modifyProfileImage( + request: ModifyProfileImageRequest, + @Schema(description = "액세스 토큰", required = true, nullable = false) + authorization: String, + ): ModifyProfileImageResponse + + @Operation(summary = "닉네임 수정") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ModifyNicknameResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- MEMBER-400-1 : 닉네임이 반드시 필요합니다.\n" + + "- MEMBER-400-3 : 닉네임은 2자 이상 12자 이하만 가능합니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-3 : 회원을 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "409", + description = + "- MEMBER-409-1 : 닉네임이 이미 존재합니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ] + ) + suspend fun modifyNickname( + request: ModifyNicknameRequest, + @Schema(description = "액세스 토큰", required = true, nullable = false) + authorization: String, + ): ModifyNicknameResponse + + @Operation(summary = "프로필 수정") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ModifyNicknameResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- MEMBER-400-8 : 전화번호 형식(ex. 010-1234-1234)이 아닐 경우\n" + + "- MEMBER-400-9 : 블로그 링크가 null이 아니여 비어있을 경우\n" + + "- MEMBER-400-10 : 인스타그램 링크가 null이 아니여 비어있을 경우\n" + + "- MEMBER-400-2 : 관심 카테고리 목록이 null이 아니여 비어있을 경우\n" + + "- MEMBER-400-16 : 이메일이 null이 아니며 이메일 형식이 아닐 경우", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-2 : 회원 정보를 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ] + ) + suspend fun modifyProfile( + request: ModifyProfileRequest, + @Schema(description = "액세스 토큰", required = true, nullable = false) + authorization: String, + ): ModifyProfileResponse + + @Operation(summary = "프로필 조회") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = GetProfileResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- 회원 식별자가 UUID가 아닐 경우\n" + + "- 회원 식별자가 존재하지 않을 경우", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-2 : 회원 정보를 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ] + ) + suspend fun getProfile( + @Schema(description = "회원 식별자", required = true, nullable = false) + memberId: UUID, + ): GetProfileResponse + + @Operation(summary = "회원 탈퇴") + @ApiResponses( + value = [ + ApiResponse( + responseCode = "200", + description = "OK", + content = [ + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = WithdrawMemberResponse::class) + ) + ] + ), + ApiResponse( + responseCode = "400", + description = + "- MEMBER-400-14 : 탈퇴 이유가 반드시 필요합니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ApiResponse( + responseCode = "404", + description = + "- MEMBER-404-3 : 회원을 찾을 수 없습니다.", + content = arrayOf( + Content( + mediaType = APPLICATION_JSON_VALUE, + schema = Schema(implementation = ErrorResponse::class) + ) + ) + ), + ] + ) + suspend fun withdrawMember( + request: WithdrawMemberRequest, + @Schema(description = "액세스 토큰", required = true, nullable = false) + authorization: String, + ): WithdrawMemberResponse +} diff --git a/src/main/kotlin/com/devooks/backend/member/v1/domain/Member.kt b/src/main/kotlin/com/devooks/backend/member/v1/domain/Member.kt index 672accc..f101be9 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/domain/Member.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/domain/Member.kt @@ -2,12 +2,17 @@ package com.devooks.backend.member.v1.domain import com.devooks.backend.auth.v1.domain.Authority import com.devooks.backend.member.v1.entity.MemberEntity +import io.swagger.v3.oas.annotations.media.Schema import java.util.* class Member( + @Schema(description = "회원 식별자") val id: UUID, + @Schema(description = "닉네임") val nickname: String, + @Schema(description = "프로필 사진 경로") val profileImagePath: String, + @Schema(description = "권한 (ex. USER, ADMIN)") val authority: Authority, ) { companion object { @@ -19,4 +24,4 @@ class Member( authority = this.authority ) } -} \ No newline at end of file +} diff --git a/src/main/kotlin/com/devooks/backend/member/v1/domain/MemberInfo.kt b/src/main/kotlin/com/devooks/backend/member/v1/domain/MemberInfo.kt index c091d1e..9e604a1 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/domain/MemberInfo.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/domain/MemberInfo.kt @@ -1,19 +1,31 @@ package com.devooks.backend.member.v1.domain import com.devooks.backend.member.v1.entity.MemberInfoEntity +import io.swagger.v3.oas.annotations.media.Schema import java.util.* class MemberInfo( + @Schema(description = "회원 정보 식별자") val id: UUID, + @Schema(description = "회원 식별자") val memberId: UUID, + @Schema(description = "블로그 링크") val blogLink: String, + @Schema(description = "인스타그램 링크") val instagramLink: String, + @Schema(description = "유튜브 링크") val youtubeLink: String, + @Schema(description = "수취인 이름") val realName: String, + @Schema(description = "은행명") val bank: String, + @Schema(description = "계좌번호") val accountNumber: String, + @Schema(description = "소개글") val introduction: String, + @Schema(description = "전화번호") val phoneNumber: String, + @Schema(description = "이메일") val email: String, ) { companion object { diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/GetProfileResponse.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/GetProfileResponse.kt index 0806950..dcc9305 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/GetProfileResponse.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/GetProfileResponse.kt @@ -5,11 +5,15 @@ import com.devooks.backend.category.v1.dto.CategoryDto import com.devooks.backend.category.v1.dto.CategoryDto.Companion.toDto import com.devooks.backend.member.v1.domain.Member import com.devooks.backend.member.v1.domain.MemberInfo +import io.swagger.v3.oas.annotations.media.Schema import java.util.* data class GetProfileResponse( + @Schema(description = "회원 식별자") val memberId: UUID, + @Schema(description = "닉네임") val nickname: String, + @Schema(description = "프로필 사진 경로") val profileImagePath: String, val profile: Profile, val favoriteCategories: List, @@ -33,9 +37,13 @@ data class GetProfileResponse( ) data class Profile( + @Schema(description = "블로그 링크") val blogLink: String, + @Schema(description = "인스타그램 링크") val instagramLink: String, + @Schema(description = "유튜브 링크") val youtubeLink: String, + @Schema(description = "소개글") val introduction: String, ) } diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoRequest.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoRequest.kt index 58b2adc..d34b69a 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoRequest.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoRequest.kt @@ -3,10 +3,14 @@ package com.devooks.backend.member.v1.dto import com.devooks.backend.member.v1.error.validateAccountNumber import com.devooks.backend.member.v1.error.validateBank import com.devooks.backend.member.v1.error.validateRealName +import io.swagger.v3.oas.annotations.media.Schema data class ModifyAccountInfoRequest( + @Schema(description = "수취인 이름", required = true, nullable = false) val realName: String?, + @Schema(description = "은행 이름", required = true, nullable = false) val bank: String?, + @Schema(description = "계좌 번호", required = true, nullable = false) val accountNumber: String?, ) { diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoResponse.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoResponse.kt index 6821945..cd65634 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoResponse.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyAccountInfoResponse.kt @@ -1,10 +1,14 @@ package com.devooks.backend.member.v1.dto import com.devooks.backend.member.v1.domain.MemberInfo +import io.swagger.v3.oas.annotations.media.Schema data class ModifyAccountInfoResponse( + @Schema(description = "수취인 이름") val realName: String, + @Schema(description = "은행 이름") val bank: String, + @Schema(description = "계좌 번호") val accountNumber: String, ) { diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyNicknameRequest.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyNicknameRequest.kt index 2a1f6fb..ee7d129 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyNicknameRequest.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyNicknameRequest.kt @@ -1,8 +1,10 @@ package com.devooks.backend.member.v1.dto import com.devooks.backend.member.v1.error.validateNickname +import io.swagger.v3.oas.annotations.media.Schema data class ModifyNicknameRequest( + @Schema(description = "닉네임", required = true, nullable = false) val nickname: String? ) { fun toCommand(): ModifyNicknameCommand = diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyProfileRequest.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyProfileRequest.kt index 8e3c63e..f5fa04f 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyProfileRequest.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/ModifyProfileRequest.kt @@ -7,14 +7,22 @@ import com.devooks.backend.member.v1.error.validateInstagramLink import com.devooks.backend.member.v1.error.validateIntroduction import com.devooks.backend.member.v1.error.validatePhoneNumber import com.devooks.backend.member.v1.error.validateYoutubeLink +import io.swagger.v3.oas.annotations.media.Schema data class ModifyProfileRequest( + @Schema(description = "전화번호 (ex. 010-1234-1234)", required = false, nullable = true) val phoneNumber: String?, + @Schema(description = "블로그 링크", required = false, nullable = true) val blogLink: String?, + @Schema(description = "인스타그램 링크", required = false, nullable = true) val instagramLink: String?, + @Schema(description = "유튜브 링크", required = false, nullable = true) val youtubeLink: String?, + @Schema(description = "소개글", required = false, nullable = true) val introduction: String?, + @Schema(description = "관심 카테고리 식별자 목록", required = false, nullable = true) val favoriteCategoryIdList: List?, + @Schema(description = "이메일", required = false, nullable = true) val email: String?, ) { fun toCommand(): ModifyProfileCommand = diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpRequest.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpRequest.kt index a716b2b..a4df3b4 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpRequest.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpRequest.kt @@ -9,7 +9,12 @@ import io.swagger.v3.oas.annotations.media.Schema data class SignUpRequest( @Schema(description = "OAuth2 식별자", required = true, nullable = false) val oauthId: String?, - @Schema(description = "OAuth2 인증 유형", required = true, nullable = false, example = "NAVER") + @Schema( + description = "OAuth2 인증 유형 (ex. NAVER, KAKAO, GOOGLE)", + required = true, + nullable = false, + example = "NAVER" + ) val oauthType: String?, @Schema(description = "닉네임", required = true, nullable = false) val nickname: String?, diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpResponse.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpResponse.kt index bb9ca26..86e0b0f 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpResponse.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/SignUpResponse.kt @@ -2,6 +2,7 @@ package com.devooks.backend.member.v1.dto import com.devooks.backend.auth.v1.domain.Authority import com.devooks.backend.auth.v1.domain.TokenGroup +import io.swagger.v3.oas.annotations.media.Schema import java.util.* data class SignUpResponse( @@ -9,9 +10,13 @@ data class SignUpResponse( val tokenGroup: TokenGroup, ) { data class Member( + @Schema(description = "회원 식별자") val id: UUID, + @Schema(description = "닉네임") val nickname: String, + @Schema(description = "프로필 사진 경로") val profileImagePath: String, + @Schema(description = "권한 (ex. USER, ADMIN)") val authority: Authority, ) { constructor( diff --git a/src/main/kotlin/com/devooks/backend/member/v1/dto/WithdrawMemberResponse.kt b/src/main/kotlin/com/devooks/backend/member/v1/dto/WithdrawMemberResponse.kt index 28a82b3..df00936 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/dto/WithdrawMemberResponse.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/dto/WithdrawMemberResponse.kt @@ -1,5 +1,8 @@ package com.devooks.backend.member.v1.dto +import io.swagger.v3.oas.annotations.media.Schema + data class WithdrawMemberResponse( - val message: String = "탈퇴가 완료됐습니다." + @Schema(description = "결과 메시지", example = "탈퇴가 완료됐습니다.") + val message: String = "탈퇴가 완료됐습니다.", ) diff --git a/src/main/kotlin/com/devooks/backend/member/v1/service/FavoriteCategoryService.kt b/src/main/kotlin/com/devooks/backend/member/v1/service/FavoriteCategoryService.kt index 9f2643c..ac5598c 100644 --- a/src/main/kotlin/com/devooks/backend/member/v1/service/FavoriteCategoryService.kt +++ b/src/main/kotlin/com/devooks/backend/member/v1/service/FavoriteCategoryService.kt @@ -21,7 +21,7 @@ class FavoriteCategoryService( categories .asFlow() .map { FavoriteCategoryEntity(favoriteMemberId = memberId, categoryId = it.id) } - .map { favoriteCategoryRepository.save(it) } + .let { favoriteCategoryRepository.saveAll(it) } .map { it.toDomain() } .toList() @@ -34,4 +34,4 @@ class FavoriteCategoryService( .findAllByFavoriteMemberId(memberId) .map { it.toDomain() } -} \ No newline at end of file +}