import 'liveConsultation.m.dart'; class IDCardInfoResult { String? name; String? idCardNo; String? gender; String? nation; String? birthDay; String? address; IDCardInfoResult({ this.name, this.idCardNo, this.gender, this.nation, this.birthDay, this.address, }); factory IDCardInfoResult.fromJson(Map map) { return IDCardInfoResult( name: map['Name'], idCardNo: map['IdCardNo'], gender: map['Gender'], nation: map['Nation'], birthDay: map['BirthDay'], address: map['Address'], ); } Map toJson() { final map = Map(); if (name != null) { map['Name'] = name; } if (idCardNo != null) { map['IdCardNo'] = idCardNo; } if (gender != null) { map['Gender'] = gender; } if (nation != null) { map['Nation'] = nation; } if (birthDay != null) { map['BirthDay'] = birthDay; } if (address != null) { map['Address'] = address; } return map; } } class RecognitionResult { int statusCode; bool isSuccess; IDCardInfoResult? iDCardData; RecognitionResult({ this.statusCode = 0, this.isSuccess = false, this.iDCardData, }); factory RecognitionResult.fromJson(Map map) { return RecognitionResult( statusCode: map['StatusCode'], isSuccess: map['IsSuccess'], iDCardData: map['IDCardData'] != null ? IDCardInfoResult.fromJson(map['IDCardData']) : null, ); } Map toJson() { final map = Map(); map['StatusCode'] = statusCode; map['IsSuccess'] = isSuccess; if (iDCardData != null) { map['IDCardData'] = iDCardData; } return map; } } enum UploadFileDataTypeEnum { ImageUrl, ImageBase64, } class IDCardInfoRequest extends TokenRequest{ String? imageData; UploadFileDataTypeEnum imageDataType; IDCardInfoRequest({ this.imageData, this.imageDataType = UploadFileDataTypeEnum.ImageUrl, String? token, }) : super( token: token, ); factory IDCardInfoRequest.fromJson(Map map) { return IDCardInfoRequest( imageData: map['ImageData'], imageDataType: UploadFileDataTypeEnum.values.firstWhere((e) => e.index == map['ImageDataType']), token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (imageData != null) map['ImageData'] = imageData; map['ImageDataType'] = imageDataType.index; return map; } } class AddOrUpdatePersonRequest extends TokenRequest{ String? groupId; String? personId; String? faceUrl; AddOrUpdatePersonRequest({ this.groupId, this.personId, this.faceUrl, String? token, }) : super( token: token, ); factory AddOrUpdatePersonRequest.fromJson(Map map) { return AddOrUpdatePersonRequest( groupId: map['GroupId'], personId: map['PersonId'], faceUrl: map['FaceUrl'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (groupId != null) map['GroupId'] = groupId; if (personId != null) map['PersonId'] = personId; if (faceUrl != null) map['FaceUrl'] = faceUrl; return map; } } class RecognitionPersonDTO { String? personId; String? faceId; double score; RecognitionPersonDTO({ this.personId, this.faceId, this.score = 0, }); factory RecognitionPersonDTO.fromJson(Map map) { return RecognitionPersonDTO( personId: map['PersonId'], faceId: map['FaceId'], score: double.parse(map['Score'].toString()), ); } Map toJson() { final map = Map(); if (personId != null) { map['PersonId'] = personId; } if (faceId != null) { map['FaceId'] = faceId; } map['Score'] = score; return map; } } class SearchPersonsResult { bool isSearchSuccess; String? errMessage; bool hasPerson; RecognitionPersonDTO? personInfo; List? persons; SearchPersonsResult({ this.isSearchSuccess = false, this.errMessage, this.hasPerson = false, this.personInfo, this.persons, }); factory SearchPersonsResult.fromJson(Map map) { return SearchPersonsResult( isSearchSuccess: map['IsSearchSuccess'], errMessage: map['ErrMessage'], hasPerson: map['HasPerson'], personInfo: map['PersonInfo'] != null ? RecognitionPersonDTO.fromJson(map['PersonInfo']) : null, persons: map['Persons'] != null ? (map['Persons'] as List).map((e)=>RecognitionPersonDTO.fromJson(e as Map)).toList() : null, ); } Map toJson() { final map = Map(); map['IsSearchSuccess'] = isSearchSuccess; if (errMessage != null) { map['ErrMessage'] = errMessage; } map['HasPerson'] = hasPerson; if (personInfo != null) { map['PersonInfo'] = personInfo; } if (persons != null) { map['Persons'] = persons; } return map; } } class SearchPersonsRequest extends TokenRequest{ String? groupId; String? faceUrl; SearchPersonsRequest({ this.groupId, this.faceUrl, String? token, }) : super( token: token, ); factory SearchPersonsRequest.fromJson(Map map) { return SearchPersonsRequest( groupId: map['GroupId'], faceUrl: map['FaceUrl'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (groupId != null) map['GroupId'] = groupId; if (faceUrl != null) map['FaceUrl'] = faceUrl; return map; } } class SavePersonResult { bool success; String? errMessage; SavePersonResult({ this.success = false, this.errMessage, }); factory SavePersonResult.fromJson(Map map) { return SavePersonResult( success: map['Success'], errMessage: map['ErrMessage'], ); } Map toJson() { final map = Map(); map['Success'] = success; if (errMessage != null) { map['ErrMessage'] = errMessage; } return map; } } class SavePersonRequest extends TokenRequest{ String? groupId; String? personId; String? faceUrl; SavePersonRequest({ this.groupId, this.personId, this.faceUrl, String? token, }) : super( token: token, ); factory SavePersonRequest.fromJson(Map map) { return SavePersonRequest( groupId: map['GroupId'], personId: map['PersonId'], faceUrl: map['FaceUrl'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (groupId != null) map['GroupId'] = groupId; if (personId != null) map['PersonId'] = personId; if (faceUrl != null) map['FaceUrl'] = faceUrl; return map; } } class DeletePersonResult { bool success; String? errMessage; DeletePersonResult({ this.success = false, this.errMessage, }); factory DeletePersonResult.fromJson(Map map) { return DeletePersonResult( success: map['Success'], errMessage: map['ErrMessage'], ); } Map toJson() { final map = Map(); map['Success'] = success; if (errMessage != null) { map['ErrMessage'] = errMessage; } return map; } } class DeletePersonRequest extends TokenRequest{ String? groupId; String? personId; DeletePersonRequest({ this.groupId, this.personId, String? token, }) : super( token: token, ); factory DeletePersonRequest.fromJson(Map map) { return DeletePersonRequest( groupId: map['GroupId'], personId: map['PersonId'], token: map['Token'], ); } Map toJson() { final map = super.toJson(); if (groupId != null) map['GroupId'] = groupId; if (personId != null) map['PersonId'] = personId; return map; } }