Testing is complete!! And a nice build runner script to boot
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'jwt.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class JWTBody {
|
||||
String uuid;
|
||||
String roomUuid;
|
||||
int iat;
|
||||
int exp;
|
||||
|
||||
JWTBody({required this.uuid, required this.roomUuid, required this.iat, required this.exp});
|
||||
|
||||
factory JWTBody.fromJson(Map<String, dynamic> json) => _$JWTBodyFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$JWTBodyToJson(this);
|
||||
}
|
||||
@@ -2,6 +2,8 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user.g.dart';
|
||||
|
||||
typedef JoinRoomRequest = CreateUserRequest;
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateUserRequest {
|
||||
final String username;
|
||||
@@ -13,13 +15,16 @@ class CreateUserRequest {
|
||||
Map<String, dynamic> toJson() => _$CreateUserRequestToJson(this);
|
||||
}
|
||||
|
||||
typedef JoinRoomResponse = CreateUserResponse;
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateUserResponse {
|
||||
final String? token;
|
||||
final String? error;
|
||||
final String? uuid;
|
||||
final bool success;
|
||||
|
||||
CreateUserResponse({required this.token, required this.success, this.error});
|
||||
CreateUserResponse({required this.token, required this.uuid, required this.success, this.error});
|
||||
|
||||
factory CreateUserResponse.fromJson(Map<String, dynamic> json) => _$CreateUserResponseFromJson(json);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user