2026-02-25 14:45:08 +08:00
|
|
|
class AuthUser {
|
|
|
|
|
final String id;
|
|
|
|
|
final String email;
|
|
|
|
|
|
|
|
|
|
const AuthUser({required this.id, required this.email});
|
|
|
|
|
|
|
|
|
|
factory AuthUser.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return AuthUser(id: json['id'] as String, email: json['email'] as String);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AuthResponse {
|
|
|
|
|
final String accessToken;
|
|
|
|
|
final String refreshToken;
|
|
|
|
|
final int expiresIn;
|
|
|
|
|
final String tokenType;
|
|
|
|
|
final AuthUser user;
|
|
|
|
|
|
|
|
|
|
const AuthResponse({
|
|
|
|
|
required this.accessToken,
|
|
|
|
|
required this.refreshToken,
|
|
|
|
|
required this.expiresIn,
|
|
|
|
|
required this.tokenType,
|
|
|
|
|
required this.user,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
factory AuthResponse.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return AuthResponse(
|
|
|
|
|
accessToken: json['access_token'] as String,
|
|
|
|
|
refreshToken: json['refresh_token'] as String,
|
|
|
|
|
expiresIn: json['expires_in'] as int,
|
|
|
|
|
tokenType: json['token_type'] as String,
|
|
|
|
|
user: AuthUser.fromJson(json['user'] as Map<String, dynamic>),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-26 14:28:58 +08:00
|
|
|
class VerificationCreateResponse {
|
2026-02-25 14:45:08 +08:00
|
|
|
final String email;
|
|
|
|
|
|
2026-02-26 14:28:58 +08:00
|
|
|
const VerificationCreateResponse({required this.email});
|
2026-02-26 12:13:50 +08:00
|
|
|
|
2026-02-26 14:28:58 +08:00
|
|
|
factory VerificationCreateResponse.fromJson(Map<String, dynamic> json) {
|
|
|
|
|
return VerificationCreateResponse(email: json['email'] as String);
|
2026-02-26 12:13:50 +08:00
|
|
|
}
|
|
|
|
|
}
|