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

chore(server): typeorm definitions fix part 3 (#1796)

* chore(server): tidy up exif typeorm entity definition

* chore(server): tidy up shared link typeorm entity definition

* chore(server): tidy up smart info typeorm entity definition

* chore(server): tidy up tag typeorm entity definition

* ci: add job that checks typeorm migrations are correct and up-to-date
This commit is contained in:
Zack Pollard
2023-02-20 01:50:27 +00:00
committed by GitHub
parent 5d3e8f17d1
commit d1ea6a897e
21 changed files with 140 additions and 101 deletions

View File

@@ -8,7 +8,6 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **int** | | [optional]
**fileSizeInByte** | **int** | | [optional]
**make** | **String** | | [optional]
**model** | **String** | | [optional]

View File

@@ -8,7 +8,6 @@ import 'package:openapi/api.dart';
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional]
**tags** | **List<String>** | | [optional] [default to const []]
**objects** | **List<String>** | | [optional] [default to const []]

View File

@@ -13,7 +13,6 @@ part of openapi.api;
class ExifResponseDto {
/// Returns a new [ExifResponseDto] instance.
ExifResponseDto({
this.id,
this.fileSizeInByte,
this.make,
this.model,
@@ -35,8 +34,6 @@ class ExifResponseDto {
this.country,
});
int? id;
int? fileSizeInByte;
String? make;
@@ -77,7 +74,6 @@ class ExifResponseDto {
@override
bool operator ==(Object other) => identical(this, other) || other is ExifResponseDto &&
other.id == id &&
other.fileSizeInByte == fileSizeInByte &&
other.make == make &&
other.model == model &&
@@ -101,7 +97,6 @@ class ExifResponseDto {
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(fileSizeInByte == null ? 0 : fileSizeInByte!.hashCode) +
(make == null ? 0 : make!.hashCode) +
(model == null ? 0 : model!.hashCode) +
@@ -123,15 +118,10 @@ class ExifResponseDto {
(country == null ? 0 : country!.hashCode);
@override
String toString() => 'ExifResponseDto[id=$id, fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
String toString() => 'ExifResponseDto[fileSizeInByte=$fileSizeInByte, make=$make, model=$model, imageName=$imageName, exifImageWidth=$exifImageWidth, exifImageHeight=$exifImageHeight, orientation=$orientation, dateTimeOriginal=$dateTimeOriginal, modifyDate=$modifyDate, lensModel=$lensModel, fNumber=$fNumber, focalLength=$focalLength, iso=$iso, exposureTime=$exposureTime, latitude=$latitude, longitude=$longitude, city=$city, state=$state, country=$country]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.id != null) {
json[r'id'] = this.id;
} else {
// json[r'id'] = null;
}
if (this.fileSizeInByte != null) {
json[r'fileSizeInByte'] = this.fileSizeInByte;
} else {
@@ -249,7 +239,6 @@ class ExifResponseDto {
}());
return ExifResponseDto(
id: mapValueOfType<int>(json, r'id'),
fileSizeInByte: mapValueOfType<int>(json, r'fileSizeInByte'),
make: mapValueOfType<String>(json, r'make'),
model: mapValueOfType<String>(json, r'model'),

View File

@@ -13,46 +13,30 @@ part of openapi.api;
class SmartInfoResponseDto {
/// Returns a new [SmartInfoResponseDto] instance.
SmartInfoResponseDto({
this.id,
this.tags = const [],
this.objects = const [],
});
///
/// Please note: This property should have been non-nullable! Since the specification file
/// does not include a default value (using the "default:" property), however, the generated
/// source code must fall back to having a nullable type.
/// Consider adding a "default:" property in the specification file to hide this note.
///
String? id;
List<String>? tags;
List<String>? objects;
@override
bool operator ==(Object other) => identical(this, other) || other is SmartInfoResponseDto &&
other.id == id &&
other.tags == tags &&
other.objects == objects;
@override
int get hashCode =>
// ignore: unnecessary_parenthesis
(id == null ? 0 : id!.hashCode) +
(tags == null ? 0 : tags!.hashCode) +
(objects == null ? 0 : objects!.hashCode);
@override
String toString() => 'SmartInfoResponseDto[id=$id, tags=$tags, objects=$objects]';
String toString() => 'SmartInfoResponseDto[tags=$tags, objects=$objects]';
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
if (this.id != null) {
json[r'id'] = this.id;
} else {
// json[r'id'] = null;
}
if (this.tags != null) {
json[r'tags'] = this.tags;
} else {
@@ -85,7 +69,6 @@ class SmartInfoResponseDto {
}());
return SmartInfoResponseDto(
id: mapValueOfType<String>(json, r'id'),
tags: json[r'tags'] is List
? (json[r'tags'] as List).cast<String>()
: const [],

View File

@@ -16,11 +16,6 @@ void main() {
// final instance = ExifResponseDto();
group('test ExifResponseDto', () {
// int id
test('to test the property `id`', () async {
// TODO
});
// int fileSizeInByte
test('to test the property `fileSizeInByte`', () async {
// TODO

View File

@@ -16,11 +16,6 @@ void main() {
// final instance = SmartInfoResponseDto();
group('test SmartInfoResponseDto', () {
// String id
test('to test the property `id`', () async {
// TODO
});
// List<String> tags (default value: const [])
test('to test the property `tags`', () async {
// TODO