Browse Source

更新接口

loki.wu 1 year ago
parent
commit
3f015d5614

+ 3 - 0
lib/rpc.dart

@@ -68,6 +68,9 @@ class JsonRpcProxy {
 	AuthenticationService get authentication =>
 	findService(() => new AuthenticationService(currentHostAddress));
 
+	ChatMessageService get chatMessage =>
+	findService(() => new ChatMessageService(currentHostAddress));
+
 	ConnectService get connect =>
 	findService(() => new ConnectService(currentHostAddress));
 

+ 35 - 0
lib/services/chatMessage.dart

@@ -0,0 +1,35 @@
+import 'dart:core';
+
+import 'package:fis_jsonrpc/client_base.dart';
+import 'package:fis_common/json_convert.dart';
+
+import 'chatMessage.m.dart';
+
+import 'liveConsultation.m.dart';
+
+
+class ChatMessageService extends JsonRpcClientBase {
+	ChatMessageService(
+		String host, {
+		String serviceName = "IChatMessageService",
+		Map<String, String>? headers,
+		int? timeout,
+	}) : super(
+						host,
+						serviceName,
+						headers: headers,
+						timeout: timeout,
+				) {
+		/// 注册响应实体反序列化处理器
+		FJsonConvert.setDecoder((map) => PageResult<ChatMessagesDTO>.fromJson(map));
+		FJsonConvert.setDecoder((map) => ChatMessagesDTO.fromJson(map));
+	}
+
+	Future<PageResult<ChatMessagesDTO>> getChatMessagePagesAsync(GetChatMessagePageRequest request) async {
+		var rpcRst = await call("GetChatMessagePagesAsync", request);
+		var result = PageResult<ChatMessagesDTO>.fromJson(rpcRst as Map<String, dynamic>);
+		return result;
+	}
+
+}
+

+ 89 - 0
lib/services/chatMessage.m.dart

@@ -0,0 +1,89 @@
+import 'notification.m.dart';
+import 'liveConsultation.m.dart';
+
+enum ChatCmdTypeEnum {
+	Txt,
+	Image,
+	MP4,
+	Voice,
+	Cases,
+}
+
+class ChatMessagesDTO extends BaseDTO{
+	String? code;
+	ChatCmdTypeEnum chatCmdType;
+	String? content;
+	String? relevanceCode;
+	TransactionTypeEnum transactionType;
+
+	ChatMessagesDTO({
+		this.code,
+		this.chatCmdType = ChatCmdTypeEnum.Txt,
+		this.content,
+		this.relevanceCode,
+		this.transactionType = TransactionTypeEnum.Consultion,
+		DateTime? createTime,
+		DateTime? updateTime,
+	}) : super(
+			createTime: createTime,
+			updateTime: updateTime,
+		);
+
+	factory ChatMessagesDTO.fromJson(Map<String, dynamic> map) {
+		return ChatMessagesDTO( 
+			code: map['Code'],
+			chatCmdType: ChatCmdTypeEnum.values.firstWhere((e) => e.index == map['ChatCmdType']),
+			content: map['Content'],
+			relevanceCode: map['RelevanceCode'],
+			transactionType: TransactionTypeEnum.values.firstWhere((e) => e.index == map['TransactionType']),
+			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['ChatCmdType'] = chatCmdType.index;
+		if(content != null)
+			map['Content'] = content;
+		if(relevanceCode != null)
+			map['RelevanceCode'] = relevanceCode;
+		map['TransactionType'] = transactionType.index;
+		return map;
+	}
+}
+
+class GetChatMessagePageRequest extends PageRequest{
+	String? relevanceCode;
+
+	GetChatMessagePageRequest({
+		this.relevanceCode,
+		int pageIndex = 0,
+		int pageSize = 0,
+		String? token,
+	}) : super(
+			pageIndex: pageIndex,
+			pageSize: pageSize,
+			token: token,
+		);
+
+	factory GetChatMessagePageRequest.fromJson(Map<String, dynamic> map) {
+		return GetChatMessagePageRequest( 
+			relevanceCode: map['RelevanceCode'],
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(relevanceCode != null)
+			map['RelevanceCode'] = relevanceCode;
+		return map;
+	}
+}
+
+

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

@@ -1671,6 +1671,8 @@ class CreateLiveRoomInfoResult {
 	int roomNo;
 	int appId;
 	bool isTrtc;
+	TransactionStatusEnum liveProtocol;
+	LiveDataDTO? liveData;
 
 	CreateLiveRoomInfoResult({
 		this.userCode,
@@ -1678,6 +1680,8 @@ class CreateLiveRoomInfoResult {
 		this.roomNo = 0,
 		this.appId = 0,
 		this.isTrtc = false,
+		this.liveProtocol = TransactionStatusEnum.Applied,
+		this.liveData,
 	});
 
 	factory CreateLiveRoomInfoResult.fromJson(Map<String, dynamic> map) {
@@ -1687,6 +1691,8 @@ class CreateLiveRoomInfoResult {
 			roomNo: map['RoomNo'],
 			appId: map['AppId'],
 			isTrtc: map['IsTrtc'],
+			liveProtocol: TransactionStatusEnum.values.firstWhere((e) => e.index == map['LiveProtocol']),
+			liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
 		);
 	}
 
@@ -1699,6 +1705,9 @@ class CreateLiveRoomInfoResult {
 		map['RoomNo'] = roomNo;
 		map['AppId'] = appId;
 		map['IsTrtc'] = isTrtc;
+		map['LiveProtocol'] = liveProtocol.index;
+		if(liveData != null)
+			map['LiveData'] = liveData;
 		return map;
 	}
 }

+ 5 - 0
lib/services/education.dart

@@ -365,5 +365,10 @@ class EducationService extends JsonRpcClientBase {
 		return result;
 	}
 
+	Future<bool> sendCourseInteractiveBoardDataAsync(SendLiveInteractiveBoardDataRequest request) async {
+		var rpcRst = await call("SendCourseInteractiveBoardDataAsync", request);
+		return rpcRst;
+	}
+
 }
 

+ 91 - 0
lib/services/education.m.dart

@@ -611,6 +611,45 @@ class StudentInfoDTO {
 	}
 }
 
+class ScreenSharingChannelDTO {
+	int rtcRoomId;
+	int sdkAppId;
+	String? userCode;
+	String? userSign;
+	LiveDataDTO? liveData;
+
+	ScreenSharingChannelDTO({
+		this.rtcRoomId = 0,
+		this.sdkAppId = 0,
+		this.userCode,
+		this.userSign,
+		this.liveData,
+	});
+
+	factory ScreenSharingChannelDTO.fromJson(Map<String, dynamic> map) {
+		return ScreenSharingChannelDTO( 
+			rtcRoomId: map['RtcRoomId'],
+			sdkAppId: map['SdkAppId'],
+			userCode: map['UserCode'],
+			userSign: map['UserSign'],
+			liveData: map['LiveData'] != null ? LiveDataDTO.fromJson(map['LiveData']) : null,
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		map['RtcRoomId'] = rtcRoomId;
+		map['SdkAppId'] = sdkAppId;
+		if(userCode != null)
+			map['UserCode'] = userCode;
+		if(userSign != null)
+			map['UserSign'] = userSign;
+		if(liveData != null)
+			map['LiveData'] = liveData;
+		return map;
+	}
+}
+
 class BaseCourseInfoDTO {
 	String? code;
 	String? name;
@@ -648,6 +687,7 @@ class BaseCourseInfoDTO {
 	String? defaultVideoToken;
 	LiveDataDTO? courseChannel;
 	LiveDataDTO? othersScreenSharingChannel;
+	ScreenSharingChannelDTO? rtcScreenSharingChannel;
 
 	BaseCourseInfoDTO({
 		this.code,
@@ -686,6 +726,7 @@ class BaseCourseInfoDTO {
 		this.defaultVideoToken,
 		this.courseChannel,
 		this.othersScreenSharingChannel,
+		this.rtcScreenSharingChannel,
 	});
 
 	factory BaseCourseInfoDTO.fromJson(Map<String, dynamic> map) {
@@ -726,6 +767,7 @@ class BaseCourseInfoDTO {
 			defaultVideoToken: map['DefaultVideoToken'],
 			courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null,
 			othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null,
+			rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null,
 		);
 	}
 
@@ -790,6 +832,8 @@ class BaseCourseInfoDTO {
 			map['CourseChannel'] = courseChannel;
 		if(othersScreenSharingChannel != null)
 			map['OthersScreenSharingChannel'] = othersScreenSharingChannel;
+		if(rtcScreenSharingChannel != null)
+			map['RtcScreenSharingChannel'] = rtcScreenSharingChannel;
 		return map;
 	}
 }
@@ -1028,6 +1072,7 @@ class CourseInfoDetailDTO extends BaseCourseInfoDTO{
 		String? defaultVideoToken,
 		LiveDataDTO? courseChannel,
 		LiveDataDTO? othersScreenSharingChannel,
+		ScreenSharingChannelDTO? rtcScreenSharingChannel,
 	}) : super(
 			code: code,
 			name: name,
@@ -1065,6 +1110,7 @@ class CourseInfoDetailDTO extends BaseCourseInfoDTO{
 			defaultVideoToken: defaultVideoToken,
 			courseChannel: courseChannel,
 			othersScreenSharingChannel: othersScreenSharingChannel,
+			rtcScreenSharingChannel: rtcScreenSharingChannel,
 		);
 
 	factory CourseInfoDetailDTO.fromJson(Map<String, dynamic> map) {
@@ -1115,6 +1161,7 @@ class CourseInfoDetailDTO extends BaseCourseInfoDTO{
 			defaultVideoToken: map['DefaultVideoToken'],
 			courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null,
 			othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null,
+			rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null,
 		);
 	}
 
@@ -2521,6 +2568,7 @@ class InitiateLiveCourseResult extends LiveCourseBaseResult{
 	List<LiveCourseMember >? memberLiveDatas;
 	LiveDataDTO? courseChannel;
 	LiveDataDTO? othersScreenSharingChannel;
+	ScreenSharingChannelDTO? rtcScreenSharingChannel;
 
 	InitiateLiveCourseResult({
 		this.initiatorCode,
@@ -2532,6 +2580,7 @@ class InitiateLiveCourseResult extends LiveCourseBaseResult{
 		this.memberLiveDatas,
 		this.courseChannel,
 		this.othersScreenSharingChannel,
+		this.rtcScreenSharingChannel,
 		String? courseCode,
 	}) : super(
 			courseCode: courseCode,
@@ -2548,6 +2597,7 @@ class InitiateLiveCourseResult extends LiveCourseBaseResult{
 			memberLiveDatas: map['MemberLiveDatas'] != null ? (map['MemberLiveDatas'] as List).map((e)=>LiveCourseMember.fromJson(e as Map<String,dynamic>)).toList() : null,
 			courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null,
 			othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null,
+			rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null,
 			courseCode: map['CourseCode'],
 		);
 	}
@@ -2568,6 +2618,8 @@ class InitiateLiveCourseResult extends LiveCourseBaseResult{
 			map['CourseChannel'] = courseChannel;
 		if(othersScreenSharingChannel != null)
 			map['OthersScreenSharingChannel'] = othersScreenSharingChannel;
+		if(rtcScreenSharingChannel != null)
+			map['RtcScreenSharingChannel'] = rtcScreenSharingChannel;
 		return map;
 	}
 }
@@ -2609,6 +2661,7 @@ class JoinLiveCourseResult extends LiveCourseBaseResult{
 	LiveDataDTO? courseChannel;
 	ShareInfoDTO? shareInfo;
 	LiveDataDTO? othersScreenSharingChannel;
+	ScreenSharingChannelDTO? rtcScreenSharingChannel;
 
 	JoinLiveCourseResult({
 		this.userCode,
@@ -2622,6 +2675,7 @@ class JoinLiveCourseResult extends LiveCourseBaseResult{
 		this.courseChannel,
 		this.shareInfo,
 		this.othersScreenSharingChannel,
+		this.rtcScreenSharingChannel,
 		String? courseCode,
 	}) : super(
 			courseCode: courseCode,
@@ -2640,6 +2694,7 @@ class JoinLiveCourseResult extends LiveCourseBaseResult{
 			courseChannel: map['CourseChannel'] != null ? LiveDataDTO.fromJson(map['CourseChannel']) : null,
 			shareInfo: map['ShareInfo'] != null ? ShareInfoDTO.fromJson(map['ShareInfo']) : null,
 			othersScreenSharingChannel: map['OthersScreenSharingChannel'] != null ? LiveDataDTO.fromJson(map['OthersScreenSharingChannel']) : null,
+			rtcScreenSharingChannel: map['RtcScreenSharingChannel'] != null ? ScreenSharingChannelDTO.fromJson(map['RtcScreenSharingChannel']) : null,
 			courseCode: map['CourseCode'],
 		);
 	}
@@ -2664,6 +2719,8 @@ class JoinLiveCourseResult extends LiveCourseBaseResult{
 			map['ShareInfo'] = shareInfo;
 		if(othersScreenSharingChannel != null)
 			map['OthersScreenSharingChannel'] = othersScreenSharingChannel;
+		if(rtcScreenSharingChannel != null)
+			map['RtcScreenSharingChannel'] = rtcScreenSharingChannel;
 		return map;
 	}
 }
@@ -3762,4 +3819,38 @@ class FindMyOrganizationExpertsRequest extends TokenRequest{
 	}
 }
 
+class SendLiveInteractiveBoardDataRequest extends TokenRequest{
+	String? roomId;
+	bool isClear;
+	String? boardData;
+
+	SendLiveInteractiveBoardDataRequest({
+		this.roomId,
+		this.isClear = false,
+		this.boardData,
+		String? token,
+	}) : super(
+			token: token,
+		);
+
+	factory SendLiveInteractiveBoardDataRequest.fromJson(Map<String, dynamic> map) {
+		return SendLiveInteractiveBoardDataRequest( 
+			roomId: map['RoomId'],
+			isClear: map['IsClear'],
+			boardData: map['BoardData'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(roomId != null)
+			map['RoomId'] = roomId;
+		map['IsClear'] = isClear;
+		if(boardData != null)
+			map['BoardData'] = boardData;
+		return map;
+	}
+}
+
 

+ 2 - 0
lib/services/index.dart

@@ -2,6 +2,7 @@ export 'aIDiagnosis.dart';
 export 'appletAPI.dart';
 export 'aSR.dart';
 export 'authentication.dart';
+export 'chatMessage.dart';
 export 'connect.dart';
 export 'deployPlatform.dart';
 export 'device.dart';
@@ -32,6 +33,7 @@ export 'aIDiagnosis.m.dart';
 export 'appletAPI.m.dart';
 export 'aSR.m.dart';
 export 'authentication.m.dart';
+export 'chatMessage.m.dart';
 export 'connect.m.dart';
 export 'deployPlatform.m.dart';
 export 'device.m.dart';

+ 58 - 34
lib/services/other.m.dart

@@ -24,6 +24,7 @@ import 'rank.m.dart';
 import 'identityApply.m.dart';
 import 'role.m.dart';
 import 'region.m.dart';
+import 'chatMessage.m.dart';
 import 'aSR.m.dart';
 
 import 'package:fis_jsonrpc/utils.dart';
@@ -5997,6 +5998,58 @@ class GetOrganizationUserPagesRequest extends PageRequest{
 	}
 }
 
+class GetPayUrlRequest extends PageRequest{
+	String? shortCode;
+
+	GetPayUrlRequest({
+		this.shortCode,
+		int pageIndex = 0,
+		int pageSize = 0,
+		String? token,
+	}) : super(
+			pageIndex: pageIndex,
+			pageSize: pageSize,
+			token: token,
+		);
+
+	factory GetPayUrlRequest.fromJson(Map<String, dynamic> map) {
+		return GetPayUrlRequest( 
+			shortCode: map['ShortCode'],
+			pageIndex: map['PageIndex'],
+			pageSize: map['PageSize'],
+			token: map['Token'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = super.toJson();
+		if(shortCode != null)
+			map['ShortCode'] = shortCode;
+		return map;
+	}
+}
+
+class GetPayUrlResult {
+	String? payUrl;
+
+	GetPayUrlResult({
+		this.payUrl,
+	});
+
+	factory GetPayUrlResult.fromJson(Map<String, dynamic> map) {
+		return GetPayUrlResult( 
+			payUrl: map['PayUrl'],
+		);
+	}
+
+	Map<String, dynamic> toJson() {
+		final map = Map<String, dynamic>();
+		if(payUrl != null)
+			map['PayUrl'] = payUrl;
+		return map;
+	}
+}
+
 class GetRolePagesRequest extends PageRequest{
 	String? roleName;
 
@@ -9609,40 +9662,6 @@ class GetEmergencyOrderRequest extends TokenRequest{
 	}
 }
 
-class SendLiveInteractiveBoardDataRequest extends TokenRequest{
-	String? roomId;
-	bool isClear;
-	String? boardData;
-
-	SendLiveInteractiveBoardDataRequest({
-		this.roomId,
-		this.isClear = false,
-		this.boardData,
-		String? token,
-	}) : super(
-			token: token,
-		);
-
-	factory SendLiveInteractiveBoardDataRequest.fromJson(Map<String, dynamic> map) {
-		return SendLiveInteractiveBoardDataRequest( 
-			roomId: map['RoomId'],
-			isClear: map['IsClear'],
-			boardData: map['BoardData'],
-			token: map['Token'],
-		);
-	}
-
-	Map<String, dynamic> toJson() {
-		final map = super.toJson();
-		if(roomId != null)
-			map['RoomId'] = roomId;
-		map['IsClear'] = isClear;
-		if(boardData != null)
-			map['BoardData'] = boardData;
-		return map;
-	}
-}
-
 enum AgeUnitsEnum {
 	Year,
 	YearAndMonth,
@@ -12173,6 +12192,7 @@ class LiveMemberDTO {
 	int sortLevel;
 	List<VideoDeviceInfoDTO >? videoDeviceInfos;
 	LoginSource loginSource;
+	String? inviterCode;
 
 	LiveMemberDTO({
 		this.code,
@@ -12188,6 +12208,7 @@ class LiveMemberDTO {
 		this.sortLevel = 0,
 		this.videoDeviceInfos,
 		this.loginSource = LoginSource.PC,
+		this.inviterCode,
 	});
 
 	factory LiveMemberDTO.fromJson(Map<String, dynamic> map) {
@@ -12205,6 +12226,7 @@ class LiveMemberDTO {
 			sortLevel: map['SortLevel'],
 			videoDeviceInfos: map['VideoDeviceInfos'] != null ? (map['VideoDeviceInfos'] as List).map((e)=>VideoDeviceInfoDTO.fromJson(e as Map<String,dynamic>)).toList() : null,
 			loginSource: LoginSource.values.firstWhere((e) => e.index == map['LoginSource']),
+			inviterCode: map['InviterCode'],
 		);
 	}
 
@@ -12229,6 +12251,8 @@ class LiveMemberDTO {
 		if(videoDeviceInfos != null)
 			map['VideoDeviceInfos'] = videoDeviceInfos;
 		map['LoginSource'] = loginSource.index;
+		if(inviterCode != null)
+			map['InviterCode'] = inviterCode;
 		return map;
 	}
 }

+ 1 - 1
lib/services/patient.dart

@@ -26,7 +26,7 @@ class PatientService extends JsonRpcClientBase {
 		FJsonConvert.setDecoder((map) => ClientPatientInfoDTO.fromJson(map));
 	}
 
-	Future<bool> createPatientAsync(CreatePatientRequest request) async {
+	Future<String> createPatientAsync(CreatePatientRequest request) async {
 		var rpcRst = await call("CreatePatientAsync", request);
 		return rpcRst;
 	}