|
@@ -34,8 +34,11 @@ class JsonRpcProxy {
|
|
|
|
|
|
late String _currentHost;
|
|
|
|
|
|
+
|
|
|
+ late String _currentProtocol;
|
|
|
+
|
|
|
|
|
|
- String get currentHostAddress => "http://$_currentHost";
|
|
|
+ String get currentHostAddress => "$_currentProtocol://$_currentHost";
|
|
|
|
|
|
HashMap<Type, dynamic> _serviceCache = HashMap();
|
|
|
|
|
@@ -50,93 +53,90 @@ class JsonRpcProxy {
|
|
|
return _platformService!;
|
|
|
}
|
|
|
|
|
|
- LiveConsultationService get liveConsultation =>
|
|
|
- findService(() => new LiveConsultationService(currentHostAddress));
|
|
|
-
|
|
|
- AIDiagnosisService get aIDiagnosis =>
|
|
|
- findService(() => new AIDiagnosisService(currentHostAddress));
|
|
|
+ LiveConsultationService get liveConsultation =>
|
|
|
+ findService(() => new LiveConsultationService(currentHostAddress));
|
|
|
|
|
|
- ASRService get aSR =>
|
|
|
- findService(() => new ASRService(currentHostAddress));
|
|
|
+ AIDiagnosisService get aIDiagnosis =>
|
|
|
+ findService(() => new AIDiagnosisService(currentHostAddress));
|
|
|
|
|
|
- AuthenticationService get authentication =>
|
|
|
- findService(() => new AuthenticationService(currentHostAddress));
|
|
|
+ ASRService get aSR => findService(() => new ASRService(currentHostAddress));
|
|
|
|
|
|
- ConnectService get connect =>
|
|
|
- findService(() => new ConnectService(currentHostAddress));
|
|
|
+ AuthenticationService get authentication =>
|
|
|
+ findService(() => new AuthenticationService(currentHostAddress));
|
|
|
|
|
|
- DeployPlatformService get deployPlatform =>
|
|
|
- findService(() => new DeployPlatformService(currentHostAddress));
|
|
|
+ ConnectService get connect =>
|
|
|
+ findService(() => new ConnectService(currentHostAddress));
|
|
|
|
|
|
- DeviceService get device =>
|
|
|
- findService(() => new DeviceService(currentHostAddress));
|
|
|
+ DeployPlatformService get deployPlatform =>
|
|
|
+ findService(() => new DeployPlatformService(currentHostAddress));
|
|
|
|
|
|
- EducationService get education =>
|
|
|
- findService(() => new EducationService(currentHostAddress));
|
|
|
+ DeviceService get device =>
|
|
|
+ findService(() => new DeviceService(currentHostAddress));
|
|
|
|
|
|
- EmailService get email =>
|
|
|
- findService(() => new EmailService(currentHostAddress));
|
|
|
+ EducationService get education =>
|
|
|
+ findService(() => new EducationService(currentHostAddress));
|
|
|
|
|
|
- IdentityApplyService get identityApply =>
|
|
|
- findService(() => new IdentityApplyService(currentHostAddress));
|
|
|
+ EmailService get email =>
|
|
|
+ findService(() => new EmailService(currentHostAddress));
|
|
|
|
|
|
- LabService get lab =>
|
|
|
- findService(() => new LabService(currentHostAddress));
|
|
|
+ IdentityApplyService get identityApply =>
|
|
|
+ findService(() => new IdentityApplyService(currentHostAddress));
|
|
|
|
|
|
- LoginService get login =>
|
|
|
- findService(() => new LoginService(currentHostAddress));
|
|
|
+ LabService get lab => findService(() => new LabService(currentHostAddress));
|
|
|
|
|
|
- OrganizationService get organization =>
|
|
|
- findService(() => new OrganizationService(currentHostAddress));
|
|
|
+ LoginService get login =>
|
|
|
+ findService(() => new LoginService(currentHostAddress));
|
|
|
|
|
|
- PatientService get patient =>
|
|
|
- findService(() => new PatientService(currentHostAddress));
|
|
|
+ OrganizationService get organization =>
|
|
|
+ findService(() => new OrganizationService(currentHostAddress));
|
|
|
|
|
|
- PaymentService get payment =>
|
|
|
- findService(() => new PaymentService(currentHostAddress));
|
|
|
+ PatientService get patient =>
|
|
|
+ findService(() => new PatientService(currentHostAddress));
|
|
|
|
|
|
- PositionService get position =>
|
|
|
- findService(() => new PositionService(currentHostAddress));
|
|
|
+ PaymentService get payment =>
|
|
|
+ findService(() => new PaymentService(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));
|
|
|
|
|
|
- ReportService get report =>
|
|
|
- findService(() => new ReportService(currentHostAddress));
|
|
|
+ RemedicalService get remedical =>
|
|
|
+ findService(() => new RemedicalService(currentHostAddress));
|
|
|
|
|
|
- RoleService get role =>
|
|
|
- findService(() => new RoleService(currentHostAddress));
|
|
|
+ ReportService get report =>
|
|
|
+ findService(() => new ReportService(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));
|
|
|
|
|
|
- UpgradeService get upgrade =>
|
|
|
- findService(() => new UpgradeService(currentHostAddress));
|
|
|
+ StorageService get storage =>
|
|
|
+ findService(() => new StorageService(currentHostAddress));
|
|
|
|
|
|
- UserService get user =>
|
|
|
- findService(() => new UserService(currentHostAddress));
|
|
|
+ UpgradeService get upgrade =>
|
|
|
+ findService(() => new UpgradeService(currentHostAddress));
|
|
|
|
|
|
- VinnoServerService get vinnoServer =>
|
|
|
- findService(() => new VinnoServerService(currentHostAddress));
|
|
|
+ UserService get user =>
|
|
|
+ findService(() => new UserService(currentHostAddress));
|
|
|
|
|
|
+ VinnoServerService get vinnoServer =>
|
|
|
+ findService(() => new VinnoServerService(currentHostAddress));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- void setServerHost(String address) {
|
|
|
+ void setServerHost(String address, [bool useSSL = false]) {
|
|
|
logger.i('JsonRpcProxy setServerHost :' + address);
|
|
|
+ _currentProtocol = useSSL ? "https" : "http";
|
|
|
_currentHost = address;
|
|
|
}
|
|
|
|
|
@@ -156,4 +156,3 @@ class JsonRpcProxy {
|
|
|
return _serviceCache[serviceType] as T;
|
|
|
}
|
|
|
}
|
|
|
-
|