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 {
|
// class UserChatHistoryModel {
|
||||||
List<ChatResponse>? response;
|
// List<ChatResponse>? response;
|
||||||
bool? isSuccess;
|
// bool? isSuccess;
|
||||||
List<String>? onlineUserConnId;
|
// List<String>? onlineUserConnId;
|
||||||
|
//
|
||||||
UserChatHistoryModel({this.response, this.isSuccess, this.onlineUserConnId});
|
// UserChatHistoryModel({this.response, this.isSuccess, this.onlineUserConnId});
|
||||||
|
//
|
||||||
UserChatHistoryModel.fromJson(Map<String, dynamic> json) {
|
// UserChatHistoryModel.fromJson(Map<String, dynamic> json) {
|
||||||
if (json['response'] != null) {
|
// if (json['response'] != null) {
|
||||||
response = <ChatResponse>[];
|
// response = <ChatResponse>[];
|
||||||
json['response'].forEach((v) {
|
// json['response'].forEach((v) {
|
||||||
response!.add(new ChatResponse.fromJson(v));
|
// response!.add(new ChatResponse.fromJson(v));
|
||||||
});
|
// });
|
||||||
}
|
// }
|
||||||
isSuccess = json['isSuccess'];
|
// isSuccess = json['isSuccess'];
|
||||||
onlineUserConnId = json['onlineUserConnId'].cast<String>();
|
// onlineUserConnId = json['onlineUserConnId'].cast<String>();
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Map<String, dynamic> toJson() {
|
// Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
if (this.response != null) {
|
// if (this.response != null) {
|
||||||
data['response'] = this.response!.map((v) => v.toJson()).toList();
|
// data['response'] = this.response!.map((v) => v.toJson()).toList();
|
||||||
}
|
// }
|
||||||
data['isSuccess'] = this.isSuccess;
|
// data['isSuccess'] = this.isSuccess;
|
||||||
data['onlineUserConnId'] = this.onlineUserConnId;
|
// data['onlineUserConnId'] = this.onlineUserConnId;
|
||||||
return data;
|
// return data;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class ChatResponse {
|
// class ChatResponse {
|
||||||
int? id;
|
// int? id;
|
||||||
int? conversationId;
|
// int? conversationId;
|
||||||
String? userId;
|
// String? userId;
|
||||||
int? userIdInt;
|
// int? userIdInt;
|
||||||
String? userName;
|
// String? userName;
|
||||||
String? content;
|
// String? content;
|
||||||
String? messageType;
|
// String? messageType;
|
||||||
String? createdAt;
|
// String? createdAt;
|
||||||
|
//
|
||||||
ChatResponse({this.id, this.conversationId, this.userId, this.userIdInt, this.userName, this.content, this.messageType, this.createdAt});
|
// ChatResponse({this.id, this.conversationId, this.userId, this.userIdInt, this.userName, this.content, this.messageType, this.createdAt});
|
||||||
|
//
|
||||||
ChatResponse.fromJson(Map<String, dynamic> json) {
|
// ChatResponse.fromJson(Map<String, dynamic> json) {
|
||||||
id = json['id'];
|
// id = json['id'];
|
||||||
conversationId = json['conversationId'];
|
// conversationId = json['conversationId'];
|
||||||
userId = json['userId'];
|
// userId = json['userId'];
|
||||||
userIdInt = json['userIdInt'];
|
// userIdInt = json['userIdInt'];
|
||||||
userName = json['userName'];
|
// userName = json['userName'];
|
||||||
content = json['content'];
|
// content = json['content'];
|
||||||
messageType = json['messageType'];
|
// messageType = json['messageType'];
|
||||||
createdAt = json['createdAt'];
|
// createdAt = json['createdAt'];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Map<String, dynamic> toJson() {
|
// Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['id'] = this.id;
|
// data['id'] = this.id;
|
||||||
data['conversationId'] = this.conversationId;
|
// data['conversationId'] = this.conversationId;
|
||||||
data['userId'] = this.userId;
|
// data['userId'] = this.userId;
|
||||||
data['userIdInt'] = this.userIdInt;
|
// data['userIdInt'] = this.userIdInt;
|
||||||
data['userName'] = this.userName;
|
// data['userName'] = this.userName;
|
||||||
data['content'] = this.content;
|
// data['content'] = this.content;
|
||||||
data['messageType'] = this.messageType;
|
// data['messageType'] = this.messageType;
|
||||||
data['createdAt'] = this.createdAt;
|
// data['createdAt'] = this.createdAt;
|
||||||
return data;
|
// return data;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class ChatHistoryResponse {
|
// class ChatHistoryResponse {
|
||||||
int? userChatHistoryId;
|
// int? userChatHistoryId;
|
||||||
int? userChatHistoryLineId;
|
// int? userChatHistoryLineId;
|
||||||
String? contant;
|
// String? contant;
|
||||||
String? contantNo;
|
// String? contantNo;
|
||||||
String? currentUserId;
|
// String? currentUserId;
|
||||||
String? currentEmployeeNumber;
|
// String? currentEmployeeNumber;
|
||||||
String? currentUserName;
|
// String? currentUserName;
|
||||||
String? currentUserEmail;
|
// String? currentUserEmail;
|
||||||
String? currentFullName;
|
// String? currentFullName;
|
||||||
String? targetUserId;
|
// String? targetUserId;
|
||||||
String? targetEmployeeNumber;
|
// String? targetEmployeeNumber;
|
||||||
String? targetUserName;
|
// String? targetUserName;
|
||||||
String? targetUserEmail;
|
// String? targetUserEmail;
|
||||||
String? targetFullName;
|
// String? targetFullName;
|
||||||
String? encryptedTargetUserId;
|
// String? encryptedTargetUserId;
|
||||||
String? encryptedTargetUserName;
|
// String? encryptedTargetUserName;
|
||||||
int? chatEventId;
|
// int? chatEventId;
|
||||||
String? fileTypeId;
|
// String? fileTypeId;
|
||||||
bool? isSeen;
|
// bool? isSeen;
|
||||||
bool? isDelivered;
|
// bool? isDelivered;
|
||||||
String? createdDate;
|
// String? createdDate;
|
||||||
int? chatSource;
|
// int? chatSource;
|
||||||
String? conversationId;
|
// String? conversationId;
|
||||||
FileTypeResponse? fileTypeResponse;
|
// FileTypeResponse? fileTypeResponse;
|
||||||
String? userChatReplyResponse;
|
// String? userChatReplyResponse;
|
||||||
String? deviceToken;
|
// String? deviceToken;
|
||||||
bool? isHuaweiDevice;
|
// bool? isHuaweiDevice;
|
||||||
String? platform;
|
// String? platform;
|
||||||
String? voipToken;
|
// String? voipToken;
|
||||||
|
//
|
||||||
ChatHistoryResponse(
|
// ChatHistoryResponse(
|
||||||
{this.userChatHistoryId,
|
// {this.userChatHistoryId,
|
||||||
this.userChatHistoryLineId,
|
// this.userChatHistoryLineId,
|
||||||
this.contant,
|
// this.contant,
|
||||||
this.contantNo,
|
// this.contantNo,
|
||||||
this.currentUserId,
|
// this.currentUserId,
|
||||||
this.currentEmployeeNumber,
|
// this.currentEmployeeNumber,
|
||||||
this.currentUserName,
|
// this.currentUserName,
|
||||||
this.currentUserEmail,
|
// this.currentUserEmail,
|
||||||
this.currentFullName,
|
// this.currentFullName,
|
||||||
this.targetUserId,
|
// this.targetUserId,
|
||||||
this.targetEmployeeNumber,
|
// this.targetEmployeeNumber,
|
||||||
this.targetUserName,
|
// this.targetUserName,
|
||||||
this.targetUserEmail,
|
// this.targetUserEmail,
|
||||||
this.targetFullName,
|
// this.targetFullName,
|
||||||
this.encryptedTargetUserId,
|
// this.encryptedTargetUserId,
|
||||||
this.encryptedTargetUserName,
|
// this.encryptedTargetUserName,
|
||||||
this.chatEventId,
|
// this.chatEventId,
|
||||||
this.fileTypeId,
|
// this.fileTypeId,
|
||||||
this.isSeen,
|
// this.isSeen,
|
||||||
this.isDelivered,
|
// this.isDelivered,
|
||||||
this.createdDate,
|
// this.createdDate,
|
||||||
this.chatSource,
|
// this.chatSource,
|
||||||
this.conversationId,
|
// this.conversationId,
|
||||||
this.fileTypeResponse,
|
// this.fileTypeResponse,
|
||||||
this.userChatReplyResponse,
|
// this.userChatReplyResponse,
|
||||||
this.deviceToken,
|
// this.deviceToken,
|
||||||
this.isHuaweiDevice,
|
// this.isHuaweiDevice,
|
||||||
this.platform,
|
// this.platform,
|
||||||
this.voipToken});
|
// this.voipToken});
|
||||||
|
//
|
||||||
ChatHistoryResponse.fromJson(Map<String, dynamic> json) {
|
// ChatHistoryResponse.fromJson(Map<String, dynamic> json) {
|
||||||
userChatHistoryId = json['userChatHistoryId'];
|
// userChatHistoryId = json['userChatHistoryId'];
|
||||||
userChatHistoryLineId = json['userChatHistoryLineId'];
|
// userChatHistoryLineId = json['userChatHistoryLineId'];
|
||||||
contant = json['contant'];
|
// contant = json['contant'];
|
||||||
contantNo = json['contantNo'];
|
// contantNo = json['contantNo'];
|
||||||
currentUserId = json['currentUserId'];
|
// currentUserId = json['currentUserId'];
|
||||||
currentEmployeeNumber = json['currentEmployeeNumber'];
|
// currentEmployeeNumber = json['currentEmployeeNumber'];
|
||||||
currentUserName = json['currentUserName'];
|
// currentUserName = json['currentUserName'];
|
||||||
currentUserEmail = json['currentUserEmail'];
|
// currentUserEmail = json['currentUserEmail'];
|
||||||
currentFullName = json['currentFullName'];
|
// currentFullName = json['currentFullName'];
|
||||||
targetUserId = json['targetUserId'];
|
// targetUserId = json['targetUserId'];
|
||||||
targetEmployeeNumber = json['targetEmployeeNumber'];
|
// targetEmployeeNumber = json['targetEmployeeNumber'];
|
||||||
targetUserName = json['targetUserName'];
|
// targetUserName = json['targetUserName'];
|
||||||
targetUserEmail = json['targetUserEmail'];
|
// targetUserEmail = json['targetUserEmail'];
|
||||||
targetFullName = json['targetFullName'];
|
// targetFullName = json['targetFullName'];
|
||||||
encryptedTargetUserId = json['encryptedTargetUserId'];
|
// encryptedTargetUserId = json['encryptedTargetUserId'];
|
||||||
encryptedTargetUserName = json['encryptedTargetUserName'];
|
// encryptedTargetUserName = json['encryptedTargetUserName'];
|
||||||
chatEventId = json['chatEventId'];
|
// chatEventId = json['chatEventId'];
|
||||||
fileTypeId = json['fileTypeId'];
|
// fileTypeId = json['fileTypeId'];
|
||||||
isSeen = json['isSeen'];
|
// isSeen = json['isSeen'];
|
||||||
isDelivered = json['isDelivered'];
|
// isDelivered = json['isDelivered'];
|
||||||
createdDate = json['createdDate'];
|
// createdDate = json['createdDate'];
|
||||||
chatSource = json['chatSource'];
|
// chatSource = json['chatSource'];
|
||||||
conversationId = json['conversationId'];
|
// conversationId = json['conversationId'];
|
||||||
fileTypeResponse = json['fileTypeResponse'] != null ? new FileTypeResponse.fromJson(json['fileTypeResponse']) : null;
|
// fileTypeResponse = json['fileTypeResponse'] != null ? new FileTypeResponse.fromJson(json['fileTypeResponse']) : null;
|
||||||
userChatReplyResponse = json['userChatReplyResponse'];
|
// userChatReplyResponse = json['userChatReplyResponse'];
|
||||||
deviceToken = json['deviceToken'];
|
// deviceToken = json['deviceToken'];
|
||||||
isHuaweiDevice = json['isHuaweiDevice'];
|
// isHuaweiDevice = json['isHuaweiDevice'];
|
||||||
platform = json['platform'];
|
// platform = json['platform'];
|
||||||
voipToken = json['voipToken'];
|
// voipToken = json['voipToken'];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Map<String, dynamic> toJson() {
|
// Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['userChatHistoryId'] = this.userChatHistoryId;
|
// data['userChatHistoryId'] = this.userChatHistoryId;
|
||||||
data['userChatHistoryLineId'] = this.userChatHistoryLineId;
|
// data['userChatHistoryLineId'] = this.userChatHistoryLineId;
|
||||||
data['contant'] = this.contant;
|
// data['contant'] = this.contant;
|
||||||
data['contantNo'] = this.contantNo;
|
// data['contantNo'] = this.contantNo;
|
||||||
data['currentUserId'] = this.currentUserId;
|
// data['currentUserId'] = this.currentUserId;
|
||||||
data['currentEmployeeNumber'] = this.currentEmployeeNumber;
|
// data['currentEmployeeNumber'] = this.currentEmployeeNumber;
|
||||||
data['currentUserName'] = this.currentUserName;
|
// data['currentUserName'] = this.currentUserName;
|
||||||
data['currentUserEmail'] = this.currentUserEmail;
|
// data['currentUserEmail'] = this.currentUserEmail;
|
||||||
data['currentFullName'] = this.currentFullName;
|
// data['currentFullName'] = this.currentFullName;
|
||||||
data['targetUserId'] = this.targetUserId;
|
// data['targetUserId'] = this.targetUserId;
|
||||||
data['targetEmployeeNumber'] = this.targetEmployeeNumber;
|
// data['targetEmployeeNumber'] = this.targetEmployeeNumber;
|
||||||
data['targetUserName'] = this.targetUserName;
|
// data['targetUserName'] = this.targetUserName;
|
||||||
data['targetUserEmail'] = this.targetUserEmail;
|
// data['targetUserEmail'] = this.targetUserEmail;
|
||||||
data['targetFullName'] = this.targetFullName;
|
// data['targetFullName'] = this.targetFullName;
|
||||||
data['encryptedTargetUserId'] = this.encryptedTargetUserId;
|
// data['encryptedTargetUserId'] = this.encryptedTargetUserId;
|
||||||
data['encryptedTargetUserName'] = this.encryptedTargetUserName;
|
// data['encryptedTargetUserName'] = this.encryptedTargetUserName;
|
||||||
data['chatEventId'] = this.chatEventId;
|
// data['chatEventId'] = this.chatEventId;
|
||||||
data['fileTypeId'] = this.fileTypeId;
|
// data['fileTypeId'] = this.fileTypeId;
|
||||||
data['isSeen'] = this.isSeen;
|
// data['isSeen'] = this.isSeen;
|
||||||
data['isDelivered'] = this.isDelivered;
|
// data['isDelivered'] = this.isDelivered;
|
||||||
data['createdDate'] = this.createdDate;
|
// data['createdDate'] = this.createdDate;
|
||||||
data['chatSource'] = this.chatSource;
|
// data['chatSource'] = this.chatSource;
|
||||||
data['conversationId'] = this.conversationId;
|
// data['conversationId'] = this.conversationId;
|
||||||
if (this.fileTypeResponse != null) {
|
// if (this.fileTypeResponse != null) {
|
||||||
data['fileTypeResponse'] = this.fileTypeResponse!.toJson();
|
// data['fileTypeResponse'] = this.fileTypeResponse!.toJson();
|
||||||
}
|
// }
|
||||||
data['userChatReplyResponse'] = this.userChatReplyResponse;
|
// data['userChatReplyResponse'] = this.userChatReplyResponse;
|
||||||
data['deviceToken'] = this.deviceToken;
|
// data['deviceToken'] = this.deviceToken;
|
||||||
data['isHuaweiDevice'] = this.isHuaweiDevice;
|
// data['isHuaweiDevice'] = this.isHuaweiDevice;
|
||||||
data['platform'] = this.platform;
|
// data['platform'] = this.platform;
|
||||||
data['voipToken'] = this.voipToken;
|
// data['voipToken'] = this.voipToken;
|
||||||
return data;
|
// return data;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
class FileTypeResponse {
|
// class FileTypeResponse {
|
||||||
int? fileTypeId;
|
// int? fileTypeId;
|
||||||
String? fileTypeName;
|
// String? fileTypeName;
|
||||||
String? fileTypeDescription;
|
// String? fileTypeDescription;
|
||||||
String? fileKind;
|
// String? fileKind;
|
||||||
String? fileName;
|
// String? fileName;
|
||||||
|
//
|
||||||
FileTypeResponse({this.fileTypeId, this.fileTypeName, this.fileTypeDescription, this.fileKind, this.fileName});
|
// FileTypeResponse({this.fileTypeId, this.fileTypeName, this.fileTypeDescription, this.fileKind, this.fileName});
|
||||||
|
//
|
||||||
FileTypeResponse.fromJson(Map<String, dynamic> json) {
|
// FileTypeResponse.fromJson(Map<String, dynamic> json) {
|
||||||
fileTypeId = json['fileTypeId'];
|
// fileTypeId = json['fileTypeId'];
|
||||||
fileTypeName = json['fileTypeName'];
|
// fileTypeName = json['fileTypeName'];
|
||||||
fileTypeDescription = json['fileTypeDescription'];
|
// fileTypeDescription = json['fileTypeDescription'];
|
||||||
fileKind = json['fileKind'];
|
// fileKind = json['fileKind'];
|
||||||
fileName = json['fileName'];
|
// fileName = json['fileName'];
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
Map<String, dynamic> toJson() {
|
// Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
// final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
data['fileTypeId'] = this.fileTypeId;
|
// data['fileTypeId'] = this.fileTypeId;
|
||||||
data['fileTypeName'] = this.fileTypeName;
|
// data['fileTypeName'] = this.fileTypeName;
|
||||||
data['fileTypeDescription'] = this.fileTypeDescription;
|
// data['fileTypeDescription'] = this.fileTypeDescription;
|
||||||
data['fileKind'] = this.fileKind;
|
// data['fileKind'] = this.fileKind;
|
||||||
data['fileName'] = this.fileName;
|
// data['fileName'] = this.fileName;
|
||||||
return data;
|
// return data;
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|||||||
Loading…
Reference in New Issue