Browse Source

同步Server最新接口

loki.wu 2 years ago
parent
commit
c0b562785d

+ 3 - 0
lib/rpc.dart

@@ -65,6 +65,9 @@ class JsonRpcProxy {
 	ConnectService get connect =>
 	findService(() => new ConnectService(currentHostAddress));
 
+	DeployPlatformService get deployPlatform =>
+	findService(() => new DeployPlatformService(currentHostAddress));
+
 	DeviceService get device =>
 	findService(() => new DeviceService(currentHostAddress));
 

+ 32 - 0
lib/services/deployPlatform.dart

@@ -0,0 +1,32 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'deployPlatform.m.dart';
+
+
+class DeployPlatformService extends JsonRpcClientBase {
+	DeployPlatformService(
+		String host, {
+		String serviceName = "IDeployPlatformService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => DeployPlatServerInfoDTO.fromJson(map));
+	}
+
+	Future<List<DeployPlatServerInfoDTO>> getServerListAsync() async {
+		var rpcRst = await call("GetServerListAsync", );
+		var result = (rpcRst as List).map((e)=>DeployPlatServerInfoDTO.fromJson(e as Map<String, dynamic>)).toList();
+		return result;
+	}
+
+}
+

+ 60 - 0
lib/services/deployPlatform.m.dart

@@ -0,0 +1,60 @@
+import 'liveConsultation.m.dart';
+
+class DeployPlatServerInfoDTO extends BaseDTO{
+	String? id;
+	String? serverID;
+	String? name;
+	bool isMaster;
+	String? masterServerId;
+	String? remoteAccountId;
+	String? remotePassword;
+
+	DeployPlatServerInfoDTO({
+		this.id,
+		this.serverID,
+		this.name,
+		this.isMaster = false,
+		this.masterServerId,
+		this.remoteAccountId,
+		this.remotePassword,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory DeployPlatServerInfoDTO.fromJson(Map<String, dynamic> map) {
+		return DeployPlatServerInfoDTO( 
+			id: map['Id'],
+			serverID: map['ServerID'],
+			name: map['Name'],
+			isMaster: map['IsMaster'],
+			masterServerId: map['MasterServerId'],
+			remoteAccountId: map['RemoteAccountId'],
+			remotePassword: map['RemotePassword'],
+			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(id != null)
+			map['Id'] = id;
+		if(serverID != null)
+			map['ServerID'] = serverID;
+		if(name != null)
+			map['Name'] = name;
+		map['IsMaster'] = isMaster;
+		if(masterServerId != null)
+			map['MasterServerId'] = masterServerId;
+		if(remoteAccountId != null)
+			map['RemoteAccountId'] = remoteAccountId;
+		if(remotePassword != null)
+			map['RemotePassword'] = remotePassword;
+		return map;
+	}
+}
+
+

+ 2 - 0
lib/services/index.dart

@@ -2,6 +2,7 @@ export 'aIDiagnosis.dart';
 export 'aSR.dart';
 export 'authentication.dart';
 export 'connect.dart';
+export 'deployPlatform.dart';
 export 'device.dart';
 export 'education.dart';
 export 'email.dart';
@@ -29,6 +30,7 @@ export 'aIDiagnosis.m.dart';
 export 'aSR.m.dart';
 export 'authentication.m.dart';
 export 'connect.m.dart';
+export 'deployPlatform.m.dart';
 export 'device.m.dart';
 export 'education.m.dart';
 export 'identityApply.m.dart';

+ 9 - 0
lib/services/liveConsultation.dart

@@ -5,6 +5,8 @@ import 'package:fis_common/json_convert.dart';
 
 import 'liveConsultation.m.dart';
 
+import 'notification.m.dart';
+
 
 class LiveConsultationService extends JsonRpcClientBase {
 	LiveConsultationService(
@@ -45,6 +47,7 @@ class LiveConsultationService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => ConsultationImagesDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => UserExtendDTO.fromJson(map));
 		FJsonConvert.setDecoder((map) => ChangeConsultationResult.fromJson(map));
+		FJsonConvert.setDecoder((map) => LiveConsultationMember.fromJson(map));
 	}
 
 	Future<List<OrganizationBaseDTO>> findParentOrganizationsAsync(FindHigherOrganizationsRequest request) async {
@@ -344,5 +347,11 @@ class LiveConsultationService extends JsonRpcClientBase {
 		return rpcRst;
 	}
 
+	Future<LiveConsultationMember> deviceJoinInLiveConsultationAsync(JoinLiveConsultationRequest request) async {
+		var rpcRst = await call("DeviceJoinInLiveConsultationAsync", request);
+		var result = LiveConsultationMember.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
 }
 

+ 7 - 0
lib/services/login.dart

@@ -5,6 +5,8 @@ import 'package:fis_common/json_convert.dart';
 
 import 'login.m.dart';
 
+import 'liveConsultation.m.dart';
+
 
 class LoginService extends JsonRpcClientBase {
 	LoginService(
@@ -83,5 +85,10 @@ class LoginService extends JsonRpcClientBase {
 		return rpcRst;
 	}
 
+	Future<bool> loginOutAsync(TokenRequest request) async {
+		var rpcRst = await call("LoginOutAsync", request);
+		return rpcRst;
+	}
+
 }
 

+ 50 - 0
lib/services/other.m.dart

@@ -22,6 +22,7 @@ import 'login.m.dart';
 import 'role.m.dart';
 import 'region.m.dart';
 import 'aSR.m.dart';
+import 'deployPlatform.m.dart';
 
 import 'package:fis_jsonrpc/utils.dart';
 
@@ -7496,6 +7497,55 @@ enum VideoProtocol {
 	Rtc,
 }
 
+class DeviceJoinLiveConsultationResult {
+	String? consultationCode;
+	String? deviceCode;
+	int roomNo;
+	int appId;
+	String? deviceSign;
+	List<LiveConsultationMember >? memberLiveDatas;
+	List<InteractiveBoardDataDTO >? interactiveBoardDatas;
+
+	DeviceJoinLiveConsultationResult({
+		this.consultationCode,
+		this.deviceCode,
+		this.roomNo = 0,
+		this.appId = 0,
+		this.deviceSign,
+		this.memberLiveDatas,
+		this.interactiveBoardDatas,
+	});
+
+	factory DeviceJoinLiveConsultationResult.fromJson(Map<String, dynamic> map) {
+		return DeviceJoinLiveConsultationResult( 
+			consultationCode: map['ConsultationCode'],
+			deviceCode: map['DeviceCode'],
+			roomNo: map['RoomNo'],
+			appId: map['AppId'],
+			deviceSign: map['DeviceSign'],
+			memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveConsultationMember.fromJson(e as Map<String,dynamic>)).toList() : null,
+			interactiveBoardDatas: map['InteractiveBoardDatas'] != null ? (map['InteractiveBoardDatas'] as List).map((e)=>InteractiveBoardDataDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(consultationCode != null)
+			map['ConsultationCode'] = consultationCode;
+		if(deviceCode != null)
+			map['DeviceCode'] = deviceCode;
+		map['RoomNo'] = roomNo;
+		map['AppId'] = appId;
+		if(deviceSign != null)
+			map['DeviceSign'] = deviceSign;
+		if(memberLiveDatas != null)
+			map['MemberLiveDatas'] = memberLiveDatas;
+		if(interactiveBoardDatas != null)
+			map['InteractiveBoardDatas'] = interactiveBoardDatas;
+		return map;
+	}
+}
+
 class LiveConsultationRoomDTO {
 	String? consultationCode;
 	LiveConsultationMember? initiator;

+ 5 - 0
lib/services/user.dart

@@ -150,5 +150,10 @@ class UserService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<bool> removeUserSingleTokenAsync(RemoveUserSingleTokenRequest request) async {
+		var rpcRst = await call("RemoveUserSingleTokenAsync", request);
+		return rpcRst;
+	}
+
 }
 

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

@@ -1014,4 +1014,29 @@ class GetNoReadMessagesRequest extends TokenRequest{
 	}
 }
 
+class RemoveUserSingleTokenRequest extends TokenRequest{
+	String? wSToken;
+
+	RemoveUserSingleTokenRequest({
+		this.wSToken,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory RemoveUserSingleTokenRequest.fromJson(Map<String, dynamic> map) {
+		return RemoveUserSingleTokenRequest( 
+			wSToken: map['WSToken'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(wSToken != null)
+			map['WSToken'] = wSToken;
+		return map;
+	}
+}
+