rluv_client/lib/models/token.dart

28 lines
619 B
Dart
Raw Normal View History

2023-07-27 01:40:26 -06:00
import 'package:json_annotation/json_annotation.dart';
import '../global/utils.dart';
part 'token.g.dart';
@JsonSerializable()
class Token {
const Token({
required this.userId,
required this.familyId,
required this.generatedAt,
required this.expiresAt,
});
final int familyId, userId;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime generatedAt;
@JsonKey(fromJson: dateFromJson, toJson: dateToJson)
final DateTime expiresAt;
factory Token.fromJson(Map<String, dynamic> json) => _$TokenFromJson(json);
Map<String, dynamic> toJson() => _$TokenToJson(this);
}