timeOfRequest -> requestedAt
This commit is contained in:
parent
061c567468
commit
e033e9aad2
9 changed files with 20 additions and 20 deletions
2
cli/src/api/open-api/api.ts
generated
2
cli/src/api/open-api/api.ts
generated
|
@ -964,7 +964,7 @@ export interface AuditDeletesResponseDto {
|
|||
* @type {string}
|
||||
* @memberof AuditDeletesResponseDto
|
||||
*/
|
||||
'timeOfRequest'?: string;
|
||||
'requestedAt'?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
|
@ -54,15 +54,15 @@ class AssetService {
|
|||
final deleted = await _apiService.auditApi
|
||||
.getAuditDeletes(EntityType.ASSET, since, userId: user.id);
|
||||
if (deleted == null || deleted.needsFullSync) {
|
||||
return (null, null, deleted?.timeOfRequest);
|
||||
return (null, null, deleted?.requestedAt);
|
||||
}
|
||||
final assetDto = await _apiService.assetApi
|
||||
.getAllAssets(userId: user.id, updatedAfter: since);
|
||||
if (assetDto == null) return (null, null, deleted.timeOfRequest);
|
||||
if (assetDto == null) return (null, null, deleted.requestedAt);
|
||||
return (
|
||||
assetDto.map(Asset.remote).toList(),
|
||||
deleted.ids,
|
||||
deleted.timeOfRequest
|
||||
deleted.requestedAt
|
||||
);
|
||||
}
|
||||
|
||||
|
|
2
mobile/openapi/doc/AuditDeletesResponseDto.md
generated
2
mobile/openapi/doc/AuditDeletesResponseDto.md
generated
|
@ -10,7 +10,7 @@ Name | Type | Description | Notes
|
|||
------------ | ------------- | ------------- | -------------
|
||||
**ids** | **List<String>** | | [default to const []]
|
||||
**needsFullSync** | **bool** | |
|
||||
**timeOfRequest** | [**DateTime**](DateTime.md) | | [optional]
|
||||
**requestedAt** | [**DateTime**](DateTime.md) | | [optional]
|
||||
|
||||
[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ class AuditDeletesResponseDto {
|
|||
AuditDeletesResponseDto({
|
||||
this.ids = const [],
|
||||
required this.needsFullSync,
|
||||
this.timeOfRequest,
|
||||
this.requestedAt,
|
||||
});
|
||||
|
||||
List<String> ids;
|
||||
|
@ -28,32 +28,32 @@ class AuditDeletesResponseDto {
|
|||
/// source code must fall back to having a nullable type.
|
||||
/// Consider adding a "default:" property in the specification file to hide this note.
|
||||
///
|
||||
DateTime? timeOfRequest;
|
||||
DateTime? requestedAt;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) => identical(this, other) || other is AuditDeletesResponseDto &&
|
||||
other.ids == ids &&
|
||||
other.needsFullSync == needsFullSync &&
|
||||
other.timeOfRequest == timeOfRequest;
|
||||
other.requestedAt == requestedAt;
|
||||
|
||||
@override
|
||||
int get hashCode =>
|
||||
// ignore: unnecessary_parenthesis
|
||||
(ids.hashCode) +
|
||||
(needsFullSync.hashCode) +
|
||||
(timeOfRequest == null ? 0 : timeOfRequest!.hashCode);
|
||||
(requestedAt == null ? 0 : requestedAt!.hashCode);
|
||||
|
||||
@override
|
||||
String toString() => 'AuditDeletesResponseDto[ids=$ids, needsFullSync=$needsFullSync, timeOfRequest=$timeOfRequest]';
|
||||
String toString() => 'AuditDeletesResponseDto[ids=$ids, needsFullSync=$needsFullSync, requestedAt=$requestedAt]';
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final json = <String, dynamic>{};
|
||||
json[r'ids'] = this.ids;
|
||||
json[r'needsFullSync'] = this.needsFullSync;
|
||||
if (this.timeOfRequest != null) {
|
||||
json[r'timeOfRequest'] = this.timeOfRequest!.toUtc().toIso8601String();
|
||||
if (this.requestedAt != null) {
|
||||
json[r'requestedAt'] = this.requestedAt!.toUtc().toIso8601String();
|
||||
} else {
|
||||
// json[r'timeOfRequest'] = null;
|
||||
// json[r'requestedAt'] = null;
|
||||
}
|
||||
return json;
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ class AuditDeletesResponseDto {
|
|||
? (json[r'ids'] as List).cast<String>()
|
||||
: const [],
|
||||
needsFullSync: mapValueOfType<bool>(json, r'needsFullSync')!,
|
||||
timeOfRequest: mapDateTime(json, r'timeOfRequest', ''),
|
||||
requestedAt: mapDateTime(json, r'requestedAt', ''),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
|
|
|
@ -26,8 +26,8 @@ void main() {
|
|||
// TODO
|
||||
});
|
||||
|
||||
// DateTime timeOfRequest
|
||||
test('to test the property `timeOfRequest`', () async {
|
||||
// DateTime requestedAt
|
||||
test('to test the property `requestedAt`', () async {
|
||||
// TODO
|
||||
});
|
||||
|
||||
|
|
|
@ -6827,7 +6827,7 @@
|
|||
"needsFullSync": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"timeOfRequest": {
|
||||
"requestedAt": {
|
||||
"format": "date-time",
|
||||
"type": "string"
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ export enum PathEntityType {
|
|||
export class AuditDeletesResponseDto {
|
||||
needsFullSync!: boolean;
|
||||
ids!: string[];
|
||||
timeOfRequest?: Date;
|
||||
requestedAt?: Date;
|
||||
}
|
||||
|
||||
export class FileReportDto {
|
||||
|
|
|
@ -61,7 +61,7 @@ export class AuditService {
|
|||
});
|
||||
|
||||
return {
|
||||
timeOfRequest: now.toJSDate(),
|
||||
requestedAt: now.toJSDate(),
|
||||
needsFullSync: duration > AUDIT_LOG_MAX_DURATION,
|
||||
ids: audits.map(({ entityId }) => entityId),
|
||||
};
|
||||
|
|
2
web/src/api/open-api/api.ts
generated
2
web/src/api/open-api/api.ts
generated
|
@ -964,7 +964,7 @@ export interface AuditDeletesResponseDto {
|
|||
* @type {string}
|
||||
* @memberof AuditDeletesResponseDto
|
||||
*/
|
||||
'timeOfRequest'?: string;
|
||||
'requestedAt'?: string;
|
||||
}
|
||||
/**
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue