2024-09-16 18:14:23 +00:00
|
|
|
import 'package:json_annotation/json_annotation.dart';
|
2024-07-26 16:20:11 +00:00
|
|
|
import 'package:solian/models/account.dart';
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
part 'attachment.g.dart';
|
|
|
|
|
|
|
|
@JsonSerializable()
|
2024-08-20 17:53:16 +00:00
|
|
|
class AttachmentPlaceholder {
|
|
|
|
int chunkCount;
|
|
|
|
int chunkSize;
|
|
|
|
Attachment meta;
|
|
|
|
|
|
|
|
AttachmentPlaceholder({
|
|
|
|
required this.chunkCount,
|
|
|
|
required this.chunkSize,
|
|
|
|
required this.meta,
|
|
|
|
});
|
|
|
|
|
|
|
|
factory AttachmentPlaceholder.fromJson(Map<String, dynamic> json) =>
|
2024-09-07 07:36:06 +00:00
|
|
|
_$AttachmentPlaceholderFromJson(json);
|
2024-08-20 17:53:16 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$AttachmentPlaceholderToJson(this);
|
2024-08-20 17:53:16 +00:00
|
|
|
}
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
@JsonSerializable()
|
2024-05-18 10:17:16 +00:00
|
|
|
class Attachment {
|
|
|
|
int id;
|
|
|
|
DateTime createdAt;
|
|
|
|
DateTime updatedAt;
|
2024-07-25 17:16:32 +00:00
|
|
|
DateTime? deletedAt;
|
2024-08-18 14:51:52 +00:00
|
|
|
String rid;
|
2024-05-18 10:17:16 +00:00
|
|
|
String uuid;
|
|
|
|
int size;
|
|
|
|
String name;
|
|
|
|
String alt;
|
|
|
|
String mimetype;
|
|
|
|
String hash;
|
2024-07-29 09:56:36 +00:00
|
|
|
int destination;
|
|
|
|
bool isAnalyzed;
|
2024-08-20 17:53:16 +00:00
|
|
|
bool isUploaded;
|
2024-05-18 10:17:16 +00:00
|
|
|
Map<String, dynamic>? metadata;
|
2024-08-20 17:53:16 +00:00
|
|
|
Map<String, dynamic>? fileChunks;
|
2024-05-18 10:17:16 +00:00
|
|
|
bool isMature;
|
2024-07-26 16:20:11 +00:00
|
|
|
Account? account;
|
|
|
|
int? accountId;
|
2024-05-18 10:17:16 +00:00
|
|
|
|
|
|
|
Attachment({
|
|
|
|
required this.id,
|
|
|
|
required this.createdAt,
|
|
|
|
required this.updatedAt,
|
|
|
|
required this.deletedAt,
|
2024-08-18 14:51:52 +00:00
|
|
|
required this.rid,
|
2024-05-18 10:17:16 +00:00
|
|
|
required this.uuid,
|
|
|
|
required this.size,
|
|
|
|
required this.name,
|
|
|
|
required this.alt,
|
|
|
|
required this.mimetype,
|
|
|
|
required this.hash,
|
|
|
|
required this.destination,
|
2024-07-29 09:56:36 +00:00
|
|
|
required this.isAnalyzed,
|
2024-08-20 17:53:16 +00:00
|
|
|
required this.isUploaded,
|
2024-05-18 10:17:16 +00:00
|
|
|
required this.metadata,
|
2024-08-20 17:53:16 +00:00
|
|
|
required this.fileChunks,
|
2024-05-18 10:17:16 +00:00
|
|
|
required this.isMature,
|
2024-07-26 16:20:11 +00:00
|
|
|
required this.account,
|
2024-05-18 10:17:16 +00:00
|
|
|
required this.accountId,
|
|
|
|
});
|
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
factory Attachment.fromJson(Map<String, dynamic> json) =>
|
|
|
|
_$AttachmentFromJson(json);
|
2024-05-18 10:17:16 +00:00
|
|
|
|
2024-09-07 07:36:06 +00:00
|
|
|
Map<String, dynamic> toJson() => _$AttachmentToJson(this);
|
2024-08-18 14:51:52 +00:00
|
|
|
}
|