Skip to content

Commit

Permalink
[fix] #55 로그인시 성별 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
RyuKwanKon committed Jan 21, 2024
1 parent 7d3469d commit 20fb53b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
package org.gachon.checkmate.domain.member.dto.response;

import lombok.Builder;
import org.gachon.checkmate.domain.member.entity.GenderType;

@Builder
public record MemberSignInResponseDto(
Long memberId,
String gender,
String accessToken,
String refreshToken
) {
public static MemberSignInResponseDto of(Long memberId,
GenderType genderType,
String accessToken,
String refreshToken) {
return MemberSignInResponseDto.builder()
.memberId(memberId)
.gender(genderType.getDesc())
.accessToken(accessToken)
.refreshToken(refreshToken)
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public MemberSignInResponseDto signIn(MemberSignInRequestDto memberSignInRequest
String accessToken = issueNewAccessToken(user.getId());
String refreshToken = issueNewRefreshToken(user.getId());
saveTokenInfo(user.getId(), refreshToken);
return MemberSignInResponseDto.of(user.getId(), accessToken, refreshToken);
return MemberSignInResponseDto.of(user.getId(), user.getGender(), accessToken, refreshToken);
}

public void withdraw(Long userId) {
Expand Down

0 comments on commit 20fb53b

Please sign in to comment.