|
@@ -3,6 +3,7 @@ library fis_jsonrpc;
|
|
|
import 'dart:collection';
|
|
|
|
|
|
import 'package:fis_common/extensions/type.dart';
|
|
|
+import 'package:fis_jsonrpc/interceptor.dart';
|
|
|
|
|
|
import 'client_base.dart';
|
|
|
import 'services/index.dart';
|
|
@@ -36,6 +37,10 @@ class JsonRpcProxy {
|
|
|
|
|
|
String get defaultAddressSign => _defaultAddressSign;
|
|
|
|
|
|
+ /// 添加拦截器
|
|
|
+ void addInterceptor(JsonRpcInterceptor interceptor) =>
|
|
|
+ jsonRpcInterceptHost.addInterceptor(interceptor);
|
|
|
+
|
|
|
HashMap<Type, dynamic> _serviceCache = HashMap();
|
|
|
|
|
|
static PlatformService? _platformService;
|
|
@@ -49,65 +54,63 @@ class JsonRpcProxy {
|
|
|
return _platformService!;
|
|
|
}
|
|
|
|
|
|
- AuthenticationService get authentication =>
|
|
|
- findService(() => new AuthenticationService(currentHostAddress));
|
|
|
-
|
|
|
- ClientLogService get clientLog =>
|
|
|
- findService(() => new ClientLogService(currentHostAddress));
|
|
|
+ AuthenticationService get authentication =>
|
|
|
+ findService(() => new AuthenticationService(currentHostAddress));
|
|
|
|
|
|
- ConnectService get connect =>
|
|
|
- findService(() => new ConnectService(currentHostAddress));
|
|
|
+ ClientLogService get clientLog =>
|
|
|
+ findService(() => new ClientLogService(currentHostAddress));
|
|
|
|
|
|
- DeviceService get device =>
|
|
|
- findService(() => new DeviceService(currentHostAddress));
|
|
|
+ ConnectService get connect =>
|
|
|
+ findService(() => new ConnectService(currentHostAddress));
|
|
|
|
|
|
- EmailService get email =>
|
|
|
- findService(() => new EmailService(currentHostAddress));
|
|
|
+ DeviceService get device =>
|
|
|
+ findService(() => new DeviceService(currentHostAddress));
|
|
|
|
|
|
- IdentityApplyService get identityApply =>
|
|
|
- findService(() => new IdentityApplyService(currentHostAddress));
|
|
|
+ EmailService get email =>
|
|
|
+ findService(() => new EmailService(currentHostAddress));
|
|
|
|
|
|
- LoginService get login =>
|
|
|
- findService(() => new LoginService(currentHostAddress));
|
|
|
+ IdentityApplyService get identityApply =>
|
|
|
+ findService(() => new IdentityApplyService(currentHostAddress));
|
|
|
|
|
|
- NotificationService get notification =>
|
|
|
- findService(() => new NotificationService(currentHostAddress));
|
|
|
+ LoginService get login =>
|
|
|
+ findService(() => new LoginService(currentHostAddress));
|
|
|
|
|
|
- OrganizationService get organization =>
|
|
|
- findService(() => new OrganizationService(currentHostAddress));
|
|
|
+ NotificationService get notification =>
|
|
|
+ findService(() => new NotificationService(currentHostAddress));
|
|
|
|
|
|
- PatientService get patient =>
|
|
|
- findService(() => new PatientService(currentHostAddress));
|
|
|
+ OrganizationService get organization =>
|
|
|
+ findService(() => new OrganizationService(currentHostAddress));
|
|
|
|
|
|
- PositionService get position =>
|
|
|
- findService(() => new PositionService(currentHostAddress));
|
|
|
+ PatientService get patient =>
|
|
|
+ findService(() => new PatientService(currentHostAddress));
|
|
|
|
|
|
- RankService get rank =>
|
|
|
- findService(() => new RankService(currentHostAddress));
|
|
|
+ PositionService get position =>
|
|
|
+ findService(() => new PositionService(currentHostAddress));
|
|
|
|
|
|
- RecordInfoService get recordInfo =>
|
|
|
- findService(() => new RecordInfoService(currentHostAddress));
|
|
|
+ RankService get rank =>
|
|
|
+ findService(() => new RankService(currentHostAddress));
|
|
|
|
|
|
- RegionService get region =>
|
|
|
- findService(() => new RegionService(currentHostAddress));
|
|
|
+ RecordInfoService get recordInfo =>
|
|
|
+ findService(() => new RecordInfoService(currentHostAddress));
|
|
|
|
|
|
- RemedicalService get remedical =>
|
|
|
- findService(() => new RemedicalService(currentHostAddress));
|
|
|
+ RegionService get region =>
|
|
|
+ findService(() => new RegionService(currentHostAddress));
|
|
|
|
|
|
- RoleService get role =>
|
|
|
- findService(() => new RoleService(currentHostAddress));
|
|
|
+ RemedicalService get remedical =>
|
|
|
+ findService(() => new RemedicalService(currentHostAddress));
|
|
|
|
|
|
- SMSService get sMS =>
|
|
|
- findService(() => new SMSService(currentHostAddress));
|
|
|
+ RoleService get role =>
|
|
|
+ findService(() => new RoleService(currentHostAddress));
|
|
|
|
|
|
- StorageService get storage =>
|
|
|
- findService(() => new StorageService(currentHostAddress));
|
|
|
+ SMSService get sMS => findService(() => new SMSService(currentHostAddress));
|
|
|
|
|
|
- UserService get user =>
|
|
|
- findService(() => new UserService(currentHostAddress));
|
|
|
+ StorageService get storage =>
|
|
|
+ findService(() => new StorageService(currentHostAddress));
|
|
|
|
|
|
+ UserService get user =>
|
|
|
+ findService(() => new UserService(currentHostAddress));
|
|
|
|
|
|
- /* 服务代理设置 End */
|
|
|
+ /* 服务代理设置 End */
|
|
|
|
|
|
/// 设置服务主机地址
|
|
|
void setServerHost(String address) {
|
|
@@ -129,4 +132,3 @@ class JsonRpcProxy {
|
|
|
return _serviceCache[serviceType] as T;
|
|
|
}
|
|
|
}
|
|
|
-
|