chat flow improvement and connect to SignalR.
parent
781e61814a
commit
186987c5ce
File diff suppressed because it is too large
Load Diff
@ -1,224 +1,224 @@
|
||||
class UserChatHistoryModel {
|
||||
List<ChatResponse>? response;
|
||||
bool? isSuccess;
|
||||
List<String>? onlineUserConnId;
|
||||
|
||||
UserChatHistoryModel({this.response, this.isSuccess, this.onlineUserConnId});
|
||||
|
||||
UserChatHistoryModel.fromJson(Map<String, dynamic> json) {
|
||||
if (json['response'] != null) {
|
||||
response = <ChatResponse>[];
|
||||
json['response'].forEach((v) {
|
||||
response!.add(new ChatResponse.fromJson(v));
|
||||
});
|
||||
}
|
||||
isSuccess = json['isSuccess'];
|
||||
onlineUserConnId = json['onlineUserConnId'].cast<String>();
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
if (this.response != null) {
|
||||
data['response'] = this.response!.map((v) => v.toJson()).toList();
|
||||
}
|
||||
data['isSuccess'] = this.isSuccess;
|
||||
data['onlineUserConnId'] = this.onlineUserConnId;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ChatResponse {
|
||||
int? id;
|
||||
int? conversationId;
|
||||
String? userId;
|
||||
int? userIdInt;
|
||||
String? userName;
|
||||
String? content;
|
||||
String? messageType;
|
||||
String? createdAt;
|
||||
|
||||
ChatResponse({this.id, this.conversationId, this.userId, this.userIdInt, this.userName, this.content, this.messageType, this.createdAt});
|
||||
|
||||
ChatResponse.fromJson(Map<String, dynamic> json) {
|
||||
id = json['id'];
|
||||
conversationId = json['conversationId'];
|
||||
userId = json['userId'];
|
||||
userIdInt = json['userIdInt'];
|
||||
userName = json['userName'];
|
||||
content = json['content'];
|
||||
messageType = json['messageType'];
|
||||
createdAt = json['createdAt'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['id'] = this.id;
|
||||
data['conversationId'] = this.conversationId;
|
||||
data['userId'] = this.userId;
|
||||
data['userIdInt'] = this.userIdInt;
|
||||
data['userName'] = this.userName;
|
||||
data['content'] = this.content;
|
||||
data['messageType'] = this.messageType;
|
||||
data['createdAt'] = this.createdAt;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class ChatHistoryResponse {
|
||||
int? userChatHistoryId;
|
||||
int? userChatHistoryLineId;
|
||||
String? contant;
|
||||
String? contantNo;
|
||||
String? currentUserId;
|
||||
String? currentEmployeeNumber;
|
||||
String? currentUserName;
|
||||
String? currentUserEmail;
|
||||
String? currentFullName;
|
||||
String? targetUserId;
|
||||
String? targetEmployeeNumber;
|
||||
String? targetUserName;
|
||||
String? targetUserEmail;
|
||||
String? targetFullName;
|
||||
String? encryptedTargetUserId;
|
||||
String? encryptedTargetUserName;
|
||||
int? chatEventId;
|
||||
String? fileTypeId;
|
||||
bool? isSeen;
|
||||
bool? isDelivered;
|
||||
String? createdDate;
|
||||
int? chatSource;
|
||||
String? conversationId;
|
||||
FileTypeResponse? fileTypeResponse;
|
||||
String? userChatReplyResponse;
|
||||
String? deviceToken;
|
||||
bool? isHuaweiDevice;
|
||||
String? platform;
|
||||
String? voipToken;
|
||||
|
||||
ChatHistoryResponse(
|
||||
{this.userChatHistoryId,
|
||||
this.userChatHistoryLineId,
|
||||
this.contant,
|
||||
this.contantNo,
|
||||
this.currentUserId,
|
||||
this.currentEmployeeNumber,
|
||||
this.currentUserName,
|
||||
this.currentUserEmail,
|
||||
this.currentFullName,
|
||||
this.targetUserId,
|
||||
this.targetEmployeeNumber,
|
||||
this.targetUserName,
|
||||
this.targetUserEmail,
|
||||
this.targetFullName,
|
||||
this.encryptedTargetUserId,
|
||||
this.encryptedTargetUserName,
|
||||
this.chatEventId,
|
||||
this.fileTypeId,
|
||||
this.isSeen,
|
||||
this.isDelivered,
|
||||
this.createdDate,
|
||||
this.chatSource,
|
||||
this.conversationId,
|
||||
this.fileTypeResponse,
|
||||
this.userChatReplyResponse,
|
||||
this.deviceToken,
|
||||
this.isHuaweiDevice,
|
||||
this.platform,
|
||||
this.voipToken});
|
||||
|
||||
ChatHistoryResponse.fromJson(Map<String, dynamic> json) {
|
||||
userChatHistoryId = json['userChatHistoryId'];
|
||||
userChatHistoryLineId = json['userChatHistoryLineId'];
|
||||
contant = json['contant'];
|
||||
contantNo = json['contantNo'];
|
||||
currentUserId = json['currentUserId'];
|
||||
currentEmployeeNumber = json['currentEmployeeNumber'];
|
||||
currentUserName = json['currentUserName'];
|
||||
currentUserEmail = json['currentUserEmail'];
|
||||
currentFullName = json['currentFullName'];
|
||||
targetUserId = json['targetUserId'];
|
||||
targetEmployeeNumber = json['targetEmployeeNumber'];
|
||||
targetUserName = json['targetUserName'];
|
||||
targetUserEmail = json['targetUserEmail'];
|
||||
targetFullName = json['targetFullName'];
|
||||
encryptedTargetUserId = json['encryptedTargetUserId'];
|
||||
encryptedTargetUserName = json['encryptedTargetUserName'];
|
||||
chatEventId = json['chatEventId'];
|
||||
fileTypeId = json['fileTypeId'];
|
||||
isSeen = json['isSeen'];
|
||||
isDelivered = json['isDelivered'];
|
||||
createdDate = json['createdDate'];
|
||||
chatSource = json['chatSource'];
|
||||
conversationId = json['conversationId'];
|
||||
fileTypeResponse = json['fileTypeResponse'] != null ? new FileTypeResponse.fromJson(json['fileTypeResponse']) : null;
|
||||
userChatReplyResponse = json['userChatReplyResponse'];
|
||||
deviceToken = json['deviceToken'];
|
||||
isHuaweiDevice = json['isHuaweiDevice'];
|
||||
platform = json['platform'];
|
||||
voipToken = json['voipToken'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['userChatHistoryId'] = this.userChatHistoryId;
|
||||
data['userChatHistoryLineId'] = this.userChatHistoryLineId;
|
||||
data['contant'] = this.contant;
|
||||
data['contantNo'] = this.contantNo;
|
||||
data['currentUserId'] = this.currentUserId;
|
||||
data['currentEmployeeNumber'] = this.currentEmployeeNumber;
|
||||
data['currentUserName'] = this.currentUserName;
|
||||
data['currentUserEmail'] = this.currentUserEmail;
|
||||
data['currentFullName'] = this.currentFullName;
|
||||
data['targetUserId'] = this.targetUserId;
|
||||
data['targetEmployeeNumber'] = this.targetEmployeeNumber;
|
||||
data['targetUserName'] = this.targetUserName;
|
||||
data['targetUserEmail'] = this.targetUserEmail;
|
||||
data['targetFullName'] = this.targetFullName;
|
||||
data['encryptedTargetUserId'] = this.encryptedTargetUserId;
|
||||
data['encryptedTargetUserName'] = this.encryptedTargetUserName;
|
||||
data['chatEventId'] = this.chatEventId;
|
||||
data['fileTypeId'] = this.fileTypeId;
|
||||
data['isSeen'] = this.isSeen;
|
||||
data['isDelivered'] = this.isDelivered;
|
||||
data['createdDate'] = this.createdDate;
|
||||
data['chatSource'] = this.chatSource;
|
||||
data['conversationId'] = this.conversationId;
|
||||
if (this.fileTypeResponse != null) {
|
||||
data['fileTypeResponse'] = this.fileTypeResponse!.toJson();
|
||||
}
|
||||
data['userChatReplyResponse'] = this.userChatReplyResponse;
|
||||
data['deviceToken'] = this.deviceToken;
|
||||
data['isHuaweiDevice'] = this.isHuaweiDevice;
|
||||
data['platform'] = this.platform;
|
||||
data['voipToken'] = this.voipToken;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
class FileTypeResponse {
|
||||
int? fileTypeId;
|
||||
String? fileTypeName;
|
||||
String? fileTypeDescription;
|
||||
String? fileKind;
|
||||
String? fileName;
|
||||
|
||||
FileTypeResponse({this.fileTypeId, this.fileTypeName, this.fileTypeDescription, this.fileKind, this.fileName});
|
||||
|
||||
FileTypeResponse.fromJson(Map<String, dynamic> json) {
|
||||
fileTypeId = json['fileTypeId'];
|
||||
fileTypeName = json['fileTypeName'];
|
||||
fileTypeDescription = json['fileTypeDescription'];
|
||||
fileKind = json['fileKind'];
|
||||
fileName = json['fileName'];
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() {
|
||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
data['fileTypeId'] = this.fileTypeId;
|
||||
data['fileTypeName'] = this.fileTypeName;
|
||||
data['fileTypeDescription'] = this.fileTypeDescription;
|
||||
data['fileKind'] = this.fileKind;
|
||||
data['fileName'] = this.fileName;
|
||||
return data;
|
||||
}
|
||||
}
|
||||
// class UserChatHistoryModel {
|
||||
// List<ChatResponse>? response;
|
||||
// bool? isSuccess;
|
||||
// List<String>? onlineUserConnId;
|
||||
//
|
||||
// UserChatHistoryModel({this.response, this.isSuccess, this.onlineUserConnId});
|
||||
//
|
||||
// UserChatHistoryModel.fromJson(Map<String, dynamic> json) {
|
||||
// if (json['response'] != null) {
|
||||
// response = <ChatResponse>[];
|
||||
// json['response'].forEach((v) {
|
||||
// response!.add(new ChatResponse.fromJson(v));
|
||||
// });
|
||||
// }
|
||||
// isSuccess = json['isSuccess'];
|
||||
// onlineUserConnId = json['onlineUserConnId'].cast<String>();
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// if (this.response != null) {
|
||||
// data['response'] = this.response!.map((v) => v.toJson()).toList();
|
||||
// }
|
||||
// data['isSuccess'] = this.isSuccess;
|
||||
// data['onlineUserConnId'] = this.onlineUserConnId;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class ChatResponse {
|
||||
// int? id;
|
||||
// int? conversationId;
|
||||
// String? userId;
|
||||
// int? userIdInt;
|
||||
// String? userName;
|
||||
// String? content;
|
||||
// String? messageType;
|
||||
// String? createdAt;
|
||||
//
|
||||
// ChatResponse({this.id, this.conversationId, this.userId, this.userIdInt, this.userName, this.content, this.messageType, this.createdAt});
|
||||
//
|
||||
// ChatResponse.fromJson(Map<String, dynamic> json) {
|
||||
// id = json['id'];
|
||||
// conversationId = json['conversationId'];
|
||||
// userId = json['userId'];
|
||||
// userIdInt = json['userIdInt'];
|
||||
// userName = json['userName'];
|
||||
// content = json['content'];
|
||||
// messageType = json['messageType'];
|
||||
// createdAt = json['createdAt'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['id'] = this.id;
|
||||
// data['conversationId'] = this.conversationId;
|
||||
// data['userId'] = this.userId;
|
||||
// data['userIdInt'] = this.userIdInt;
|
||||
// data['userName'] = this.userName;
|
||||
// data['content'] = this.content;
|
||||
// data['messageType'] = this.messageType;
|
||||
// data['createdAt'] = this.createdAt;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class ChatHistoryResponse {
|
||||
// int? userChatHistoryId;
|
||||
// int? userChatHistoryLineId;
|
||||
// String? contant;
|
||||
// String? contantNo;
|
||||
// String? currentUserId;
|
||||
// String? currentEmployeeNumber;
|
||||
// String? currentUserName;
|
||||
// String? currentUserEmail;
|
||||
// String? currentFullName;
|
||||
// String? targetUserId;
|
||||
// String? targetEmployeeNumber;
|
||||
// String? targetUserName;
|
||||
// String? targetUserEmail;
|
||||
// String? targetFullName;
|
||||
// String? encryptedTargetUserId;
|
||||
// String? encryptedTargetUserName;
|
||||
// int? chatEventId;
|
||||
// String? fileTypeId;
|
||||
// bool? isSeen;
|
||||
// bool? isDelivered;
|
||||
// String? createdDate;
|
||||
// int? chatSource;
|
||||
// String? conversationId;
|
||||
// FileTypeResponse? fileTypeResponse;
|
||||
// String? userChatReplyResponse;
|
||||
// String? deviceToken;
|
||||
// bool? isHuaweiDevice;
|
||||
// String? platform;
|
||||
// String? voipToken;
|
||||
//
|
||||
// ChatHistoryResponse(
|
||||
// {this.userChatHistoryId,
|
||||
// this.userChatHistoryLineId,
|
||||
// this.contant,
|
||||
// this.contantNo,
|
||||
// this.currentUserId,
|
||||
// this.currentEmployeeNumber,
|
||||
// this.currentUserName,
|
||||
// this.currentUserEmail,
|
||||
// this.currentFullName,
|
||||
// this.targetUserId,
|
||||
// this.targetEmployeeNumber,
|
||||
// this.targetUserName,
|
||||
// this.targetUserEmail,
|
||||
// this.targetFullName,
|
||||
// this.encryptedTargetUserId,
|
||||
// this.encryptedTargetUserName,
|
||||
// this.chatEventId,
|
||||
// this.fileTypeId,
|
||||
// this.isSeen,
|
||||
// this.isDelivered,
|
||||
// this.createdDate,
|
||||
// this.chatSource,
|
||||
// this.conversationId,
|
||||
// this.fileTypeResponse,
|
||||
// this.userChatReplyResponse,
|
||||
// this.deviceToken,
|
||||
// this.isHuaweiDevice,
|
||||
// this.platform,
|
||||
// this.voipToken});
|
||||
//
|
||||
// ChatHistoryResponse.fromJson(Map<String, dynamic> json) {
|
||||
// userChatHistoryId = json['userChatHistoryId'];
|
||||
// userChatHistoryLineId = json['userChatHistoryLineId'];
|
||||
// contant = json['contant'];
|
||||
// contantNo = json['contantNo'];
|
||||
// currentUserId = json['currentUserId'];
|
||||
// currentEmployeeNumber = json['currentEmployeeNumber'];
|
||||
// currentUserName = json['currentUserName'];
|
||||
// currentUserEmail = json['currentUserEmail'];
|
||||
// currentFullName = json['currentFullName'];
|
||||
// targetUserId = json['targetUserId'];
|
||||
// targetEmployeeNumber = json['targetEmployeeNumber'];
|
||||
// targetUserName = json['targetUserName'];
|
||||
// targetUserEmail = json['targetUserEmail'];
|
||||
// targetFullName = json['targetFullName'];
|
||||
// encryptedTargetUserId = json['encryptedTargetUserId'];
|
||||
// encryptedTargetUserName = json['encryptedTargetUserName'];
|
||||
// chatEventId = json['chatEventId'];
|
||||
// fileTypeId = json['fileTypeId'];
|
||||
// isSeen = json['isSeen'];
|
||||
// isDelivered = json['isDelivered'];
|
||||
// createdDate = json['createdDate'];
|
||||
// chatSource = json['chatSource'];
|
||||
// conversationId = json['conversationId'];
|
||||
// fileTypeResponse = json['fileTypeResponse'] != null ? new FileTypeResponse.fromJson(json['fileTypeResponse']) : null;
|
||||
// userChatReplyResponse = json['userChatReplyResponse'];
|
||||
// deviceToken = json['deviceToken'];
|
||||
// isHuaweiDevice = json['isHuaweiDevice'];
|
||||
// platform = json['platform'];
|
||||
// voipToken = json['voipToken'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['userChatHistoryId'] = this.userChatHistoryId;
|
||||
// data['userChatHistoryLineId'] = this.userChatHistoryLineId;
|
||||
// data['contant'] = this.contant;
|
||||
// data['contantNo'] = this.contantNo;
|
||||
// data['currentUserId'] = this.currentUserId;
|
||||
// data['currentEmployeeNumber'] = this.currentEmployeeNumber;
|
||||
// data['currentUserName'] = this.currentUserName;
|
||||
// data['currentUserEmail'] = this.currentUserEmail;
|
||||
// data['currentFullName'] = this.currentFullName;
|
||||
// data['targetUserId'] = this.targetUserId;
|
||||
// data['targetEmployeeNumber'] = this.targetEmployeeNumber;
|
||||
// data['targetUserName'] = this.targetUserName;
|
||||
// data['targetUserEmail'] = this.targetUserEmail;
|
||||
// data['targetFullName'] = this.targetFullName;
|
||||
// data['encryptedTargetUserId'] = this.encryptedTargetUserId;
|
||||
// data['encryptedTargetUserName'] = this.encryptedTargetUserName;
|
||||
// data['chatEventId'] = this.chatEventId;
|
||||
// data['fileTypeId'] = this.fileTypeId;
|
||||
// data['isSeen'] = this.isSeen;
|
||||
// data['isDelivered'] = this.isDelivered;
|
||||
// data['createdDate'] = this.createdDate;
|
||||
// data['chatSource'] = this.chatSource;
|
||||
// data['conversationId'] = this.conversationId;
|
||||
// if (this.fileTypeResponse != null) {
|
||||
// data['fileTypeResponse'] = this.fileTypeResponse!.toJson();
|
||||
// }
|
||||
// data['userChatReplyResponse'] = this.userChatReplyResponse;
|
||||
// data['deviceToken'] = this.deviceToken;
|
||||
// data['isHuaweiDevice'] = this.isHuaweiDevice;
|
||||
// data['platform'] = this.platform;
|
||||
// data['voipToken'] = this.voipToken;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// class FileTypeResponse {
|
||||
// int? fileTypeId;
|
||||
// String? fileTypeName;
|
||||
// String? fileTypeDescription;
|
||||
// String? fileKind;
|
||||
// String? fileName;
|
||||
//
|
||||
// FileTypeResponse({this.fileTypeId, this.fileTypeName, this.fileTypeDescription, this.fileKind, this.fileName});
|
||||
//
|
||||
// FileTypeResponse.fromJson(Map<String, dynamic> json) {
|
||||
// fileTypeId = json['fileTypeId'];
|
||||
// fileTypeName = json['fileTypeName'];
|
||||
// fileTypeDescription = json['fileTypeDescription'];
|
||||
// fileKind = json['fileKind'];
|
||||
// fileName = json['fileName'];
|
||||
// }
|
||||
//
|
||||
// Map<String, dynamic> toJson() {
|
||||
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||
// data['fileTypeId'] = this.fileTypeId;
|
||||
// data['fileTypeName'] = this.fileTypeName;
|
||||
// data['fileTypeDescription'] = this.fileTypeDescription;
|
||||
// data['fileKind'] = this.fileKind;
|
||||
// data['fileName'] = this.fileName;
|
||||
// return data;
|
||||
// }
|
||||
// }
|
||||
|
||||
Loading…
Reference in New Issue