Added Nextcloud base

This commit is contained in:
2023-02-20 10:56:51 +01:00
parent e54ae9c2ff
commit fea36b9a6d
63 changed files with 1863 additions and 700 deletions

View File

@ -0,0 +1,53 @@
import 'package:json_annotation/json_annotation.dart';
import 'package:marianum_mobile/api/apiResponse.dart';
import 'package:marianum_mobile/api/marianumcloud/talk/room/getRoomResponse.dart';
part 'getChatResponse.g.dart';
@JsonSerializable(explicitToJson: true)
class GetChatResponse extends ApiResponse {
Set<GetChatResponseObject> data;
GetChatResponse(this.data);
factory GetChatResponse.fromJson(Map<String, dynamic> json) => _$GetChatResponseFromJson(json);
Map<String, dynamic> toJson() => _$GetChatResponseToJson(this);
List<GetChatResponseObject> sortByTimestamp() {
List<GetChatResponseObject> sorted = data.toList();
sorted.sort((a, b) => a.timestamp.compareTo(b.timestamp));
return sorted;
}
}
@JsonSerializable(explicitToJson: true)
class GetChatResponseObject {
int id;
String token;
GetRoomResponseObjectMessageActorType actorType;
String actorId;
String actorDisplayName;
int timestamp;
String systemMessage;
GetRoomResponseObjectMessageType messageType;
bool isReplyable;
String referenceId;
String message;
GetChatResponseObject(
this.id,
this.token,
this.actorType,
this.actorId,
this.actorDisplayName,
this.timestamp,
this.systemMessage,
this.messageType,
this.isReplyable,
this.referenceId,
this.message);
factory GetChatResponseObject.fromJson(Map<String, dynamic> json) => _$GetChatResponseObjectFromJson(json);
Map<String, dynamic> toJson() => _$GetChatResponseObjectToJson(this);
}