-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from study-hub-inu/feat/SH-110-mypage
Feat/sh 110 mypage
- Loading branch information
Showing
13 changed files
with
238 additions
and
33 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
.../java/kr/co/studyhubinu/studyhubserver/exception/user/UserNicknameDuplicateException.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,24 @@ | ||
package kr.co.studyhubinu.studyhubserver.exception.user; | ||
|
||
import kr.co.studyhubinu.studyhubserver.exception.StatusType; | ||
import kr.co.studyhubinu.studyhubserver.exception.common.CustomException; | ||
|
||
public class UserNicknameDuplicateException extends CustomException { | ||
private final StatusType status; | ||
private static final String message = "이미 사용중인 닉네임 입니다"; | ||
|
||
public UserNicknameDuplicateException() { | ||
super(message); | ||
this.status = StatusType.BAD_REQUEST; | ||
} | ||
|
||
@Override | ||
public StatusType getStatus() { | ||
return status; | ||
} | ||
|
||
@Override | ||
public String getMessage() { | ||
return message; | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateMajorInfo.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,17 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.data; | ||
|
||
import kr.co.studyhubinu.studyhubserver.user.enums.MajorType; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdateMajorInfo { | ||
private Long userId; | ||
private MajorType major; | ||
|
||
@Builder | ||
public UpdateMajorInfo(Long userId, MajorType major) { | ||
this.userId = userId; | ||
this.major = major; | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdateNicknameInfo.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,16 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.data; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdateNicknameInfo { | ||
private Long userId; | ||
private String nickname; | ||
|
||
@Builder | ||
public UpdateNicknameInfo(Long userId, String nickname) { | ||
this.userId = userId; | ||
this.nickname = nickname; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/data/UpdatePasswordInfo.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,18 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.data; | ||
|
||
import lombok.Builder; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdatePasswordInfo { | ||
private Long userId; | ||
private String password; | ||
private boolean auth; | ||
|
||
@Builder | ||
public UpdatePasswordInfo(Long userId, String password, boolean auth) { | ||
this.userId = userId; | ||
this.password = password; | ||
this.auth = auth; | ||
} | ||
} |
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
18 changes: 18 additions & 0 deletions
18
src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateMajorRequest.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,18 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.request; | ||
|
||
import kr.co.studyhubinu.studyhubserver.user.dto.data.UpdateMajorInfo; | ||
import kr.co.studyhubinu.studyhubserver.user.enums.MajorType; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
public class UpdateMajorRequest { | ||
|
||
private MajorType major; | ||
|
||
public UpdateMajorInfo toService(Long userId) { | ||
return UpdateMajorInfo.builder() | ||
.userId(userId) | ||
.major(major) | ||
.build(); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
src/main/java/kr/co/studyhubinu/studyhubserver/user/dto/request/UpdateNicknameRequest.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,22 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.request; | ||
|
||
import kr.co.studyhubinu.studyhubserver.user.dto.data.UpdateNicknameInfo; | ||
import lombok.Getter; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.Size; | ||
|
||
@Getter | ||
public class UpdateNicknameRequest { | ||
|
||
@NotBlank(message = "닉네임은 있어야 합니다") | ||
@Size(max = 10, message = "닉네임은 10자 이하여야 합니다") | ||
private String nickname; | ||
|
||
public UpdateNicknameInfo toService(Long userId) { | ||
return UpdateNicknameInfo.builder() | ||
.userId(userId) | ||
.nickname(nickname) | ||
.build(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
src/main/java/kr/co/studyhubinu/studyhubserver/user/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,33 @@ | ||
package kr.co.studyhubinu.studyhubserver.user.dto.request; | ||
|
||
import io.swagger.v3.oas.annotations.media.Schema; | ||
import kr.co.studyhubinu.studyhubserver.user.dto.data.UpdatePasswordInfo; | ||
import lombok.Getter; | ||
|
||
import javax.validation.constraints.NotBlank; | ||
import javax.validation.constraints.NotNull; | ||
import javax.validation.constraints.Pattern; | ||
|
||
@Getter | ||
public class UpdatePasswordRequest { | ||
|
||
@Schema(description = "유저 비밀번호", example = "asd123") | ||
@Pattern( | ||
regexp = "^(?=.*[!@#$%^&*?~_]).{10,}$", | ||
message = "비밀번호는 10자 이상이어야 하며, 하나 이상의 특수문자를 포함해야 합니다." | ||
) | ||
@NotBlank(message = "비밀번호는 입력하셔야 합니다") | ||
private String password; | ||
|
||
@Schema(description = "해당 유저가 기존 비밀번호를 확인했는지", example = "asd1242") | ||
@NotNull(message = "접근권한이 없는 유저입니다") | ||
private boolean auth; | ||
|
||
public UpdatePasswordInfo toService(Long userId) { | ||
return UpdatePasswordInfo.builder() | ||
.userId(userId) | ||
.password(password) | ||
.auth(auth) | ||
.build(); | ||
} | ||
} |
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
Oops, something went wrong.