import 'dart:core'; import 'package:fis_jsonrpc/client_base.dart'; import 'package:fis_common/json_convert.dart'; import 'identityApplyDB.m.dart'; import 'device.m.dart'; import 'identityApply.m.dart'; class IdentityApplyDBService extends JsonRpcClientBase { IdentityApplyDBService( String host, { String serviceName = "IIdentityApplyDBService", Map? headers, int? timeout, }) : super( host, serviceName, headers: headers, timeout: timeout, ) { /// 注册响应实体反序列化处理器 FJsonConvert.setDecoder((map) => IdentityApplyDTO.fromJson(map)); FJsonConvert.setDecoder((map) => PageCollection.fromJson(map)); } Future insertIdentityApplyAsync(CreateIdentityApplyDBRequest request) async { var rpcRst = await call("InsertIdentityApplyAsync", request); return rpcRst; } Future findIdentityApplyByNameAsync(String name) async { var rpcRst = await call("FindIdentityApplyByNameAsync", name); var result = IdentityApplyDTO.fromJson(rpcRst as Map); return result; } Future findIdentityApplyByCodeAsync(String code) async { var rpcRst = await call("FindIdentityApplyByCodeAsync", code); var result = IdentityApplyDTO.fromJson(rpcRst as Map); return result; } Future> findIdentityApplyPagesAsync(PageRequest request) async { var rpcRst = await call("FindIdentityApplyPagesAsync", request); var result = PageCollection.fromJson(rpcRst as Map); return result; } Future deleteIdentityApplyByCodeAsync(String code) async { var rpcRst = await call("DeleteIdentityApplyByCodeAsync", code); return rpcRst; } Future updateIdentityApplyByCodeAsync(String code,IdentityApplyDTO data,String extensionData) async { var rpcRst = await call("UpdateIdentityApplyByCodeAsync", [code,data,extensionData]); return rpcRst; } Future> getIdentityApplyByUserCode(String userCode) async { var rpcRst = await call("GetIdentityApplyByUserCode", userCode); var result = (rpcRst as List).map((e)=>IdentityApplyDTO.fromJson(e as Map)).toList(); return result; } Future> findIdentityApplyListByUserCodeAsync(List userCodes) async { var rpcRst = await call("FindIdentityApplyListByUserCodeAsync", userCodes); var result = (rpcRst as List).map((e)=>IdentityApplyDTO.fromJson(e as Map)).toList(); return result; } }