Image attachment

This commit is contained in:
2024-11-09 12:04:03 +08:00
parent 07b8ec6e96
commit 5e12a8860c
12 changed files with 1627 additions and 28 deletions

56
lib/types/attachment.dart Normal file
View File

@ -0,0 +1,56 @@
import 'package:freezed_annotation/freezed_annotation.dart';
part 'attachment.freezed.dart';
part 'attachment.g.dart';
@freezed
class SnAttachment with _$SnAttachment {
const factory SnAttachment({
required int id,
required DateTime createdAt,
required DateTime updatedAt,
required dynamic deletedAt,
required String rid,
required String uuid,
required int size,
required String name,
required String alt,
required String mimetype,
required String hash,
required int destination,
required int refCount,
required dynamic fileChunks,
required dynamic cleanedAt,
required Map<String, dynamic> metadata,
required bool isMature,
required bool isAnalyzed,
required bool isUploaded,
required bool isSelfRef,
required dynamic ref,
required dynamic refId,
required SnAttachmentPool? pool,
required int poolId,
required int accountId,
}) = _SnAttachment;
factory SnAttachment.fromJson(Map<String, Object?> json) =>
_$SnAttachmentFromJson(json);
}
@freezed
class SnAttachmentPool with _$SnAttachmentPool {
const factory SnAttachmentPool({
required int id,
required DateTime createdAt,
required DateTime updatedAt,
required DateTime? deletedAt,
required String alias,
required String name,
required String description,
required Map<String, dynamic> config,
required int? accountId,
}) = _SnAttachmentPool;
factory SnAttachmentPool.fromJson(Map<String, Object?> json) =>
_$SnAttachmentPoolFromJson(json);
}