123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375 |
- 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<String, dynamic> map) {
- return IDCardInfoResult(
- name: map['Name'],
- idCardNo: map['IdCardNo'],
- gender: map['Gender'],
- nation: map['Nation'],
- birthDay: map['BirthDay'],
- address: map['Address'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return RecognitionResult(
- statusCode: map['StatusCode'],
- isSuccess: map['IsSuccess'],
- iDCardData: map['IDCardData'] != null ? IDCardInfoResult.fromJson(map['IDCardData']) : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return IDCardInfoRequest(
- imageData: map['ImageData'],
- imageDataType: UploadFileDataTypeEnum.values.firstWhere((e) => e.index == map['ImageDataType']),
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return AddOrUpdatePersonRequest(
- groupId: map['GroupId'],
- personId: map['PersonId'],
- faceUrl: map['FaceUrl'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return RecognitionPersonDTO(
- personId: map['PersonId'],
- faceId: map['FaceId'],
- score: double.parse(map['Score'].toString()),
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<RecognitionPersonDTO>? persons;
- SearchPersonsResult({
- this.isSearchSuccess = false,
- this.errMessage,
- this.hasPerson = false,
- this.personInfo,
- this.persons,
- });
- factory SearchPersonsResult.fromJson(Map<String, dynamic> 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<String,dynamic>)).toList() : null,
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return SearchPersonsRequest(
- groupId: map['GroupId'],
- faceUrl: map['FaceUrl'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return SavePersonResult(
- success: map['Success'],
- errMessage: map['ErrMessage'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return SavePersonRequest(
- groupId: map['GroupId'],
- personId: map['PersonId'],
- faceUrl: map['FaceUrl'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> 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<String, dynamic> map) {
- return DeletePersonResult(
- success: map['Success'],
- errMessage: map['ErrMessage'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = Map<String, dynamic>();
- 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<String, dynamic> map) {
- return DeletePersonRequest(
- groupId: map['GroupId'],
- personId: map['PersonId'],
- token: map['Token'],
- );
- }
- Map<String, dynamic> toJson() {
- final map = super.toJson();
- if (groupId != null)
- map['GroupId'] = groupId;
- if (personId != null)
- map['PersonId'] = personId;
- return map;
- }
- }
|