Browse Source

更新接口

gavin.chen 2 years ago
parent
commit
8ccb8234fa

+ 39 - 0
lib/services/lock.dart

@@ -0,0 +1,39 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'lock.m.dart';
+
+
+class LockService extends JsonRpcClientBase {
+	LockService(
+		String host, {
+		String serviceName = "ILockService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => ApplyLockResult.fromJson(map));
+		FJsonConvert.setDecoder((map) => ReleaseLockResult.fromJson(map));
+	}
+
+	Future<ApplyLockResult> applyLockAsync(ApplyLockRequest request) async {
+		var rpcRst = await call("ApplyLockAsync", request);
+		var result = ApplyLockResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<ReleaseLockResult> releaseLockAsync(ReleaseLockRequest request) async {
+		var rpcRst = await call("ReleaseLockAsync", request);
+		var result = ReleaseLockResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+}
+

+ 88 - 0
lib/services/lock.m.dart

@@ -0,0 +1,88 @@
+class ApplyLockResult {
+	bool isSuccess;
+	String? lockUniqueCode;
+
+	ApplyLockResult({
+		this.isSuccess = false,
+		this.lockUniqueCode,
+	});
+
+	factory ApplyLockResult.fromJson(Map<String, dynamic> map) {
+		return ApplyLockResult( 
+			isSuccess: map['IsSuccess'],
+			lockUniqueCode: map['LockUniqueCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['IsSuccess'] = isSuccess;
+		if(lockUniqueCode != null)
+			map['LockUniqueCode'] = lockUniqueCode;
+		return map;
+	}
+}
+
+class ApplyLockRequest {
+	String? lockKey;
+
+	ApplyLockRequest({
+		this.lockKey,
+	});
+
+	factory ApplyLockRequest.fromJson(Map<String, dynamic> map) {
+		return ApplyLockRequest( 
+			lockKey: map['LockKey'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(lockKey != null)
+			map['LockKey'] = lockKey;
+		return map;
+	}
+}
+
+class ReleaseLockResult {
+	bool isSuccess;
+
+	ReleaseLockResult({
+		this.isSuccess = false,
+	});
+
+	factory ReleaseLockResult.fromJson(Map<String, dynamic> map) {
+		return ReleaseLockResult( 
+			isSuccess: map['IsSuccess'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['IsSuccess'] = isSuccess;
+		return map;
+	}
+}
+
+class ReleaseLockRequest {
+	String? lockUniqueCode;
+
+	ReleaseLockRequest({
+		this.lockUniqueCode,
+	});
+
+	factory ReleaseLockRequest.fromJson(Map<String, dynamic> map) {
+		return ReleaseLockRequest( 
+			lockUniqueCode: map['LockUniqueCode'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(lockUniqueCode != null)
+			map['LockUniqueCode'] = lockUniqueCode;
+		return map;
+	}
+}
+
+

+ 48 - 0
lib/services/masterInteractionCenter.dart

@@ -0,0 +1,48 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'masterInteractionCenter.m.dart';
+
+
+class MasterInteractionCenterService extends JsonRpcClientBase {
+	MasterInteractionCenterService(
+		String host, {
+		String serviceName = "IMasterInteractionCenterService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => OperationLogDTO.fromJson(map));
+	}
+
+	Future<List<OperationLogDTO>> getOpLogsFromMasterAsync(GetOpLogsFormMasterRequest request) async {
+		var rpcRst = await call("GetOpLogsFromMasterAsync", request);
+		var result = (rpcRst as List).map((e)=>OperationLogDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
+	Future<List<OperationLogDTO>> getOpLogsByCodesFromMasterAsync(GetOpLogsByCodesFormMasterRequest request) async {
+		var rpcRst = await call("GetOpLogsByCodesFromMasterAsync", request);
+		var result = (rpcRst as List).map((e)=>OperationLogDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
+	Future<bool> syncOpLogToMasterAsync(SyncOpLogToMasterRequest request) async {
+		var rpcRst = await call("SyncOpLogToMasterAsync", request);
+		return rpcRst;
+	}
+
+	Future<bool> syncReceiveSlaveServiceDataAsync(SyncReceiveServiceDataRequest request) async {
+		var rpcRst = await call("SyncReceiveSlaveServiceDataAsync", request);
+		return rpcRst;
+	}
+
+}
+

+ 249 - 0
lib/services/masterInteractionCenter.m.dart

@@ -0,0 +1,249 @@
+import 'package:fis_jsonrpc/utils.dart';
+
+enum MongoDBActionTypeEnum {
+	InsertOne,
+	InsertOneAsync,
+	InsertMany,
+	InsertManyAsync,
+	DeleteOne,
+	DeleteOneAsync,
+	DeleteMany,
+	DeleteManyAsync,
+	FindOneAndDelete,
+	FindOneAndDeleteAsync,
+	ReplaceOne,
+	ReplaceOneAsync,
+	FindOneAndReplace,
+	FindOneAndReplaceAsync,
+	UpdateOne,
+	UpdateOneAsync,
+	UpdateMany,
+	UpdateManyAsync,
+	FindOneAndUpdate,
+	FindOneAndUpdateAsync,
+}
+
+class OperationLogDTO {
+	int id;
+	String? collectionName;
+	MongoDBActionTypeEnum actionType;
+	String? bsonContent;
+	String? filterContent;
+	DateTime? createTime;
+	String? code;
+	String? sourceUrl;
+	bool isSimple;
+
+	OperationLogDTO({
+		this.id = 0,
+		this.collectionName,
+		this.actionType = MongoDBActionTypeEnum.InsertOne,
+		this.bsonContent,
+		this.filterContent,
+		this.createTime,
+		this.code,
+		this.sourceUrl,
+		this.isSimple = false,
+	});
+
+	factory OperationLogDTO.fromJson(Map<String, dynamic> map) {
+		return OperationLogDTO( 
+			id: map['Id'],
+			collectionName: map['CollectionName'],
+			actionType: MongoDBActionTypeEnum.values.firstWhere((e) => e.index == map['ActionType']),
+			bsonContent: map['BsonContent'],
+			filterContent: map['FilterContent'],
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			code: map['Code'],
+			sourceUrl: map['SourceUrl'],
+			isSimple: map['IsSimple'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['Id'] = id;
+		if(collectionName != null)
+			map['CollectionName'] = collectionName;
+		map['ActionType'] = actionType.index;
+		if(bsonContent != null)
+			map['BsonContent'] = bsonContent;
+		if(filterContent != null)
+			map['FilterContent'] = filterContent;
+		if(createTime != null)
+			map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
+		if(code != null)
+			map['Code'] = code;
+		if(sourceUrl != null)
+			map['SourceUrl'] = sourceUrl;
+		map['IsSimple'] = isSimple;
+		return map;
+	}
+}
+
+class GetOpLogsFormMasterRequest {
+	int cursor;
+	String? sourceUrl;
+
+	GetOpLogsFormMasterRequest({
+		this.cursor = 0,
+		this.sourceUrl,
+	});
+
+	factory GetOpLogsFormMasterRequest.fromJson(Map<String, dynamic> map) {
+		return GetOpLogsFormMasterRequest( 
+			cursor: map['Cursor'],
+			sourceUrl: map['SourceUrl'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['Cursor'] = cursor;
+		if(sourceUrl != null)
+			map['SourceUrl'] = sourceUrl;
+		return map;
+	}
+}
+
+class GetOpLogsByCodesFormMasterRequest {
+	List<String >? codes;
+
+	GetOpLogsByCodesFormMasterRequest({
+		this.codes,
+	});
+
+	factory GetOpLogsByCodesFormMasterRequest.fromJson(Map<String, dynamic> map) {
+		return GetOpLogsByCodesFormMasterRequest( 
+			codes: map['Codes'] != null ? map['Codes'].cast<String>().toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(codes != null)
+			map['Codes'] = codes;
+		return map;
+	}
+}
+
+class SyncOpLogToMasterRequest {
+	String? collectionName;
+	MongoDBActionTypeEnum actionType;
+	String? bsonContent;
+	String? filterContent;
+	DateTime? createTime;
+	String? sourceUrl;
+	String? code;
+	String? serverID;
+	bool isSimple;
+
+	SyncOpLogToMasterRequest({
+		this.collectionName,
+		this.actionType = MongoDBActionTypeEnum.InsertOne,
+		this.bsonContent,
+		this.filterContent,
+		this.createTime,
+		this.sourceUrl,
+		this.code,
+		this.serverID,
+		this.isSimple = false,
+	});
+
+	factory SyncOpLogToMasterRequest.fromJson(Map<String, dynamic> map) {
+		return SyncOpLogToMasterRequest( 
+			collectionName: map['CollectionName'],
+			actionType: MongoDBActionTypeEnum.values.firstWhere((e) => e.index == map['ActionType']),
+			bsonContent: map['BsonContent'],
+			filterContent: map['FilterContent'],
+			createTime: map['CreateTime'] != null ? DateTime.parse(map['CreateTime']) : null,
+			sourceUrl: map['SourceUrl'],
+			code: map['Code'],
+			serverID: map['ServerID'],
+			isSimple: map['IsSimple'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(collectionName != null)
+			map['CollectionName'] = collectionName;
+		map['ActionType'] = actionType.index;
+		if(bsonContent != null)
+			map['BsonContent'] = bsonContent;
+		if(filterContent != null)
+			map['FilterContent'] = filterContent;
+		if(createTime != null)
+			map['CreateTime'] = JsonRpcUtils.dateFormat(createTime!);
+		if(sourceUrl != null)
+			map['SourceUrl'] = sourceUrl;
+		if(code != null)
+			map['Code'] = code;
+		if(serverID != null)
+			map['ServerID'] = serverID;
+		map['IsSimple'] = isSimple;
+		return map;
+	}
+}
+
+enum SyncTypeEnum {
+	Initiate,
+	Accept,
+	Reject,
+	CancelInitiate,
+	HeartRateJoin,
+	NetworkErr,
+	HeartRateLeave,
+	Leave,
+	Close,
+	ChangeMuteState,
+	ChangeVideoOpenState,
+	InviteIn,
+	CancelInviteIn,
+	AcceptIn,
+	RejectIn,
+	ChangeConsultationStatus,
+	Agree,
+}
+
+class SyncReceiveServiceDataRequest {
+	SyncTypeEnum syncType;
+	String? serviceDataJson;
+	List<OperationLogDTO >? oplogs;
+	String? sourceUrl;
+	String? serverID;
+
+	SyncReceiveServiceDataRequest({
+		this.syncType = SyncTypeEnum.Initiate,
+		this.serviceDataJson,
+		this.oplogs,
+		this.sourceUrl,
+		this.serverID,
+	});
+
+	factory SyncReceiveServiceDataRequest.fromJson(Map<String, dynamic> map) {
+		return SyncReceiveServiceDataRequest( 
+			syncType: SyncTypeEnum.values.firstWhere((e) => e.index == map['SyncType']),
+			serviceDataJson: map['ServiceDataJson'],
+			oplogs: map['Oplogs'] != null ? (map['Oplogs'] as List).map((e)=>OperationLogDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+			sourceUrl: map['SourceUrl'],
+			serverID: map['ServerID'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['SyncType'] = syncType.index;
+		if(serviceDataJson != null)
+			map['ServiceDataJson'] = serviceDataJson;
+		if(oplogs != null)
+			map['Oplogs'] = oplogs;
+		if(sourceUrl != null)
+			map['SourceUrl'] = sourceUrl;
+		if(serverID != null)
+			map['ServerID'] = serverID;
+		return map;
+	}
+}
+
+

+ 305 - 0
lib/services/platform.dart

@@ -0,0 +1,305 @@
+import 'package:fis_common/json_convert.dart';
+
+import '../client_base.dart';
+import 'platform.m.dart';
+
+/// 平台服务
+class PlatformService extends JsonRpcClientBase {
+  PlatformService(
+    String host, {
+    String serviceName = "IPlatformService",
+    Map<String, String>? headers,
+    int? timeout,
+  }) : super(
+          host,
+          serviceName,
+          headers: headers,
+          timeout: timeout,
+        ) {
+    /// 注册响应实体反序列化处理器
+    FJsonConvert.setDecoder((map) => LoadVidResult.fromJson(map));
+    FJsonConvert.setDecoder((map) => GetVidFrameResult.fromJson(map));
+  }
+
+  /// 加载主题
+  Future<bool> loadTheme(String name) async {
+    var rpcRst = await call("LoadTheme", name);
+    return rpcRst;
+  }
+
+  /// 保存配置
+  ///
+  /// [jsonText] 配置json文本
+  Future<bool> saveConfig(String jsonText) async {
+    var rpcRst = await call("SaveConfig", jsonText);
+    return rpcRst;
+  }
+
+  /// 获取配置
+  Future<String?> getConfig() async {
+    var rpcRst = await call("GetConfig");
+    return rpcRst;
+  }
+
+  /// 保存文本文件
+  ///
+  /// [name] 文件名
+  ///
+  /// [text] 文本
+  Future<bool> saveText(String name, String text) async {
+    var rpcRst = await call("SaveText", [name, text]);
+    return rpcRst;
+  }
+
+  /// 获取文件文本
+  ///
+  /// [name] 文件名
+  Future<String?> getText(String name) async {
+    var rpcRst = await call("GetText", name);
+    return rpcRst;
+  }
+
+  /// 加载Vid文件
+  ///
+  /// [url] Vid文件链接
+  Future<LoadVidResult> loadVid(String url) async {
+    var rpcRst = await call("LoadVid", url);
+    var result = LoadVidResult.fromJson(rpcRst as Map<String, dynamic>);
+    return result;
+  }
+
+  /// 获取Vid单针帧图
+  Future<GetVidFrameResult> getVidFrame(GetVidFrameRequest request) async {
+    var rpcRst = await call("GetVidFrame", request);
+    var result = GetVidFrameResult.fromJson(rpcRst as Map<String, dynamic>);
+    return result;
+  }
+
+  /// 释放Vid缓存资源
+  void releaseVid() => notify("ReleaseVid");
+
+  /// 获取单帧Vid文件图像
+  Future<GetVidFrameResult> getSingleImage(String url) async {
+    var rpcRst = await call("GetSingleImage", url);
+    var result = GetVidFrameResult.fromJson(rpcRst as Map<String, dynamic>);
+    return result;
+  }
+
+  /// 获取vid文件(base64)
+  Future<String?> getVidFile(String url) async {
+    var rpcRst = await call("GetVidFile", [url]);
+    return rpcRst;
+  }
+
+  /// 导出文件
+  Future<bool> setBytesToExport(String data, String fileName) async {
+    var rpcRst = await call("SetBytesToExport", [data, fileName]);
+    return rpcRst;
+  }
+
+  ///缓存文件
+  Future<bool> setBinaryFileCache(String data, String fileName) async {
+    var rpcRst = await call("SetBinaryFileCache", [data, fileName]);
+    return rpcRst;
+  }
+
+  ///读取缓存文件
+  Future<String?> getBinaryFileCache(String fileName) async {
+    var rpcRst = await call("GetBinaryFileCache", [fileName]);
+    return rpcRst;
+  }
+
+  ///导出病例zip文件
+  Future<bool> exportPatientZipFile(String data, String fileName) async {
+    var rpcRst = await call("ExportPatientZipFile", [data, fileName]);
+    return rpcRst;
+  }
+
+  ///撤销病例导出
+  Future<bool> abortExportOperation() async {
+    var rpcRst = await call("AbortExportOperation", []);
+    return rpcRst;
+  }
+
+  ///打开图像测量页(独立窗口)
+  Future<bool?> openImageMeasureAsync(String token, String patientCode,
+      String remedicalCode, String recordCode) async {
+    var rpcRst = await call(
+        "OpenImageMeasure", [token, patientCode, remedicalCode, recordCode]);
+    return rpcRst;
+  }
+
+  ///打开报告预览页(独立窗口)
+  Future<bool?> openReportPreviewAsync(String token, String reportCode,
+      String recordCode, String isFormEditor) async {
+    var rpcRst = await call(
+        "OpenReportPreview", [token, reportCode, recordCode, isFormEditor]);
+    return rpcRst;
+  }
+
+  ///打开图像测量页(独立窗口)
+  Future<bool?> openReportEditAsync(String token, String patientCode,
+      String reportCode, String recordCode, String referralRecordCode) async {
+    var rpcRst = await call("OpenReportEdit",
+        [token, patientCode, reportCode, recordCode, referralRecordCode]);
+    return rpcRst;
+  }
+
+  ///打开报告设计器页面(独立窗口)
+  Future<bool?> openReportDesignerAsync(String templateId, String name,
+      String type, String token, String json) async {
+    var rpcRst =
+        await call("OpenReportDesigner", [templateId, name, type, token, json]);
+    return rpcRst;
+  }
+
+  ///获取屏幕个数
+  Future<int> getWindowsNum() async {
+    var rpcRst = await call("GetWindowsNum");
+    return rpcRst;
+  }
+
+  ///关闭副窗口
+  Future<void> closeSlaveWindow() async {
+    var rpcRst = await call("CloseSlaveWindow");
+    return rpcRst;
+  }
+
+  ///开启拖拽窗口
+  Future<void> beginWindowDrag(String windowName) async {
+    var rpcRst = await call("BeginWindowDrag", [windowName]);
+    return rpcRst;
+  }
+
+  ///关闭拖拽窗口
+  Future<void> endWindowDrag(String windowName) async {
+    var rpcRst = await call("EndWindowDrag", [windowName]);
+    return rpcRst;
+  }
+
+  ///最小化窗口
+  Future<void> minimizeWindow(String windowName) async {
+    var rpcRst = await call("MinimizeWindow", [windowName]);
+    return rpcRst;
+  }
+
+  ///最大化窗口
+  Future<void> maximizeWindow(String windowName) async {
+    var rpcRst = await call("MaximizeWindow", [windowName]);
+    return rpcRst;
+  }
+
+  ///重置
+  Future<void> restoreWindow(String windowName) async {
+    var rpcRst = await call("RestoreWindow", [windowName]);
+    return rpcRst;
+  }
+
+  ///获取Window状态
+  Future<int> getWindowState(String windowName) async {
+    var rpcRst = await call("GetWindowStateAsync", [windowName]);
+    return rpcRst;
+  }
+
+  ///关闭窗口
+  Future<void> closeWindow(String windowName) async {
+    var rpcRst = await call("CloseWindow", [windowName]);
+    return rpcRst;
+  }
+
+  ///设置语言Code
+  Future<void> setLanguageCodeAsync(String code) async {
+    var rpcRst = await call("SetLanguageCode", [code]);
+    return rpcRst;
+  }
+
+  //获取语言Code
+  Future<String> getLanguageCodeAsync() async {
+    var rpcRst = await call("GetLanguageCode");
+    return rpcRst;
+  }
+
+  ///设置当前登录信息
+  Future<void> setLoginUserInfoAsync(String userInfo) async {
+    var rpcRst = await call("SetUserLoginInfo", [userInfo]);
+    return rpcRst;
+  }
+
+  ///设置当前第二窗口状态
+  Future<void> setSecondWindowStateInfoAsync(bool isSecondWindowMode) async {
+    var rpcRst = await call("SetSecondWindowState", [isSecondWindowMode]);
+    return rpcRst;
+  }
+
+  ///默认词条变更
+  Future<void> thesaurusChange() async {
+    var rpcRst = await call("ThesaurusChange");
+    return rpcRst;
+  }
+
+  ///提交报告通知
+  Future<void> onSubmitReport(String patientId, String code) async {
+    var rpcRst = await call("OnSubmitReport", [patientId, code]);
+    return rpcRst;
+  }
+
+  ///刷新报告通知
+  Future<void> refershReports() async {
+    var rpcRst = await call("RefershReports", []);
+    return rpcRst;
+  }
+
+  ///刷新报告通知
+  Future<void> reloadConfig() async {
+    var rpcRst = await call("ReloadConfig", []);
+    return rpcRst;
+  }
+
+  ///重载配置
+  Future<bool> getIsUseSecondWindow() async {
+    var rpcRst = await call("GetIsUseSecondWindow", []);
+    return rpcRst;
+  }
+
+  ///重载配置
+  Future<bool> getIsWin7() async {
+    var rpcRst = await call("GetIsWin7", []);
+    return rpcRst;
+  }
+
+  ///打开控制台
+  Future<void> openConsole() async {
+    var rpcRst = await call("OpenConsole", []);
+    return rpcRst;
+  }
+
+  ///主窗口关闭通知
+  Future<void> onMainWindowLogout() async {
+    var rpcRst = await call("OnMainWindowLogout", []);
+    return rpcRst;
+  }
+
+  ///设置开启自启动
+  Future<void> setAutoStartAsync(bool isAutoStart) async {
+    var rpcRst = await call("SetAutoStart", [isAutoStart]);
+    return rpcRst;
+  }
+
+  ///启用壳子录音
+  Future<void> startShellRecord() async {
+    var rpcRst = await call("StartShellRecord");
+    return rpcRst;
+  }
+
+  ///停止壳子录音
+  Future<String> stopShellRecord() async {
+    var rpcRst = await call("StopShellRecord");
+    return rpcRst;
+  }
+
+  ///导出日志
+  Future<bool> exportAppLogZipFile(int exportType, String fileName) async {
+    var rpcRst = await call("ExportAppLogZipFile", [exportType, fileName]);
+    return rpcRst;
+  }
+}

+ 109 - 0
lib/services/platform.m.dart

@@ -0,0 +1,109 @@
+class LoadVidResult {
+  LoadVidResult({
+    this.isSuccess = false,
+    this.frameCount = 0,
+    this.probeBase64,
+  });
+
+  String? probeBase64;
+  int frameCount;
+  bool isSuccess;
+
+  factory LoadVidResult.fromJson(Map<String, dynamic> map) {
+    return LoadVidResult(
+      isSuccess: map['IsSuccess'],
+      frameCount: map['FrameCount'],
+      probeBase64: map["ProbeBase64"],
+    );
+  }
+}
+
+abstract class VidFrameProcessorBase {
+  VidFrameProcessorBase(this.typeName);
+
+  final String typeName;
+
+  Map<String, dynamic> toJson() {
+    return <String, dynamic>{};
+  }
+
+  String toJsonText() {
+    final map = toJson();
+    final values = map.values;
+    final valuesTxt = values.join(',');
+    return '$typeName|$valuesTxt';
+  }
+}
+
+class VidFrameBrightnessProcessor extends VidFrameProcessorBase {
+  VidFrameBrightnessProcessor(this.brightness) : super("Brightness");
+  int brightness;
+
+  factory VidFrameBrightnessProcessor.fromJson(Map<String, dynamic> map) {
+    return VidFrameBrightnessProcessor(map['Brightness']);
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    map["Brightness"] = brightness;
+    return map;
+  }
+}
+
+class VidFrameContrastProcessor extends VidFrameProcessorBase {
+  VidFrameContrastProcessor(this.contrast) : super("Contrast");
+  int contrast;
+
+  factory VidFrameContrastProcessor.fromJson(Map<String, dynamic> map) {
+    return VidFrameContrastProcessor(map['Contrast']);
+  }
+
+  Map<String, dynamic> toJson() {
+    final map = super.toJson();
+    map["Contrast"] = contrast;
+    return map;
+  }
+}
+
+class GetVidFrameRequest {
+  /// 获取Vid帧请求
+  ///
+  /// [name] Vid缓存文件名
+  ///
+  /// [index] 帧索引
+  ///
+  /// [processors] 图像处理器集合
+  GetVidFrameRequest({
+    required this.index,
+    this.processors,
+  });
+
+  int index;
+  List<VidFrameProcessorBase>? processors;
+
+  Map<String, dynamic> toJson() {
+    final map = <String, dynamic>{};
+    map['Index'] = index;
+    if (processors != null) {
+      map['Processors'] = processors!.map((e) => e.toJsonText()).toList();
+    }
+    return map;
+  }
+}
+
+class GetVidFrameResult {
+  GetVidFrameResult({
+    this.isSuccess = false,
+    this.frameBase64,
+  });
+
+  String? frameBase64;
+  bool isSuccess;
+
+  factory GetVidFrameResult.fromJson(Map<String, dynamic> map) {
+    return GetVidFrameResult(
+      isSuccess: map['IsSuccess'],
+      frameBase64: map["FrameBase64"],
+    );
+  }
+}

+ 28 - 0
lib/services/slaveInteractionCenter.dart

@@ -0,0 +1,28 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+
+
+import 'masterInteractionCenter.m.dart';
+
+
+class SlaveInteractionCenterService extends JsonRpcClientBase {
+	SlaveInteractionCenterService(
+		String host, {
+		String serviceName = "ISlaveInteractionCenterService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				);
+
+	Future<bool> syncReceiveMasterServiceDataAsync(SyncReceiveServiceDataRequest request) async {
+		var rpcRst = await call("SyncReceiveMasterServiceDataAsync", request);
+		return rpcRst;
+	}
+
+}
+

+ 37 - 0
lib/services/vidProcess.dart

@@ -0,0 +1,37 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'vidProcess.m.dart';
+
+
+class VidProcessService extends JsonRpcClientBase {
+	VidProcessService(
+		String host, {
+		String serviceName = "IVidProcessService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => VidProcessResult.fromJson(map));
+	}
+
+	Future<VidProcessResult> convertToImageDataAsync(ConvertToImageDataRequest request) async {
+		var rpcRst = await call("ConvertToImageDataAsync", request);
+		var result = VidProcessResult.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+	Future<String> getThumbnailAsync(GetThumbnailRequest request) async {
+		var rpcRst = await call("GetThumbnailAsync", request);
+		return rpcRst;
+	}
+
+}
+

+ 115 - 0
lib/services/vidProcess.m.dart

@@ -0,0 +1,115 @@
+enum ImageType {
+	Jpg,
+	Mp4,
+}
+
+class VidProcessResult {
+	ImageType imageType;
+	String? fileUrl;
+
+	VidProcessResult({
+		this.imageType = ImageType.Jpg,
+		this.fileUrl,
+	});
+
+	factory VidProcessResult.fromJson(Map<String, dynamic> map) {
+		return VidProcessResult( 
+			imageType: ImageType.values.firstWhere((e) => e.index == map['ImageType']),
+			fileUrl: map['FileUrl'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['ImageType'] = imageType.index;
+		if(fileUrl != null)
+			map['FileUrl'] = fileUrl;
+		return map;
+	}
+}
+
+class VidFileTokenRequest {
+	String? fileToken;
+
+	VidFileTokenRequest({
+		this.fileToken,
+	});
+
+	factory VidFileTokenRequest.fromJson(Map<String, dynamic> map) {
+		return VidFileTokenRequest( 
+			fileToken: map['FileToken'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(fileToken != null)
+			map['FileToken'] = fileToken;
+		return map;
+	}
+}
+
+enum ImageQualityEnum {
+	None,
+	Low,
+	Medium,
+	High,
+}
+
+class ConvertToImageDataRequest extends VidFileTokenRequest{
+	int height;
+	ImageQualityEnum quality;
+
+	ConvertToImageDataRequest({
+		this.height = 0,
+		this.quality = ImageQualityEnum.None,
+		String? fileToken,
+	}) : super(
+			fileToken: fileToken,
+		);
+
+	factory ConvertToImageDataRequest.fromJson(Map<String, dynamic> map) {
+		return ConvertToImageDataRequest( 
+			height: map['Height'],
+			quality: ImageQualityEnum.values.firstWhere((e) => e.index == map['Quality']),
+			fileToken: map['FileToken'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['Height'] = height;
+		map['Quality'] = quality.index;
+		return map;
+	}
+}
+
+class GetThumbnailRequest extends VidFileTokenRequest{
+	int height;
+	int quality;
+
+	GetThumbnailRequest({
+		this.height = 0,
+		this.quality = 0,
+		String? fileToken,
+	}) : super(
+			fileToken: fileToken,
+		);
+
+	factory GetThumbnailRequest.fromJson(Map<String, dynamic> map) {
+		return GetThumbnailRequest( 
+			height: map['Height'],
+			quality: map['Quality'],
+			fileToken: map['FileToken'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		map['Height'] = height;
+		map['Quality'] = quality;
+		return map;
+	}
+}
+
+