Browse Source

更新接口

loki.wu 2 years ago
parent
commit
a9b543f2ce

+ 4 - 1
lib/services/authentication.m.dart

@@ -197,7 +197,7 @@ enum CustomerRpcCode {
 	FileSavePathEmptyError,
 	InitStorageConfigError,
 	InitShareExamConfigError,
-	placeHolder_28,
+	NotificationParamError,
 	placeHolder_29,
 	placeHolder_30,
 	placeHolder_31,
@@ -6236,6 +6236,9 @@ enum CustomerRpcCode {
 	UserPasswordRepeatError,
 	SignatureUrlNotValid,
 	ASRError,
+	MessageCodeIsEmpty,
+	UpdateMessagesStatusFail,
+	MessageCodesIsEmpty,
 }
 
 class ValidateTokenResult {

+ 3 - 2
lib/services/device.dart

@@ -28,6 +28,7 @@ class DeviceService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => DictionaryDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => PageCollection<DeviceExtendInfoDTO>.fromJson(map));
 		FJsonConvert.setDecoder((map) => SelectItemDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => DeviceServerSettingResult.fromJson(map));
 		FJsonConvert.setDecoder((map) => DiagnosisModuleDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => ReportVideoDeviceInfoResult.fromJson(map));
 	}
@@ -121,9 +122,9 @@ class DeviceService extends JsonRpcClientBase {
 		return result;
 	}
 
-	Future<Map<String,String>> queryServerConfigAsync(TokenRequest request) async {
+	Future<DeviceServerSettingResult> queryServerConfigAsync(TokenRequest request) async {
 		var rpcRst = await call("QueryServerConfigAsync", request);
-		var result = (rpcRst as Map).cast<String,String>();
+		var result = DeviceServerSettingResult.fromJson(rpcRst as Map<String, dynamic>);
 		return result;
 	}
 

+ 46 - 0
lib/services/device.m.dart

@@ -807,6 +807,52 @@ class SelectItemDTO {
 	}
 }
 
