deployPlatform.dart 824 B

1234567891011121314151617181920212223242526272829303132
  1. import 'dart:core';
  2. import 'package:fis_jsonrpc/client_base.dart';
  3. import 'package:fis_common/json_convert.dart';
  4. import 'deployPlatform.m.dart';
  5. class DeployPlatformService extends JsonRpcClientBase {
  6. DeployPlatformService(
  7. String host, {
  8. String serviceName = "IDeployPlatformService",
  9. Map<String, String>? headers,
  10. int? timeout,
  11. }) : super(
  12. host,
  13. serviceName,
  14. headers: headers,
  15. timeout: timeout,
  16. ) {
  17. /// 注册响应实体反序列化处理器
  18. FJsonConvert.setDecoder((map) => DeployPlatServerInfoDTO.fromJson(map));
  19. }
  20. Future<List<DeployPlatServerInfoDTO>> getServerListAsync() async {
  21. var rpcRst = await call("GetServerListAsync", );
  22. var result = (rpcRst as List).map((e)=>DeployPlatServerInfoDTO.fromJson(e as Map<String, dynamic>)).toList();
  23. return result;
  24. }
  25. }