-
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.
Browse files
Browse the repository at this point in the history
[feat] 마이페이지 조회 및 로그인 로직 추가
- Loading branch information
Showing
15 changed files
with
283 additions
and
23 deletions.
There are no files selected for viewing
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
7 changes: 7 additions & 0 deletions
7
...ain/java/org/gachon/checkmate/domain/member/dto/request/MemberReissueTokenRequestDto.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,7 @@ | ||
package org.gachon.checkmate.domain.member.dto.request; | ||
|
||
public record MemberReissueTokenRequestDto( | ||
String accessToken, | ||
String refreshToken | ||
) { | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/org/gachon/checkmate/domain/member/dto/request/ProfileImgRequestDto.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,8 @@ | ||
package org.gachon.checkmate.domain.member.dto.request; | ||
|
||
import org.gachon.checkmate.domain.member.entity.ProfileImageType; | ||
|
||
public record ProfileImgRequestDto( | ||
ProfileImageType profileImageType | ||
) { | ||
} |
16 changes: 16 additions & 0 deletions
16
...n/java/org/gachon/checkmate/domain/member/dto/response/MemberReissueTokenResponseDto.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 org.gachon.checkmate.domain.member.dto.response; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record MemberReissueTokenResponseDto( | ||
String accessToken, | ||
String refreshToken | ||
) { | ||
public static MemberReissueTokenResponseDto of(String accessToken, String refreshToken){ | ||
return MemberReissueTokenResponseDto.builder() | ||
.accessToken(accessToken) | ||
.refreshToken(refreshToken) | ||
.build(); | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/org/gachon/checkmate/domain/member/dto/response/MypageResponseDto.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,26 @@ | ||
package org.gachon.checkmate.domain.member.dto.response; | ||
|
||
import lombok.Builder; | ||
|
||
@Builder | ||
public record MypageResponseDto( | ||
String profileImg, | ||
String name, | ||
String major, | ||
String gender, | ||
String mbti | ||
) { | ||
public static MypageResponseDto of(String profileImg, | ||
String name, | ||
String major, | ||
String gender, | ||
String mbti){ | ||
return MypageResponseDto.builder() | ||
.profileImg(profileImg) | ||
.name(name) | ||
.major(major) | ||
.gender(gender) | ||
.mbti(mbti) | ||
.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
25 changes: 25 additions & 0 deletions
25
src/main/java/org/gachon/checkmate/domain/member/entity/RefreshToken.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,25 @@ | ||
package org.gachon.checkmate.domain.member.entity; | ||
|
||
import lombok.AccessLevel; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.data.annotation.Id; | ||
import org.springframework.data.redis.core.RedisHash; | ||
|
||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
@Builder(access = AccessLevel.PRIVATE) | ||
@Getter | ||
@RedisHash(value = "refreshToken", timeToLive = 60*60*24*7) | ||
public class RefreshToken { | ||
@Id | ||
private Long id; | ||
private String refreshToken; | ||
|
||
public static RefreshToken createRefreshToken(Long userId, String refreshToken) { | ||
return RefreshToken.builder() | ||
.id(userId) | ||
.refreshToken(refreshToken) | ||
.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
7 changes: 7 additions & 0 deletions
7
src/main/java/org/gachon/checkmate/domain/member/repository/RefreshTokenRepository.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,7 @@ | ||
package org.gachon.checkmate.domain.member.repository; | ||
|
||
import org.gachon.checkmate.domain.member.entity.RefreshToken; | ||
import org.springframework.data.repository.CrudRepository; | ||
|
||
public interface RefreshTokenRepository extends CrudRepository<RefreshToken, Long> { | ||
} |
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.