2024-09-16 18:14:23 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
2024-05-18 10:17:16 +00:00
|
|
|
import 'package:solian/models/account.dart';
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
part 'realm.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable()
|
2024-05-18 10:17:16 +00:00
|
|
|
class Realm {
|
|
|
|
int id;
|
|
|
|
DateTime createdAt;
|
|
|
|
DateTime updatedAt;
|
|
|
|
DateTime? deletedAt;
|
|
|
|
String alias;
|
|
|
|
String name;
|
|
|
|
String description;
|
2024-09-12 15:55:31 +00:00
|
|
|
String? avatar;
|
|
|
|
String? banner;
|
2024-05-18 10:17:16 +00:00
|
|
|
bool isPublic;
|
|
|
|
bool isCommunity;
|
2024-05-25 17:21:08 +00:00
|
|
|
int? accountId;
|
2024-09-12 15:55:31 +00:00
|
|
|
int? externalId;
|
2024-05-18 10:17:16 +00:00
|
|
|
|
|
|
|
Realm({
|
|
|
|
required this.id,
|
|
|
|
required this.createdAt,
|
|
|
|
required this.updatedAt,
|
|
|
|
this.deletedAt,
|
|
|
|
required this.alias,
|
|
|
|
required this.name,
|
|
|
|
required this.description,
|
2024-09-12 15:55:31 +00:00
|
|
|
required this.avatar,
|
|
|
|
required this.banner,
|
2024-05-18 10:17:16 +00:00
|
|
|
required this.isPublic,
|
|
|
|
required this.isCommunity,
|
2024-05-25 17:21:08 +00:00
|
|
|
this.accountId,
|
2024-09-12 15:55:31 +00:00
|
|
|
this.externalId,
|
2024-05-18 10:17:16 +00:00
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory Realm.fromJson(Map<String, dynamic> json) => _$RealmFromJson(json);
|
2024-05-18 10:17:16 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$RealmToJson(this);
|
2024-08-07 10:24:16 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
bool operator ==(Object other) {
|
|
|
|
if (other is Realm) {
|
|
|
|
return other.id == id;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
@override
|
|
|
|
int get hashCode => id;
|
2024-05-18 10:17:16 +00:00
|
|
|
}
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
@JsonSerializable()
|
2024-05-18 10:17:16 +00:00
|
|
|
class RealmMember {
|
|
|
|
int id;
|
|
|
|
DateTime createdAt;
|
|
|
|
DateTime updatedAt;
|
|
|
|
DateTime? deletedAt;
|
|
|
|
int realmId;
|
|
|
|
int accountId;
|
|
|
|
Account account;
|
|
|
|
int powerLevel;
|
|
|
|
|
|
|
|
RealmMember({
|
|
|
|
required this.id,
|
|
|
|
required this.createdAt,
|
|
|
|
required this.updatedAt,
|
|
|
|
this.deletedAt,
|
|
|
|
required this.realmId,
|
|
|
|
required this.accountId,
|
|
|
|
required this.account,
|
|
|
|
required this.powerLevel,
|
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory RealmMember.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$RealmMemberFromJson(json);
|
2024-05-18 10:17:16 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$RealmMemberToJson(this);
|
2024-05-18 10:17:16 +00:00
|
|
|
}
|