refactor(server): shared links (#1385)

* refactor(server): shared links

* chore: tests

* fix: bugs and tests

* fix: missed one expired at

* fix: standardize file upload checks

* test: lower flutter version

Co-authored-by: Alex Tran <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen 2023-01-25 11:35:28 -05:00 committed by GitHub
parent f64db3a2f9
commit 8f304b8157
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
70 changed files with 1481 additions and 1057 deletions

View file

@ -14,7 +14,7 @@ class CreateAlbumShareLinkDto {
/// Returns a new [CreateAlbumShareLinkDto] instance.
CreateAlbumShareLinkDto({
required this.albumId,
this.expiredAt,
this.expiresAt,
this.allowUpload,
this.allowDownload,
this.showExif,
@ -29,7 +29,7 @@ class CreateAlbumShareLinkDto {
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? expiredAt;
String? expiresAt;
///
/// Please note: This property should have been non-nullable! Since the specification file
@ -66,7 +66,7 @@ class CreateAlbumShareLinkDto {
@override
bool operator ==(Object other) => identical(this, other) || other is CreateAlbumShareLinkDto &&
other.albumId == albumId &&
other.expiredAt == expiredAt &&
other.expiresAt == expiresAt &&
other.allowUpload == allowUpload &&
other.allowDownload == allowDownload &&
other.showExif == showExif &&
@ -76,22 +76,22 @@ class CreateAlbumShareLinkDto {
int get hashCode =>
// ignore: unnecessary_parenthesis
(albumId.hashCode) +
(expiredAt == null ? 0 : expiredAt!.hashCode) +
(expiresAt == null ? 0 : expiresAt!.hashCode) +
(allowUpload == null ? 0 : allowUpload!.hashCode) +
(allowDownload == null ? 0 : allowDownload!.hashCode) +
(showExif == null ? 0 : showExif!.hashCode) +
(description == null ? 0 : description!.hashCode);
@override
String toString() => 'CreateAlbumShareLinkDto[albumId=$albumId, expiredAt=$expiredAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif, description=$description]';
String toString() => 'CreateAlbumShareLinkDto[albumId=$albumId, expiresAt=$expiresAt, allowUpload=$allowUpload, allowDownload=$allowDownload, showExif=$showExif, description=$description]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
json[r'albumId'] = this.albumId;
if (this.expiredAt != null) {
json[r'expiredAt'] = this.expiredAt;
if (this.expiresAt != null) {
json[r'expiresAt'] = this.expiresAt;
} else {
// json[r'expiredAt'] = null;
// json[r'expiresAt'] = null;
}
if (this.allowUpload != null) {
json[r'allowUpload'] = this.allowUpload;
@ -136,7 +136,7 @@ class CreateAlbumShareLinkDto {
return CreateAlbumShareLinkDto(
albumId: mapValueOfType<String>(json, r'albumId')!,
expiredAt: mapValueOfType<String>(json, r'expiredAt'),
expiresAt: mapValueOfType<String>(json, r'expiresAt'),
allowUpload: mapValueOfType<bool>(json, r'allowUpload'),
allowDownload: mapValueOfType<bool>(json, r'allowDownload'),
showExif: mapValueOfType<bool>(json, r'showExif'),