device.dart 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  1. import 'dart:core';
  2. import 'package:fis_jsonrpc/client_base.dart';
  3. import 'package:fis_common/json_convert.dart';
  4. import 'device.m.dart';
  5. import 'notification.m.dart';
  6. import 'liveConsultation.m.dart';
  7. class DeviceService extends JsonRpcClientBase {
  8. DeviceService(
  9. String host, {
  10. String serviceName = "IDeviceService",
  11. Map<String, String>? headers,
  12. int? timeout,
  13. }) : super(
  14. host,
  15. serviceName,
  16. headers: headers,
  17. timeout: timeout,
  18. ) {
  19. /// 注册响应实体反序列化处理器
  20. FJsonConvert.setDecoder((map) => ProbeApplicationSettingInfoDTO.fromJson(map));
  21. FJsonConvert.setDecoder((map) => RemoteConnectsRequest.fromJson(map));
  22. FJsonConvert.setDecoder((map) => DevicePrinterParameterDTO.fromJson(map));
  23. FJsonConvert.setDecoder((map) => PageCollection<DeviceExtendInfoDTO>.fromJson(map));
  24. FJsonConvert.setDecoder((map) => DeviceExtendInfoDTO.fromJson(map));
  25. FJsonConvert.setDecoder((map) => PageCollection<SelectItemDTO>.fromJson(map));
  26. FJsonConvert.setDecoder((map) => SelectItemDTO.fromJson(map));
  27. FJsonConvert.setDecoder((map) => DeviceInfoDTO.fromJson(map));
  28. FJsonConvert.setDecoder((map) => PageCollection<DeviceInfoDTO>.fromJson(map));
  29. FJsonConvert.setDecoder((map) => DictionaryDTO.fromJson(map));
  30. FJsonConvert.setDecoder((map) => DeviceServerSettingResult.fromJson(map));
  31. FJsonConvert.setDecoder((map) => DiagnosisModuleDTO.fromJson(map));
  32. FJsonConvert.setDecoder((map) => ReportVideoDeviceInfoResult.fromJson(map));
  33. FJsonConvert.setDecoder((map) => JoinDeviceLiveRoomResult.fromJson(map));
  34. FJsonConvert.setDecoder((map) => CreateLiveShareInfoResult.fromJson(map));
  35. FJsonConvert.setDecoder((map) => JoinDeviceLiveRoomByShareResult.fromJson(map));
  36. FJsonConvert.setDecoder((map) => CreateLiveRoomInfoResult.fromJson(map));
  37. FJsonConvert.setDecoder((map) => DeviceControlParameterDataDTO.fromJson(map));
  38. FJsonConvert.setDecoder((map) => BrandModelOutputConfigDTO.fromJson(map));
  39. FJsonConvert.setDecoder((map) => PageResult<DevicePatchDTO>.fromJson(map));
  40. FJsonConvert.setDecoder((map) => DevicePatchDTO.fromJson(map));
  41. FJsonConvert.setDecoder((map) => DevicePatchVersionDTO.fromJson(map));
  42. FJsonConvert.setDecoder((map) => DevicePrinterVersionDTO.fromJson(map));
  43. FJsonConvert.setDecoder((map) => PageResult<DevicePrinterDTO>.fromJson(map));
  44. FJsonConvert.setDecoder((map) => DevicePrinterDTO.fromJson(map));
  45. FJsonConvert.setDecoder((map) => DeviceConnectStateResult.fromJson(map));
  46. }
  47. Future<ProbeApplicationSettingInfoDTO> getProbeApplicationSettingAsync(GetControlParametersRequest request) async {
  48. var rpcRst = await call("GetProbeApplicationSettingAsync", request);
  49. var result = ProbeApplicationSettingInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
  50. return result;
  51. }
  52. Future<RemoteConnectsRequest> findConnectingDeviceListAsync(GetDeviceRequest request) async {
  53. var rpcRst = await call("FindConnectingDeviceListAsync", request);
  54. var result = RemoteConnectsRequest.fromJson(rpcRst as Map<String, dynamic>);
  55. return result;
  56. }
  57. Future<bool> closeConnectingDeviceListAsync(GetDeviceRequest request) async {
  58. var rpcRst = await call("CloseConnectingDeviceListAsync", request);
  59. return rpcRst;
  60. }
  61. Future<List<DevicePrinterParameterDTO>> getDevicePrintersForUploadAsync(GetDevicePrintersForUploadRequest request) async {
  62. var rpcRst = await call("GetDevicePrintersForUploadAsync", request);
  63. var result = (rpcRst as List).map((e)=>DevicePrinterParameterDTO.fromJson(e as Map<String, dynamic>)).toList();
  64. return result;
  65. }
  66. Future<List<String>> getDevicePatchTypeListAsync(TokenRequest request) async {
  67. var rpcRst = await call("GetDevicePatchTypeListAsync", request);
  68. var result = (rpcRst as List).cast<String>().toList();
  69. return result;
  70. }
  71. Future<bool> existsDevicePrinterAsync(ExistsDevicePrinterRequest request) async {
  72. var rpcRst = await call("ExistsDevicePrinterAsync", request);
  73. return rpcRst;
  74. }
  75. Future<bool> batchInsertDevicePrintersDataAsync(MigrateDevicePrinterRequest request) async {
  76. var rpcRst = await call("BatchInsertDevicePrintersDataAsync", request);
  77. return rpcRst;
  78. }
  79. Future<bool> batchInsertDevicePatchsDataAsync(MigrateDevicePatchRequest request) async {
  80. var rpcRst = await call("BatchInsertDevicePatchsDataAsync", request);
  81. return rpcRst;
  82. }
  83. Future<PageCollection<DeviceExtendInfoDTO>> getOrganizationDeviceListAsync(GetPersonDeviceRequest request) async {
  84. var rpcRst = await call("GetOrganizationDeviceListAsync", request);
  85. var result = PageCollection<DeviceExtendInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
  86. return result;
  87. }
  88. Future<PageCollection<SelectItemDTO>> getPersonDeviceDropdownPageAsync(GetPersonDeviceDropdownPageRequest request) async {
  89. var rpcRst = await call("GetPersonDeviceDropdownPageAsync", request);
  90. var result = PageCollection<SelectItemDTO>.fromJson(rpcRst as Map<String, dynamic>);
  91. return result;
  92. }
  93. Future<bool> existConnectingDeviceInfoAsync(GetDeviceRequest request) async {
  94. var rpcRst = await call("ExistConnectingDeviceInfoAsync", request);
  95. return rpcRst;
  96. }
  97. Future<bool> heartRateAsync(TokenRequest request) async {
  98. var rpcRst = await call("HeartRateAsync", request);
  99. return rpcRst;
  100. }
  101. Future<DeviceInfoDTO> createDeviceInfoAsync(CreateDeviceRequest request) async {
  102. var rpcRst = await call("CreateDeviceInfoAsync", request);
  103. var result = DeviceInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
  104. return result;
  105. }
  106. Future<DeviceExtendInfoDTO> getDeviceInfoAsync(GetDeviceRequest request) async {
  107. var rpcRst = await call("GetDeviceInfoAsync", request);
  108. var result = DeviceExtendInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
  109. return result;
  110. }
  111. Future<DeviceInfoDTO> findDeviceInfoByNameAsync(FindDeviceInfoByNameRequest request) async {
  112. var rpcRst = await call("FindDeviceInfoByNameAsync", request);
  113. var result = DeviceInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
  114. return result;
  115. }
  116. Future<DeviceExtendInfoDTO> getDeviceByShortCodeAsync(GetDeviceByShortCodeRequest request) async {
  117. var rpcRst = await call("GetDeviceByShortCodeAsync", request);
  118. var result = DeviceExtendInfoDTO.fromJson(rpcRst as Map<String, dynamic>);
  119. return result;
  120. }
  121. Future<PageCollection<DeviceInfoDTO>> getDeviceInfoPageAsync(PageFilterRequest request) async {
  122. var rpcRst = await call("GetDeviceInfoPageAsync", request);
  123. var result = PageCollection<DeviceInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
  124. return result;
  125. }
  126. Future<bool> bindDeviceAsync(BindDeviceRequest request) async {
  127. var rpcRst = await call("BindDeviceAsync", request);
  128. return rpcRst;
  129. }
  130. Future<bool> modifyDeviceAsync(ModifyDeviceRequest request) async {
  131. var rpcRst = await call("ModifyDeviceAsync", request);
  132. return rpcRst;
  133. }
  134. Future<bool> updateDeviceAsync(UpdateDeviceRequest request) async {
  135. var rpcRst = await call("UpdateDeviceAsync", request);
  136. return rpcRst;
  137. }
  138. Future<String> createDictionaryItemAsync(CreateDictionaryItemRequest request) async {
  139. var rpcRst = await call("CreateDictionaryItemAsync", request);
  140. return rpcRst;
  141. }
  142. Future<List<DictionaryDTO>> findDeviceModelItemsAsync(FindDeviceModelItemsRequest request) async {
  143. var rpcRst = await call("FindDeviceModelItemsAsync", request);
  144. var result = (rpcRst as List).map((e)=>DictionaryDTO.fromJson(e as Map<String, dynamic>)).toList();
  145. return result;
  146. }
  147. Future<List<DictionaryDTO>> findDeviceTypeItemsAsync(FindDeviceTypeItemsRequest request) async {
  148. var rpcRst = await call("FindDeviceTypeItemsAsync", request);
  149. var result = (rpcRst as List).map((e)=>DictionaryDTO.fromJson(e as Map<String, dynamic>)).toList();
  150. return result;
  151. }
  152. Future<bool> createShareDeviceToUserAsync(CreateShareDeviceToUserRequest request) async {
  153. var rpcRst = await call("CreateShareDeviceToUserAsync", request);
  154. return rpcRst;
  155. }
  156. Future<bool> deleteShareDeviceToUserAsync(DeleteShareDeviceToUserRequest request) async {
  157. var rpcRst = await call("DeleteShareDeviceToUserAsync", request);
  158. return rpcRst;
  159. }
  160. Future<bool> removeDeviceRelevancyAsync(RemoveDeviceRelevancyRequest request) async {
  161. var rpcRst = await call("RemoveDeviceRelevancyAsync", request);
  162. return rpcRst;
  163. }
  164. Future<PageCollection<DeviceExtendInfoDTO>> getPersonDeviceListAsync(GetPersonDeviceRequest request) async {
  165. var rpcRst = await call("GetPersonDeviceListAsync", request);
  166. var result = PageCollection<DeviceExtendInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
  167. return result;
  168. }
  169. Future<PageCollection<DeviceExtendInfoDTO>> getPersonOrgDeviceListAsync(GetPersonDeviceRequest request) async {
  170. var rpcRst = await call("GetPersonOrgDeviceListAsync", request);
  171. var result = PageCollection<DeviceExtendInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
  172. return result;
  173. }
  174. Future<PageCollection<DeviceInfoDTO>> getDeviceListByPersonRoleAsync(GetPersonRoleDeviceRequest request) async {
  175. var rpcRst = await call("GetDeviceListByPersonRoleAsync", request);
  176. var result = PageCollection<DeviceInfoDTO>.fromJson(rpcRst as Map<String, dynamic>);
  177. return result;
  178. }
  179. Future<List<DeviceExtendInfoDTO>> findDevicesByOrganizationCodeAsync(FindDevicesByOrganizationCodeRequest request) async {
  180. var rpcRst = await call("FindDevicesByOrganizationCodeAsync", request);
  181. var result = (rpcRst as List).map((e)=>DeviceExtendInfoDTO.fromJson(e as Map<String, dynamic>)).toList();
  182. return result;
  183. }
  184. Future<List<SelectItemDTO>> getPersonDeviceDropdownListAsync(TokenRequest request) async {
  185. var rpcRst = await call("GetPersonDeviceDropdownListAsync", request);
  186. var result = (rpcRst as List).map((e)=>SelectItemDTO.fromJson(e as Map<String, dynamic>)).toList();
  187. return result;
  188. }
  189. Future<DeviceServerSettingResult> queryServerConfigAsync(TokenRequest request) async {
  190. var rpcRst = await call("QueryServerConfigAsync", request);
  191. var result = DeviceServerSettingResult.fromJson(rpcRst as Map<String, dynamic>);
  192. return result;
  193. }
  194. Future<bool> addDeviceToOrgAsync(AddDeviceToOrgRequest request) async {
  195. var rpcRst = await call("AddDeviceToOrgAsync", request);
  196. return rpcRst;
  197. }
  198. Future<List<String>> getDeviceBindUsersCodesAsync(GetDeviceRequest request) async {
  199. var rpcRst = await call("GetDeviceBindUsersCodesAsync", request);
  200. var result = (rpcRst as List).cast<String>().toList();
  201. return result;
  202. }
  203. Future<List<DiagnosisModuleDTO>> findDeviceDiagnosisModulesAsync(FindDeviceDiagnosisModulesRequest request) async {
  204. var rpcRst = await call("FindDeviceDiagnosisModulesAsync", request);
  205. var result = (rpcRst as List).map((e)=>DiagnosisModuleDTO.fromJson(e as Map<String, dynamic>)).toList();
  206. return result;
  207. }
  208. Future<bool> modifyDeviceDiagnosisModuleStateAsync(ModifyDeviceDiagnosisModuleStateRequest request) async {
  209. var rpcRst = await call("ModifyDeviceDiagnosisModuleStateAsync", request);
  210. return rpcRst;
  211. }
  212. Future<ReportVideoDeviceInfoResult> reportVideoDeviceInfoAsync(ReportVideoDeviceInfoRequest request) async {
  213. var rpcRst = await call("ReportVideoDeviceInfoAsync", request);
  214. var result = ReportVideoDeviceInfoResult.fromJson(rpcRst as Map<String, dynamic>);
  215. return result;
  216. }
  217. Future<int> getActiveDeviceCount() async {
  218. var rpcRst = await call("GetActiveDeviceCount", );
  219. return rpcRst;
  220. }
  221. Future<bool> sendControlParameterByDeviceAsync(SendControlParameterByDeviceRequest request) async {
  222. var rpcRst = await call("SendControlParameterByDeviceAsync", request);
  223. return rpcRst;
  224. }
  225. Future<JoinDeviceLiveRoomResult> joinDeviceLiveRoomAsync(JoinDeviceLiveRoomRequest request) async {
  226. var rpcRst = await call("JoinDeviceLiveRoomAsync", request);
  227. var result = JoinDeviceLiveRoomResult.fromJson(rpcRst as Map<String, dynamic>);
  228. return result;
  229. }
  230. Future<bool> leaveDeviceLiveRoomAsync(LeaveDeviceLiveRoomRequest request) async {
  231. var rpcRst = await call("LeaveDeviceLiveRoomAsync", request);
  232. return rpcRst;
  233. }
  234. Future<bool> reportLiveViewStateAsync(ReportLiveViewStateRequest request) async {
  235. var rpcRst = await call("ReportLiveViewStateAsync", request);
  236. return rpcRst;
  237. }
  238. Future<CreateLiveShareInfoResult> createLiveShareInfoAsync(CreateLiveShareInfoRequest request) async {
  239. var rpcRst = await call("CreateLiveShareInfoAsync", request);
  240. var result = CreateLiveShareInfoResult.fromJson(rpcRst as Map<String, dynamic>);
  241. return result;
  242. }
  243. Future<JoinDeviceLiveRoomByShareResult> joinDeviceLiveRoomByShareAsync(JoinDeviceLiveRoomByShareRequest request) async {
  244. var rpcRst = await call("JoinDeviceLiveRoomByShareAsync", request);
  245. var result = JoinDeviceLiveRoomByShareResult.fromJson(rpcRst as Map<String, dynamic>);
  246. return result;
  247. }
  248. Future<bool> leaveDeviceLiveRoomByShareAsync(LeaveDeviceLiveRoomByShareRequest request) async {
  249. var rpcRst = await call("LeaveDeviceLiveRoomByShareAsync", request);
  250. return rpcRst;
  251. }
  252. Future<bool> reportLiveViewStateByShareAsync(ReportLiveViewStateByShareRequest request) async {
  253. var rpcRst = await call("ReportLiveViewStateByShareAsync", request);
  254. return rpcRst;
  255. }
  256. Future<bool> reportLiveStateAsync(ReportLiveStateRequest request) async {
  257. var rpcRst = await call("ReportLiveStateAsync", request);
  258. return rpcRst;
  259. }
  260. Future<CreateLiveRoomInfoResult> createLiveRoomInfoAsync(CreateLiveRoomInfoRequest request) async {
  261. var rpcRst = await call("CreateLiveRoomInfoAsync", request);
  262. var result = CreateLiveRoomInfoResult.fromJson(rpcRst as Map<String, dynamic>);
  263. return result;
  264. }
  265. Future<bool> uploadConsultationDataAsync(UploadConsultationDataRequest request) async {
  266. var rpcRst = await call("UploadConsultationDataAsync", request);
  267. return rpcRst;
  268. }
  269. Future<DeviceControlParameterDataDTO> getControlParametersAsync(GetControlParametersRequest request) async {
  270. var rpcRst = await call("GetControlParametersAsync", request);
  271. var result = DeviceControlParameterDataDTO.fromJson(rpcRst as Map<String, dynamic>);
  272. return result;
  273. }
  274. Future<bool> applyRemoteConnectionAsync(ControlDeviceConnectRequest request) async {
  275. var rpcRst = await call("ApplyRemoteConnectionAsync", request);
  276. return rpcRst;
  277. }
  278. Future<bool> acceptRemoteConnnectionAsync(ControlDeviceResponseRequest request) async {
  279. var rpcRst = await call("AcceptRemoteConnnectionAsync", request);
  280. return rpcRst;
  281. }
  282. Future<bool> applyRemoteControlAsync(ControlDeviceParameterRequest request) async {
  283. var rpcRst = await call("ApplyRemoteControlAsync", request);
  284. return rpcRst;
  285. }
  286. Future<bool> getRemoteLogAsync(GetRemoteLogRequest request) async {
  287. var rpcRst = await call("GetRemoteLogAsync", request);
  288. return rpcRst;
  289. }
  290. Future<bool> responseRemoteLogAsync(RemoteLogResponseRequest request) async {
  291. var rpcRst = await call("ResponseRemoteLogAsync", request);
  292. return rpcRst;
  293. }
  294. Future<bool> scanBindDeviceAsync(ScanBindDeviceRequest request) async {
  295. var rpcRst = await call("ScanBindDeviceAsync", request);
  296. return rpcRst;
  297. }
  298. Future<bool> reportBrandModelOutputConfigAsync(ReportBrandModelOutputConfigRequest request) async {
  299. var rpcRst = await call("ReportBrandModelOutputConfigAsync", request);
  300. return rpcRst;
  301. }
  302. Future<List<BrandModelOutputConfigDTO>> syncBrandModelOutputConfigAsync(SyncBrandModelOutputConfigRequest request) async {
  303. var rpcRst = await call("SyncBrandModelOutputConfigAsync", request);
  304. var result = (rpcRst as List).map((e)=>BrandModelOutputConfigDTO.fromJson(e as Map<String, dynamic>)).toList();
  305. return result;
  306. }
  307. Future<List<String>> getBrandsAsync(GetBrandsRequest request) async {
  308. var rpcRst = await call("GetBrandsAsync", request);
  309. var result = (rpcRst as List).cast<String>().toList();
  310. return result;
  311. }
  312. Future<List<String>> getModelsAsync(GetModelsRequest request) async {
  313. var rpcRst = await call("GetModelsAsync", request);
  314. var result = (rpcRst as List).cast<String>().toList();
  315. return result;
  316. }
  317. Future<bool> addDevicePatchAsync(AddDevicePatchRequest request) async {
  318. var rpcRst = await call("AddDevicePatchAsync", request);
  319. return rpcRst;
  320. }
  321. Future<PageResult<DevicePatchDTO>> findDevicePatchPagesAsync(FindDevicePatchPageRequest request) async {
  322. var rpcRst = await call("FindDevicePatchPagesAsync", request);
  323. var result = PageResult<DevicePatchDTO>.fromJson(rpcRst as Map<String, dynamic>);
  324. return result;
  325. }
  326. Future<bool> deletePatchByCodeAsync(DeleteDevicePatchByCodeRequest request) async {
  327. var rpcRst = await call("DeletePatchByCodeAsync", request);
  328. return rpcRst;
  329. }
  330. Future<bool> updateDevicePatchAsync(UpdateDevicePatchRequest request) async {
  331. var rpcRst = await call("UpdateDevicePatchAsync", request);
  332. return rpcRst;
  333. }
  334. Future<bool> pushDevicePatchAsync(PushDevicePatchRequest request) async {
  335. var rpcRst = await call("PushDevicePatchAsync", request);
  336. return rpcRst;
  337. }
  338. Future<PageResult<DevicePatchDTO>> findPushDevicePatchPagesAsync(FindPushDevicePatchPageRequest request) async {
  339. var rpcRst = await call("FindPushDevicePatchPagesAsync", request);
  340. var result = PageResult<DevicePatchDTO>.fromJson(rpcRst as Map<String, dynamic>);
  341. return result;
  342. }
  343. Future<bool> uploadDeviceDownloadPatchProgressToUserAsync(UploadDeviceDownloadPatchProgressToUserRequest request) async {
  344. var rpcRst = await call("UploadDeviceDownloadPatchProgressToUserAsync", request);
  345. return rpcRst;
  346. }
  347. Future<bool> addDevicePatchVersionAsync(AddDevicePatchVersionRequest request) async {
  348. var rpcRst = await call("AddDevicePatchVersionAsync", request);
  349. return rpcRst;
  350. }
  351. Future<List<DevicePatchVersionDTO>> findDevicePatchVersionListAsync(FindDevicePatchListRequest request) async {
  352. var rpcRst = await call("FindDevicePatchVersionListAsync", request);
  353. var result = (rpcRst as List).map((e)=>DevicePatchVersionDTO.fromJson(e as Map<String, dynamic>)).toList();
  354. return result;
  355. }
  356. Future<bool> deleteDevicePatchVersionAsync(DeleteDevicePatchVersionRequest request) async {
  357. var rpcRst = await call("DeleteDevicePatchVersionAsync", request);
  358. return rpcRst;
  359. }
  360. Future<bool> addDevicePrinterVersionAsync(AddDevicePrinterVersionRequest request) async {
  361. var rpcRst = await call("AddDevicePrinterVersionAsync", request);
  362. return rpcRst;
  363. }
  364. Future<List<DevicePrinterVersionDTO>> findDevicePrinterVersionListAsync(FindDevicePrinterVersionListRequest request) async {
  365. var rpcRst = await call("FindDevicePrinterVersionListAsync", request);
  366. var result = (rpcRst as List).map((e)=>DevicePrinterVersionDTO.fromJson(e as Map<String, dynamic>)).toList();
  367. return result;
  368. }
  369. Future<bool> deleteDevicePrinterVersionAsync(DeleteDevicePrinterVersionRequest request) async {
  370. var rpcRst = await call("DeleteDevicePrinterVersionAsync", request);
  371. return rpcRst;
  372. }
  373. Future<bool> addDevicePrinterAsync(AddDevicePrinterRequest request) async {
  374. var rpcRst = await call("AddDevicePrinterAsync", request);
  375. return rpcRst;
  376. }
  377. Future<PageResult<DevicePrinterDTO>> findDevicePrinterPagesAsync(FindDevicePrinterPageRequest request) async {
  378. var rpcRst = await call("FindDevicePrinterPagesAsync", request);
  379. var result = PageResult<DevicePrinterDTO>.fromJson(rpcRst as Map<String, dynamic>);
  380. return result;
  381. }
  382. Future<bool> deletePrinterByCodeAsync(DeleteDevicePrinterByCodeRequest request) async {
  383. var rpcRst = await call("DeletePrinterByCodeAsync", request);
  384. return rpcRst;
  385. }
  386. Future<bool> updateDevicePrinterAsync(UpdateDevicePrinterRequest request) async {
  387. var rpcRst = await call("UpdateDevicePrinterAsync", request);
  388. return rpcRst;
  389. }
  390. Future<bool> setDevicePrinterAsync(SetDevicePrinterRequest request) async {
  391. var rpcRst = await call("SetDevicePrinterAsync", request);
  392. return rpcRst;
  393. }
  394. Future<bool> uploadDevicePrinterAsync(UploadDevicePrinterRequest request) async {
  395. var rpcRst = await call("UploadDevicePrinterAsync", request);
  396. return rpcRst;
  397. }
  398. Future<bool> restartDeviceAsync(RestartDeviceRequest request) async {
  399. var rpcRst = await call("RestartDeviceAsync", request);
  400. return rpcRst;
  401. }
  402. Future<bool> modifyEmergencyDeviceCodeAsync(ModifyEmergencyDeviceCodeRequest request) async {
  403. var rpcRst = await call("ModifyEmergencyDeviceCodeAsync", request);
  404. return rpcRst;
  405. }
  406. Future<String> sendCommandToDeviceAsync(SendCommandToDeviceRequest request) async {
  407. var rpcRst = await call("SendCommandToDeviceAsync", request);
  408. return rpcRst;
  409. }
  410. Future<String> sendResultToClientAsync(SendResultToClientRequest request) async {
  411. var rpcRst = await call("SendResultToClientAsync", request);
  412. return rpcRst;
  413. }
  414. Future<String> getResultFromServerAsync(GetResultFromServerRequest request) async {
  415. var rpcRst = await call("GetResultFromServerAsync", request);
  416. return rpcRst;
  417. }
  418. Future<bool> disconnectRemoteControl(RemoteConnectStautsRequest request) async {
  419. var rpcRst = await call("DisconnectRemoteControl", request);
  420. return rpcRst;
  421. }
  422. Future<bool> remoteConnectHeartRateAsync(RemoteConnectHeartRateRequest request) async {
  423. var rpcRst = await call("RemoteConnectHeartRateAsync", request);
  424. return rpcRst;
  425. }
  426. Future<bool> checkDeviceIsIdleAsync(GetDeviceRequest request) async {
  427. var rpcRst = await call("CheckDeviceIsIdleAsync", request);
  428. return rpcRst;
  429. }
  430. Future<String> checkUserIsExistRoomIdAsync(GetDeviceRequest request) async {
  431. var rpcRst = await call("CheckUserIsExistRoomIdAsync", request);
  432. return rpcRst;
  433. }
  434. Future<bool> addUserRemoteConnectAsync(AddUserRemoteConnectRequest request) async {
  435. var rpcRst = await call("AddUserRemoteConnectAsync", request);
  436. return rpcRst;
  437. }
  438. Future<bool> closeUserRemoteConnectAsync(GetDeviceRequest request) async {
  439. var rpcRst = await call("CloseUserRemoteConnectAsync", request);
  440. return rpcRst;
  441. }
  442. Future<bool> userCancelLogDownloadAsync(GetDeviceRequest request) async {
  443. var rpcRst = await call("UserCancelLogDownloadAsync", request);
  444. return rpcRst;
  445. }
  446. Future<List<DeviceConnectStateResult>> getDeviceStateListByTokenAsync(GetDeviceStateListRequest request) async {
  447. var rpcRst = await call("GetDeviceStateListByTokenAsync", request);
  448. var result = (rpcRst as List).map((e)=>DeviceConnectStateResult.fromJson(e as Map<String, dynamic>)).toList();
  449. return result;
  450. }
  451. Future<bool> deviceCancelLogDownloadAsync(DeivceCancelLogDownloadRequest request) async {
  452. var rpcRst = await call("DeviceCancelLogDownloadAsync", request);
  453. return rpcRst;
  454. }
  455. Future<bool> deviceRemoteConnectHeartRateAsync(RemoteConnectHeartRateRequest request) async {
  456. var rpcRst = await call("DeviceRemoteConnectHeartRateAsync", request);
  457. return rpcRst;
  458. }
  459. Future<bool> applyProbeApplicationSettingAsync(ProbeApplicationSettingRequest request) async {
  460. var rpcRst = await call("ApplyProbeApplicationSettingAsync", request);
  461. return rpcRst;
  462. }
  463. Future<bool> responseProbeApplicationSettingAsync(ProbeApplicationSettingResultRequest request) async {
  464. var rpcRst = await call("ResponseProbeApplicationSettingAsync", request);
  465. return rpcRst;
  466. }
  467. }