1
0
mirror of https://github.com/immich-app/immich.git synced 2025-08-08 23:07:06 +02:00

fix(server) added TagResponseDto for TagController (#1065)

* fix(server) added TagResponseDto for TagController

* Added userId to DTO
This commit is contained in:
Alex
2022-12-06 15:46:13 -06:00
committed by GitHub
parent db34f2f7fd
commit f91bdc2785
13 changed files with 107 additions and 941 deletions

View File

@ -16,6 +16,8 @@ class TagResponseDto {
required this.id,
required this.type,
required this.name,
required this.userId,
this.renameTagId,
});
String id;
@ -24,27 +26,41 @@ class TagResponseDto {
String name;
String userId;
String? renameTagId;
@override
bool operator ==(Object other) => identical(this, other) || other is TagResponseDto &&
other.id == id &&
other.type == type &&
other.name == name;
other.name == name &&
other.userId == userId &&
other.renameTagId == renameTagId;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id.hashCode) +
(type.hashCode) +
(name.hashCode);
(name.hashCode) +
(userId.hashCode) +
(renameTagId == null ? 0 : renameTagId!.hashCode);
@override
String toString() => 'TagResponseDto[id=$id, type=$type, name=$name]';
String toString() => 'TagResponseDto[id=$id, type=$type, name=$name, userId=$userId, renameTagId=$renameTagId]';
Map<String, dynamic> toJson() {
final _json = <String, dynamic>{};
_json[r'id'] = id;
_json[r'type'] = type;
_json[r'name'] = name;
_json[r'userId'] = userId;
if (renameTagId != null) {
_json[r'renameTagId'] = renameTagId;
} else {
_json[r'renameTagId'] = null;
}
return _json;
}
@ -70,6 +86,8 @@ class TagResponseDto {
id: mapValueOfType<String>(json, r'id')!,
type: TagTypeEnum.fromJson(json[r'type'])!,
name: mapValueOfType<String>(json, r'name')!,
userId: mapValueOfType<String>(json, r'userId')!,
renameTagId: mapValueOfType<String>(json, r'renameTagId'),
);
}
return null;
@ -122,6 +140,7 @@ class TagResponseDto {
'id',
'type',
'name',
'userId',
};
}