-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Domain] Added initial dto and entity to save telemetry data
- Loading branch information
Showing
4 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
lib/domain/models/dtos/requests/save_app_logs_request_dto.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import 'package:json_annotation/json_annotation.dart'; | ||
|
||
part 'save_app_logs_request_dto.g.dart'; | ||
|
||
@JsonSerializable(explicitToJson: true) | ||
class SaveAppLogsRequestDto { | ||
final List<SaveAppLogRequestDto> logs; | ||
|
||
const SaveAppLogsRequestDto({ | ||
required this.logs, | ||
}); | ||
|
||
Map<String, dynamic> toJson() => _$SaveAppLogsRequestDtoToJson(this); | ||
|
||
factory SaveAppLogsRequestDto.fromJson(Map<String, dynamic> json) => _$SaveAppLogsRequestDtoFromJson(json); | ||
} | ||
|
||
@JsonSerializable() | ||
class SaveAppLogRequestDto { | ||
final int timestamp; | ||
|
||
final String message; | ||
|
||
const SaveAppLogRequestDto({ | ||
required this.timestamp, | ||
required this.message, | ||
}); | ||
|
||
Map<String, dynamic> toJson() => _$SaveAppLogRequestDtoToJson(this); | ||
|
||
factory SaveAppLogRequestDto.fromJson(Map<String, dynamic> json) => _$SaveAppLogRequestDtoFromJson(json); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'package:hive/hive.dart'; | ||
import 'package:shiori/domain/models/entities/base_entity.dart'; | ||
|
||
part 'telemetry.g.dart'; | ||
|
||
@HiveType(typeId: 25) | ||
class Telemetry extends BaseEntity { | ||
@HiveField(0) | ||
final DateTime createdAt; | ||
|
||
@HiveField(1) | ||
final String message; | ||
|
||
Telemetry(this.createdAt, this.message); | ||
} |