WIP still, tuning up auth and room wildcard with middleware
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'room.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateRoomRequest {
|
||||
final bool success;
|
||||
CreateRoomRequest({required this.success});
|
||||
factory CreateRoomRequest.fromJson(Map<String, dynamic> json) => _$CreateRoomRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CreateRoomRequestToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateRoomResponse {
|
||||
final bool success;
|
||||
final String? roomCode;
|
||||
final String? error;
|
||||
|
||||
CreateRoomResponse({required this.success, required this.roomCode, this.error});
|
||||
|
||||
factory CreateRoomResponse.fromJson(Map<String, dynamic> json) => _$CreateRoomResponseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CreateRoomResponseToJson(this);
|
||||
}
|
||||
+15
-19
@@ -2,30 +2,26 @@ import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'user.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class User {
|
||||
final String id;
|
||||
final String name;
|
||||
final String? roomId;
|
||||
|
||||
User({
|
||||
required this.id,
|
||||
required this.name,
|
||||
this.roomId,
|
||||
});
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$UserToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateUserRequest {
|
||||
final String username;
|
||||
final String roomCode;
|
||||
|
||||
CreateUserRequest({required this.username});
|
||||
|
||||
CreateUserRequest({required this.username, required this.roomCode});
|
||||
factory CreateUserRequest.fromJson(Map<String, dynamic> json) => _$CreateUserRequestFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CreateUserRequestToJson(this);
|
||||
}
|
||||
|
||||
@JsonSerializable()
|
||||
class CreateUserResponse {
|
||||
final String? token;
|
||||
final String? error;
|
||||
final bool success;
|
||||
|
||||
CreateUserResponse({required this.token, required this.success, this.error});
|
||||
|
||||
factory CreateUserResponse.fromJson(Map<String, dynamic> json) => _$CreateUserResponseFromJson(json);
|
||||
|
||||
Map<String, dynamic> toJson() => _$CreateUserResponseToJson(this);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user