From 415dc70f322a2bbad07b64ff2081e5800f1a1d39 Mon Sep 17 00:00:00 2001 From: Hyunmin Choi Date: Tue, 15 Oct 2024 21:09:49 +0900 Subject: [PATCH] =?UTF-8?q?[FEATURE]=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20API=20=EC=8A=A4=ED=8E=99=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD=20(#87)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit feat: 로그인 관련 API 스펙 변경 (#86) --- .../smunity/server/domain/account/dto/LoginResponseDto.java | 5 ++++- .../server/domain/account/service/AccountService.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/smunity/server/domain/account/dto/LoginResponseDto.java b/src/main/java/com/smunity/server/domain/account/dto/LoginResponseDto.java index d47a2eb..b613abc 100644 --- a/src/main/java/com/smunity/server/domain/account/dto/LoginResponseDto.java +++ b/src/main/java/com/smunity/server/domain/account/dto/LoginResponseDto.java @@ -1,17 +1,20 @@ package com.smunity.server.domain.account.dto; +import com.smunity.server.global.common.entity.enums.MemberRole; import lombok.Builder; @Builder public record LoginResponseDto( Long memberId, + MemberRole memberRole, String accessToken, String refreshToken ) { - public static LoginResponseDto of(Long memberId, String accessToken, String refreshToken) { + public static LoginResponseDto of(Long memberId, MemberRole memberRole, String accessToken, String refreshToken) { return LoginResponseDto.builder() .memberId(memberId) + .memberRole(memberRole) .accessToken(accessToken) .refreshToken(refreshToken) .build(); diff --git a/src/main/java/com/smunity/server/domain/account/service/AccountService.java b/src/main/java/com/smunity/server/domain/account/service/AccountService.java index b0260b8..4c9a53c 100644 --- a/src/main/java/com/smunity/server/domain/account/service/AccountService.java +++ b/src/main/java/com/smunity/server/domain/account/service/AccountService.java @@ -61,7 +61,7 @@ private LoginResponseDto generateToken(Long memberId, MemberRole memberRole) { String accessToken = jwtTokenProvider.createAccessToken(memberId, memberRole, false); String refreshToken = jwtTokenProvider.createAccessToken(memberId, memberRole, true); refreshTokenService.saveRefreshToken(memberId, refreshToken); - return LoginResponseDto.of(memberId, accessToken, refreshToken); + return LoginResponseDto.of(memberId, memberRole, accessToken, refreshToken); } private void validateUsername(String username) {