2222import lombok .NoArgsConstructor ;
2323import lombok .Setter ;
2424
25+ import static com .nextroom .nextRoomServer .util .Timestamped .dateTimeFormatter ;
26+
2527public class AuthDto {
2628 private static final String ADMIN_CODE_REGEX = "[0-9]{5}" ;
2729 private static final String PASSWORD_CONDITION_MIN_LENGTH_REGEX = ".{8,}" ;
@@ -77,6 +79,15 @@ public static class SignUpResponseDto {
7779 private String adminCode ;
7880 private String createdAt ;
7981 private String modifiedAt ;
82+
83+ public static AuthDto .SignUpResponseDto toSignUpResponseDto (Shop shop ) {
84+ return SignUpResponseDto .builder ()
85+ .email (shop .getEmail ())
86+ .name (shop .getName ())
87+ .adminCode (shop .getAdminCode ())
88+ .createdAt (dateTimeFormatter (shop .getCreatedAt ()))
89+ .modifiedAt (dateTimeFormatter (shop .getModifiedAt ())).build ();
90+ }
8091 }
8192
8293 @ Getter
@@ -108,16 +119,13 @@ public static class LogInResponseDto {
108119 private long accessTokenExpiresIn ;
109120 private String refreshToken ;
110121
111- private String email ;
112- private String googleSub ;
113-
122+ private Long shopId ;
114123 private Boolean isComplete ;
115124
116125 public static AuthDto .LogInResponseDto toLogInResponseDto (Shop shop , TokenDto tokenDto ) {
117- return new LogInResponseDtoBuilder ()
126+ return LogInResponseDto . builder ()
118127 .isComplete (true )
119- .email (shop .getEmail ())
120- .googleSub (shop .getGoogleSub ())
128+ .shopId (shop .getId ())
121129 .shopName (shop .getName ())
122130 .adminCode (shop .getAdminCode ())
123131 .grantType (tokenDto .getGrantType ())
@@ -128,10 +136,9 @@ public static AuthDto.LogInResponseDto toLogInResponseDto(Shop shop, TokenDto to
128136 }
129137
130138 public static AuthDto .LogInResponseDto toShopInfoResponseDto (Shop shop ) {
131- return new LogInResponseDtoBuilder ()
139+ return LogInResponseDto . builder ()
132140 .isComplete (false )
133- .email (shop .getEmail ())
134- .googleSub (shop .getGoogleSub ())
141+ .shopId (shop .getId ())
135142 .build ();
136143 }
137144 }
@@ -181,7 +188,7 @@ public static class GoogleInfoResponseDto {
181188 private String email ;
182189
183190 public static AuthDto .GoogleInfoResponseDto toGoogleInfoResponseDto (String id , String email ) {
184- return new GoogleInfoResponseDtoBuilder ()
191+ return GoogleInfoResponseDto . builder ()
185192 .id (id )
186193 .email (email )
187194 .build ();
0 commit comments