-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
회원 프로필 조회/수정 및 비밀번호 수정 api 스웨거 설정
- Loading branch information
Showing
24 changed files
with
293 additions
and
46 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/main/java/sixgaezzang/sidepeek/common/exception/message/CommonErrorMessage.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package sixgaezzang.sidepeek.common.exception.message; | ||
|
||
import static sixgaezzang.sidepeek.common.util.CommonConstant.MAX_TEXT_LENGTH; | ||
|
||
public class CommonErrorMessage { | ||
// Github url | ||
public static final String GITHUB_URL_IS_INVALID = "Github URL 형식이 유효하지 않습니다."; | ||
public static final String GITHUB_URL_IS_NULL = "Github URL을 입력해주세요."; | ||
public static final String GITHUB_URL_OVER_MAX_LENGTH = "Github URL은 " + MAX_TEXT_LENGTH + "자 이하여야 합니다."; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/sixgaezzang/sidepeek/projects/dto/request/ProjectRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
src/main/java/sixgaezzang/sidepeek/users/dto/request/CheckNicknameRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/sixgaezzang/sidepeek/users/dto/request/UpdatePasswordRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package sixgaezzang.sidepeek.users.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.Pattern; | ||
import sixgaezzang.sidepeek.users.domain.Password; | ||
|
||
@Schema(description = "비밀번호 수정 요청 정보") | ||
public record UpdatePasswordRequest( | ||
@Schema(description = "기존 비밀번호", example = "sidepeek6!") | ||
@NotBlank(message = "기존 비밀번호를 입력해주세요.") | ||
@Pattern(regexp = Password.PASSWORD_REGXP, message = "비밀번호는 8자 이상이며 영문, 숫자, 특수문자를 포함해야 합니다.") | ||
String originalPassword, | ||
|
||
@Schema(description = "새로운 비밀번호", example = "sidepeek678!") | ||
@NotBlank(message = "새로운 비밀번호를 입력해주세요.") | ||
@Pattern(regexp = Password.PASSWORD_REGXP, message = "비밀번호는 8자 이상이며 영문, 숫자, 특수문자를 포함해야 합니다.") | ||
String password | ||
) { | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/sixgaezzang/sidepeek/users/dto/request/UpdateUserProfileRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package sixgaezzang.sidepeek.users.dto.request; | ||
|
||
import static sixgaezzang.sidepeek.common.exception.message.CommonErrorMessage.GITHUB_URL_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.common.util.CommonConstant.MAX_TEXT_LENGTH; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.BLOG_URL_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.CAREER_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.INTRODUCTION_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.JOB_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.NICKNAME_IS_NULL; | ||
import static sixgaezzang.sidepeek.users.exception.message.UserErrorMessage.NICKNAME_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.users.util.UserConstant.MAX_CAREER_LENGTH; | ||
import static sixgaezzang.sidepeek.users.util.UserConstant.MAX_INTRODUCTION_LENGTH; | ||
import static sixgaezzang.sidepeek.users.util.UserConstant.MAX_JOB_LENGTH; | ||
import static sixgaezzang.sidepeek.users.util.UserConstant.MAX_NICKNAME_LENGTH; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
import java.util.List; | ||
|
||
@Schema(description = "회원 프로필 수정 요청 정보") | ||
public record UpdateUserProfileRequest( | ||
@Schema(description = "회원 닉네임", example = "의진") | ||
@NotNull(message = NICKNAME_IS_NULL) | ||
@Size(max = MAX_NICKNAME_LENGTH, message = NICKNAME_OVER_MAX_LENGTH) | ||
String nickname, | ||
|
||
@Schema(description = "회원 프로필 이미지 URL", example = "https://sidepeek.image/profile1") | ||
@Size(max = MAX_TEXT_LENGTH, message = "") | ||
String profileImageUrl, | ||
|
||
@Schema(description = "회원 소개", example = "전 최고의 백엔드 개발자입니다.") | ||
@Size(max = MAX_INTRODUCTION_LENGTH, message = INTRODUCTION_OVER_MAX_LENGTH) | ||
String introduction, | ||
|
||
@Schema(description = "회원 직업", example = "백엔드 개발자") | ||
@Size(max = MAX_JOB_LENGTH, message = JOB_OVER_MAX_LENGTH) | ||
String job, | ||
|
||
@Schema(description = "회원 경력", example = "1-3년차") | ||
@Size(max = MAX_CAREER_LENGTH, message = CAREER_OVER_MAX_LENGTH) | ||
String career, | ||
|
||
@Schema(description = "회원 깃허브 URL", example = "https://github.com") | ||
@Size(max = MAX_TEXT_LENGTH, message = GITHUB_URL_OVER_MAX_LENGTH) | ||
String githubUrl, | ||
|
||
@Schema(description = "회원 블로그 URL", example = "https://medium.com") | ||
@Size(max = MAX_TEXT_LENGTH, message = BLOG_URL_OVER_MAX_LENGTH) | ||
String blogUrl, | ||
|
||
@Schema(description = "회원 기술 스택 목록") | ||
List<UpdateUserSkillRequest> techStacks | ||
) { | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/sixgaezzang/sidepeek/users/dto/request/UpdateUserSkillRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package sixgaezzang.sidepeek.users.dto.request; | ||
|
||
import static sixgaezzang.sidepeek.common.util.CommonConstant.MIN_ID; | ||
import static sixgaezzang.sidepeek.projects.util.ProjectConstant.MAX_CATEGORY_LENGTH; | ||
import static sixgaezzang.sidepeek.skill.util.validation.SkillErrorMessage.CATEGORY_IS_NULL; | ||
import static sixgaezzang.sidepeek.skill.util.validation.SkillErrorMessage.CATEGORY_OVER_MAX_LENGTH; | ||
import static sixgaezzang.sidepeek.skill.util.validation.SkillErrorMessage.SKILL_ID_IS_NULL; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import jakarta.validation.constraints.Min; | ||
import jakarta.validation.constraints.NotBlank; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Size; | ||
|
||
@Schema(description = "회원 수정 요청 내 회원 기술 스택 정보") | ||
public record UpdateUserSkillRequest( | ||
@Schema(description = "기술 스택 Id", example = "1") | ||
@Min(value = MIN_ID, message = "스킬 id는 " + MIN_ID + "보다 작을 수 없습니다.") | ||
@NotNull(message = SKILL_ID_IS_NULL) | ||
Long skillId, | ||
|
||
@Schema(description = "기술 스택 카테고리", example = "프론트엔드") | ||
@Size(max = MAX_CATEGORY_LENGTH, message = CATEGORY_OVER_MAX_LENGTH) | ||
@NotBlank(message = CATEGORY_IS_NULL) | ||
String category | ||
) { | ||
} |
Oops, something went wrong.