+class DeviceServerSettingResult {
+	Map<String,String>? serverConfigList;
+	bool isUploadThumbnail;
+	OrganizationPatientTypeEnum patientType;
+	int heartRateSeconds;
+	String? notificationUrl;
+	bool mergedChannel;
+	int liveConsultationRateSeconds;
+
+	DeviceServerSettingResult({
+		this.serverConfigList,
+		this.isUploadThumbnail = false,
+		this.patientType = OrganizationPatientTypeEnum.Person,
+		this.heartRateSeconds = 0,
+		this.notificationUrl,
+		this.mergedChannel = false,
+		this.liveConsultationRateSeconds = 0,
+	});
+
+	factory DeviceServerSettingResult.fromJson(Map<String, dynamic> map) {
+		return DeviceServerSettingResult( 
+			serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast<String,String>() : null,
+			isUploadThumbnail: map['IsUploadThumbnail'],
+			patientType: OrganizationPatientTypeEnum.values.firstWhere((e) => e.index == map['PatientType']),
+			heartRateSeconds: map['HeartRateSeconds'],
+			notificationUrl: map['NotificationUrl'],
+			mergedChannel: map['MergedChannel'],
+			liveConsultationRateSeconds: map['LiveConsultationRateSeconds'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(serverConfigList != null)
+			map['ServerConfigList'] = serverConfigList;
+		map['IsUploadThumbnail'] = isUploadThumbnail;
+		map['PatientType'] = patientType.index;
+		map['HeartRateSeconds'] = heartRateSeconds;
+		if(notificationUrl != null)
+			map['NotificationUrl'] = notificationUrl;
+		map['MergedChannel'] = mergedChannel;
+		map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds;
+		return map;
+	}
+}
+
 class AddDeviceToOrgRequest extends TokenRequest{
 	String? uniqueCode;
 

+ 0 - 15
lib/services/liveConsultation.m.dart

@@ -1754,11 +1754,9 @@ class JoinLiveConsultationResult {
 
 class JoinLiveConsultationRequest extends TokenRequest{
 	String? consultationCode;
-	String? joinerCode;
 
 	JoinLiveConsultationRequest({
 		this.consultationCode,
-		this.joinerCode,
 		String? token,
 	}) : super(
 			token: token,
@@ -1767,7 +1765,6 @@ class JoinLiveConsultationRequest extends TokenRequest{
 	factory JoinLiveConsultationRequest.fromJson(Map<String, dynamic> map) {
 		return JoinLiveConsultationRequest( 
 			consultationCode: map['ConsultationCode'],
-			joinerCode: map['JoinerCode'],
 			token: map['Token'],
 		);
 	}
@@ -1776,8 +1773,6 @@ class JoinLiveConsultationRequest extends TokenRequest{
 		final map = super.toJson();
 		if(consultationCode != null)
 			map['ConsultationCode'] = consultationCode;
-		if(joinerCode != null)
-			map['JoinerCode'] = joinerCode;
 		return map;
 	}
 }
@@ -1920,11 +1915,9 @@ class LeaveLiveConsultationResult {
 
 class LeaveLiveConsultationRequest extends TokenRequest{
 	String? consultationCode;
-	String? leaverCode;
 
 	LeaveLiveConsultationRequest({
 		this.consultationCode,
-		this.leaverCode,
 		String? token,
 	}) : super(
 			token: token,
@@ -1933,7 +1926,6 @@ class LeaveLiveConsultationRequest extends TokenRequest{
 	factory LeaveLiveConsultationRequest.fromJson(Map<String, dynamic> map) {
 		return LeaveLiveConsultationRequest( 
 			consultationCode: map['ConsultationCode'],
-			leaverCode: map['LeaverCode'],
 			token: map['Token'],
 		);
 	}
@@ -1942,8 +1934,6 @@ class LeaveLiveConsultationRequest extends TokenRequest{
 		final map = super.toJson();
 		if(consultationCode != null)
 			map['ConsultationCode'] = consultationCode;
-		if(leaverCode != null)
-			map['LeaverCode'] = leaverCode;
 		return map;
 	}
 }
@@ -1971,12 +1961,10 @@ class MuteLiveConsultationResult {
 
 class MuteLiveConsultationRequest extends TokenRequest{
 	String? consultationCode;
-	String? memberCode;
 	bool mute;
 
 	MuteLiveConsultationRequest({
 		this.consultationCode,
-		this.memberCode,
 		this.mute = false,
 		String? token,
 	}) : super(
@@ -1986,7 +1974,6 @@ class MuteLiveConsultationRequest extends TokenRequest{
 	factory MuteLiveConsultationRequest.fromJson(Map<String, dynamic> map) {
 		return MuteLiveConsultationRequest( 
 			consultationCode: map['ConsultationCode'],
-			memberCode: map['MemberCode'],
 			mute: map['Mute'],
 			token: map['Token'],
 		);
@@ -1996,8 +1983,6 @@ class MuteLiveConsultationRequest extends TokenRequest{
 		final map = super.toJson();
 		if(consultationCode != null)
 			map['ConsultationCode'] = consultationCode;
-		if(memberCode != null)
-			map['MemberCode'] = memberCode;
 		map['Mute'] = mute;
 		return map;
 	}

File diff suppressed because it is too large
+ 306 - 139
lib/services/notification.m.dart


+ 22 - 0
lib/services/organization.m.dart

@@ -740,16 +740,31 @@ class ServerLangugeClass {
 class ServerSettingResult {
 	List<ServerLangugeClass >? serverLangugeList;
 	Map<String,String>? serverConfigList;
+	int heartRateSeconds;
+	int liveConsultationDefaultQueryDays;
+	String? notificationUrl;
+	int liveConsultationRateSeconds;
+	String? cMSUrl;
 
 	ServerSettingResult({
 		this.serverLangugeList,
 		this.serverConfigList,
+		this.heartRateSeconds = 0,
+		this.liveConsultationDefaultQueryDays = 0,
+		this.notificationUrl,
+		this.liveConsultationRateSeconds = 0,
+		this.cMSUrl,
 	});
 
 	factory ServerSettingResult.fromJson(Map<String, dynamic> map) {
 		return ServerSettingResult( 
 			serverLangugeList: map['ServerLangugeList'] != null ? (map['ServerLangugeList'] as List).map((e)=>ServerLangugeClass.fromJson(e as Map<String,dynamic>)).toList() : null,
 			serverConfigList: map['ServerConfigList'] != null ? map['ServerConfigList'].cast<String,String>() : null,
+			heartRateSeconds: map['HeartRateSeconds'],
+			liveConsultationDefaultQueryDays: map['LiveConsultationDefaultQueryDays'],
+			notificationUrl: map['NotificationUrl'],
+			liveConsultationRateSeconds: map['LiveConsultationRateSeconds'],
+			cMSUrl: map['CMSUrl'],
 		);
 	}
 
@@ -759,6 +774,13 @@ class ServerSettingResult {
 			map['ServerLangugeList'] = serverLangugeList;
 		if(serverConfigList != null)
 			map['ServerConfigList'] = serverConfigList;
+		map['HeartRateSeconds'] = heartRateSeconds;
+		map['LiveConsultationDefaultQueryDays'] = liveConsultationDefaultQueryDays;
+		if(notificationUrl != null)
+			map['NotificationUrl'] = notificationUrl;
+		map['LiveConsultationRateSeconds'] = liveConsultationRateSeconds;
+		if(cMSUrl != null)
+			map['CMSUrl'] = cMSUrl;
 		return map;
 	}
 }

+ 115 - 14
lib/services/other.m.dart

@@ -9,8 +9,8 @@ import 'recordInfo.m.dart';
 import 'aIDiagnosis.m.dart';
 import 'organization.m.dart';
 import 'lock.m.dart';
-import 'connect.m.dart';
 import 'device.m.dart';
+import 'connect.m.dart';
 import 'storage.m.dart';
 import 'report.m.dart';
 import 'vinnoServer.m.dart';
@@ -5641,14 +5641,6 @@ enum MessageCategoryEnum {
 	Course,
 }
 
-enum ApplicantTypeEnum {
-	Client,
-	Device,
-	Management,
-	ThirdParty,
-	Server,
-}
-
 enum BusinessModuleEnum {
 	placeHolder_0,
 	RemoteDiagnosis,
@@ -5660,11 +5652,6 @@ enum QueryCMSTemplateStatusTypeEnum {
 	Published,
 }
 
-enum QueryCMSMessageStatusEnum {
-	UnRead,
-	Read,
-}
-
 enum CMSMessageStatusEnum {
 	UnRead,
 	Read,
@@ -6822,6 +6809,15 @@ enum ReportTemplateQueryTypeEnum {
 	Organization,
 }
 
+enum TransactionTypeEnum {
+	placeHolder_0,
+	Consultion,
+	Chat,
+	Announcement,
+	Session,
+	RemoteDia,
+}
+
 enum ASETypeEnum {
 	Off,
 	Max,
@@ -8191,6 +8187,111 @@ class StatisticDetailSettingDTO {
 	}
 }
 
+class ClientInfoDTO {
+	String? clientId;
+	String? name;
+	bool isReaded;
+	DateTime? deliveryTime;
+	DateTime? readTime;
+
+	ClientInfoDTO({
+		this.clientId,
+		this.name,
+		this.isReaded = false,
+		this.deliveryTime,
+		this.readTime,
+	});
+
+	factory ClientInfoDTO.fromJson(Map<String, dynamic> map) {
+		return ClientInfoDTO( 
+			clientId: map['ClientId'],
+			name: map['Name'],
+			isReaded: map['IsReaded'],
+			deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
+			readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(clientId != null)
+			map['ClientId'] = clientId;
+		if(name != null)
+			map['Name'] = name;
+		map['IsReaded'] = isReaded;
+		if(deliveryTime != null)
+			map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
+		if(readTime != null)
+			map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
+		return map;
+	}
+}
+
+class MessageInfoDTO extends BaseDTO{
+	String? code;
+	NotificationTypeEnum notificationType;
+	String? content;
+	String? serverHost;
+	DateTime? notifyTime;
+	ApplicantTypeEnum receiverType;
+	TransactionTypeEnum transactionType;
+	String? relevanceCode;
+	List<ClientInfoDTO >? clientInfos;
+
+	MessageInfoDTO({
+		this.code,
+		this.notificationType = NotificationTypeEnum.Unknown,
+		this.content,
+		this.serverHost,
+		this.notifyTime,
+		this.receiverType = ApplicantTypeEnum.Client,
+		this.transactionType = TransactionTypeEnum.Consultion,
+		this.relevanceCode,
+		this.clientInfos,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory MessageInfoDTO.fromJson(Map<String, dynamic> map) {
+		return MessageInfoDTO( 
+			code: map['Code'],
+			notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
+			content: map['Content'],
+			serverHost: map['ServerHost'],
+			notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
+			receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
+			transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
+			relevanceCode: map['RelevanceCode'],
+			clientInfos: map['ClientInfos'] != null ? (map['ClientInfos'] as List).map((e)=>ClientInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(code != null)
+			map['Code'] = code;
+		map['NotificationType'] = notificationType.index;
+		if(content != null)
+			map['Content'] = content;
+		if(serverHost != null)
+			map['ServerHost'] = serverHost;
+		if(notifyTime != null)
+			map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
+		map['ReceiverType'] = receiverType.index;
+		map['TransactionType'] = transactionType.index;
+		if(relevanceCode != null)
+			map['RelevanceCode'] = relevanceCode;
+		if(clientInfos != null)
+			map['ClientInfos'] = clientInfos;
+		return map;
+	}
+}
+
 class OutputUnitDTO {
 	int unit;
 

+ 17 - 0
lib/services/user.dart

@@ -28,6 +28,7 @@ class UserService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => UserFeatureInfoResult.fromJson(map));
 		FJsonConvert.setDecoder((map) => UserInfoByCodeDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => ClientScheduleDTO.fromJson(map));
+		FJsonConvert.setDecoder((map) => MessageExtendInfoDTO.fromJson(map));
 	}
 
 	Future<bool> heartRateAsync(TokenRequest request) async {
@@ -106,5 +107,21 @@ class UserService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<List<MessageExtendInfoDTO>> getMessagesPageByCodeDBAsync(QueryMessageListRequest request) async {
+		var rpcRst = await call("GetMessagesPageByCodeDBAsync", request);
+		var result = (rpcRst as List).map((e)=>MessageExtendInfoDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
+	Future<bool> setMessageDeliveryAsync(SetMessageDeliveryRequest request) async {
+		var rpcRst = await call("SetMessageDeliveryAsync", request);
+		return rpcRst;
+	}
+
+	Future<bool> batchSetMessageStatusAsync(SetMessageInfoReqeust request) async {
+		var rpcRst = await call("BatchSetMessageStatusAsync", request);
+		return rpcRst;
+	}
+
 }
 

+ 187 - 0
lib/services/user.m.dart

@@ -1,5 +1,6 @@
 import 'liveConsultation.m.dart';
 import 'identityApply.m.dart';
+import 'notification.m.dart';
 
 import 'package:fis_jsonrpc/utils.dart';
 
@@ -982,4 +983,190 @@ class FindSchedulesRequest extends TokenRequest{
 	}
 }
 
+enum ApplicantTypeEnum {
+	Client,
+	Device,
+	Management,
+	ThirdParty,
+	Server,
+}
+
+class MessageExtendInfoDTO extends BaseDTO{
+	String? messageCode;
+	NotificationTypeEnum notificationType;
+	String? content;
+	DateTime? notifyTime;
+	ApplicantTypeEnum receiverType;
+	String? relevanceCode;
+	bool isReaded;
+	DateTime? deliveryTime;
+	DateTime? readTime;
+
+	MessageExtendInfoDTO({
+		this.messageCode,
+		this.notificationType = NotificationTypeEnum.Unknown,
+		this.content,
+		this.notifyTime,
+		this.receiverType = ApplicantTypeEnum.Client,
+		this.relevanceCode,
+		this.isReaded = false,
+		this.deliveryTime,
+		this.readTime,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory MessageExtendInfoDTO.fromJson(Map<String, dynamic> map) {
+		return MessageExtendInfoDTO( 
+			messageCode: map['MessageCode'],
+			notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
+			content: map['Content'],
+			notifyTime: map['NotifyTime'] != null ? DateTime.parse(map['NotifyTime']) : null,
+			receiverType: ApplicantTypeEnum.values.firstWhere((e) => e.index == map['ReceiverType']),
+			relevanceCode: map['RelevanceCode'],
+			isReaded: map['IsReaded'],
+			deliveryTime: map['DeliveryTime'] != null ? DateTime.parse(map['DeliveryTime']) : null,
+			readTime: map['ReadTime'] != null ? DateTime.parse(map['ReadTime']) : null,
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			updateTime: map['UpdateTime'] != null ? DateTime.parse(map['UpdateTime']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(messageCode != null)
+			map['MessageCode'] = messageCode;
+		map['NotificationType'] = notificationType.index;
+		if(content != null)
+			map['Content'] = content;
+		if(notifyTime != null)
+			map['NotifyTime'] = JsonRpcUtils.dateFormat(notifyTime!);
+		map['ReceiverType'] = receiverType.index;
+		if(relevanceCode != null)
+			map['RelevanceCode'] = relevanceCode;
+		map['IsReaded'] = isReaded;
+		if(deliveryTime != null)
+			map['DeliveryTime'] = JsonRpcUtils.dateFormat(deliveryTime!);
+		if(readTime != null)
+			map['ReadTime'] = JsonRpcUtils.dateFormat(readTime!);
+		return map;
+	}
+}
+
+enum QueryCMSMessageStatusEnum {
+	UnRead,
+	Read,
+}
+
+class QueryMessageListRequest extends PageRequest{
+	QueryCMSMessageStatusEnum status;
+	String? keyword;
+	DateTime? startTime;
+	DateTime? endTime;
+	NotificationTypeEnum notificationType;
+	String? relevanceCode;
+
+	QueryMessageListRequest({
+		this.status = QueryCMSMessageStatusEnum.UnRead,
+		this.keyword,
+		this.startTime,
+		this.endTime,
+		this.notificationType = NotificationTypeEnum.Unknown,
+		this.relevanceCode,
+		int pageIndex = 0,
+		int pageSize = 0,
+		String? token,
+	}) : super(
+			pageIndex: pageIndex,
+			pageSize: pageSize,
+			token: token,
+		);
+
+	factory QueryMessageListRequest.fromJson(Map<String, dynamic> map) {
+		return QueryMessageListRequest( 
+			status: QueryCMSMessageStatusEnum.values.firstWhere((e) => e.index == map['Status']),
+			keyword: map['Keyword'],
+			startTime: map['StartTime'] != null ? DateTime.parse(map['StartTime']) : null,
+			endTime: map['EndTime'] != null ? DateTime.parse(map['EndTime']) : null,
+			notificationType: NotificationTypeEnum.values.firstWhere((e) => e.index == map['NotificationType']),
+			relevanceCode: map['RelevanceCode'],
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['Status'] = status.index;
+		if(keyword != null)
+			map['Keyword'] = keyword;
+		if(startTime != null)
+			map['StartTime'] = JsonRpcUtils.dateFormat(startTime!);
+		if(endTime != null)
+			map['EndTime'] = JsonRpcUtils.dateFormat(endTime!);
+		map['NotificationType'] = notificationType.index;
+		if(relevanceCode != null)
+			map['RelevanceCode'] = relevanceCode;
+		return map;
+	}
+}
+
+class SetMessageDeliveryRequest extends TokenRequest{
+	String? messageCode;
+	bool isReaded;
+
+	SetMessageDeliveryRequest({
+		this.messageCode,
+		this.isReaded = false,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory SetMessageDeliveryRequest.fromJson(Map<String, dynamic> map) {
+		return SetMessageDeliveryRequest( 
+			messageCode: map['MessageCode'],
+			isReaded: map['IsReaded'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(messageCode != null)
+			map['MessageCode'] = messageCode;
+		map['IsReaded'] = isReaded;
+		return map;
+	}
+}
+
+class SetMessageInfoReqeust extends TokenRequest{
+	List<String >? messageCodes;
+
+	SetMessageInfoReqeust({
+		this.messageCodes,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory SetMessageInfoReqeust.fromJson(Map<String, dynamic> map) {
+		return SetMessageInfoReqeust( 
+			messageCodes: map['MessageCodes'] != null ? map['MessageCodes'].cast<String>().toList() : null,
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(messageCodes != null)
+			map['MessageCodes'] = messageCodes;
+		return map;
+	}
+}
+
 

Some files were not shown because too many files changed in this diff