Exemplo n.º 1
0
        public static SearchFaceResponse Unmarshall(UnmarshallerContext context)
        {
            SearchFaceResponse searchFaceResponse = new SearchFaceResponse();

            searchFaceResponse.HttpResponse = context.HttpResponse;
            searchFaceResponse.RequestId    = context.StringValue("SearchFace.RequestId");
            searchFaceResponse.Code         = context.IntegerValue("SearchFace.Code");
            searchFaceResponse.Message      = context.StringValue("SearchFace.Message");
            searchFaceResponse.Success      = context.BooleanValue("SearchFace.Success");

            SearchFaceResponse.SearchFace_Data data = new SearchFaceResponse.SearchFace_Data();

            List <SearchFaceResponse.SearchFace_Data.SearchFace_TopUserItemItem> data_topUserItem = new List <SearchFaceResponse.SearchFace_Data.SearchFace_TopUserItemItem>();

            for (int i = 0; i < context.Length("SearchFace.Data.TopUserItem.Length"); i++)
            {
                SearchFaceResponse.SearchFace_Data.SearchFace_TopUserItemItem topUserItemItem = new SearchFaceResponse.SearchFace_Data.SearchFace_TopUserItemItem();
                topUserItemItem.UserId = context.StringValue("SearchFace.Data.TopUserItem[" + i + "].UserId");
                topUserItemItem.Score  = context.FloatValue("SearchFace.Data.TopUserItem[" + i + "].Score");

                data_topUserItem.Add(topUserItemItem);
            }
            data.TopUserItem        = data_topUserItem;
            searchFaceResponse.Data = data;

            return(searchFaceResponse);
        }
Exemplo n.º 2
0
        public static SearchFaceResponse Unmarshall(UnmarshallerContext _ctx)
        {
            SearchFaceResponse searchFaceResponse = new SearchFaceResponse();

            searchFaceResponse.HttpResponse = _ctx.HttpResponse;
            searchFaceResponse.RequestId    = _ctx.StringValue("SearchFace.RequestId");

            SearchFaceResponse.SearchFace_Data data = new SearchFaceResponse.SearchFace_Data();

            List <SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem> data_matchList = new List <SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem>();

            for (int i = 0; i < _ctx.Length("SearchFace.Data.MatchList.Length"); i++)
            {
                SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem matchListItem = new SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem();

                SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_Location location = new SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_Location();
                location.X             = _ctx.IntegerValue("SearchFace.Data.MatchList[" + i + "].Location.X");
                location.Y             = _ctx.IntegerValue("SearchFace.Data.MatchList[" + i + "].Location.Y");
                location.Height        = _ctx.IntegerValue("SearchFace.Data.MatchList[" + i + "].Location.Height");
                location.Width         = _ctx.IntegerValue("SearchFace.Data.MatchList[" + i + "].Location.Width");
                matchListItem.Location = location;

                List <SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_FaceItemsItem> matchListItem_faceItems = new List <SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_FaceItemsItem>();
                for (int j = 0; j < _ctx.Length("SearchFace.Data.MatchList[" + i + "].FaceItems.Length"); j++)
                {
                    SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_FaceItemsItem faceItemsItem = new SearchFaceResponse.SearchFace_Data.SearchFace_MatchListItem.SearchFace_FaceItemsItem();
                    faceItemsItem.FaceId    = _ctx.StringValue("SearchFace.Data.MatchList[" + i + "].FaceItems[" + j + "].FaceId");
                    faceItemsItem.EntityId  = _ctx.StringValue("SearchFace.Data.MatchList[" + i + "].FaceItems[" + j + "].EntityId");
                    faceItemsItem.Score     = _ctx.FloatValue("SearchFace.Data.MatchList[" + i + "].FaceItems[" + j + "].Score");
                    faceItemsItem.DbName    = _ctx.StringValue("SearchFace.Data.MatchList[" + i + "].FaceItems[" + j + "].DbName");
                    faceItemsItem.ExtraData = _ctx.StringValue("SearchFace.Data.MatchList[" + i + "].FaceItems[" + j + "].ExtraData");

                    matchListItem_faceItems.Add(faceItemsItem);
                }
                matchListItem.FaceItems = matchListItem_faceItems;

                data_matchList.Add(matchListItem);
            }
            data.MatchList          = data_matchList;
            searchFaceResponse.Data = data;

            return(searchFaceResponse);
        }
        public static SearchFaceResponse Unmarshall(UnmarshallerContext context)
        {
            SearchFaceResponse searchFaceResponse = new SearchFaceResponse();

            searchFaceResponse.HttpResponse = context.HttpResponse;
            searchFaceResponse.Code         = context.StringValue("SearchFace.Code");
            searchFaceResponse.Message      = context.StringValue("SearchFace.Message");
            searchFaceResponse.RequestId    = context.StringValue("SearchFace.RequestId");

            SearchFaceResponse.SearchFace_Data data = new SearchFaceResponse.SearchFace_Data();
            data.PageNo     = context.IntegerValue("SearchFace.Data.PageNo");
            data.PageSize   = context.IntegerValue("SearchFace.Data.PageSize");
            data.TotalCount = context.IntegerValue("SearchFace.Data.TotalCount");
            data.TotalPage  = context.IntegerValue("SearchFace.Data.TotalPage");

            List <SearchFaceResponse.SearchFace_Data.SearchFace_Record> data_records = new List <SearchFaceResponse.SearchFace_Data.SearchFace_Record>();

            for (int i = 0; i < context.Length("SearchFace.Data.Records.Length"); i++)
            {
                SearchFaceResponse.SearchFace_Data.SearchFace_Record record = new SearchFaceResponse.SearchFace_Data.SearchFace_Record();
                record.GbId            = context.StringValue("SearchFace.Data.Records[" + i + "].GbId");
                record.ImageUrl        = context.StringValue("SearchFace.Data.Records[" + i + "].ImageUrl");
                record.LeftTopX        = context.FloatValue("SearchFace.Data.Records[" + i + "].LeftTopX");
                record.LeftTopY        = context.FloatValue("SearchFace.Data.Records[" + i + "].LeftTopY");
                record.MatchSuggestion = context.StringValue("SearchFace.Data.Records[" + i + "].MatchSuggestion");
                record.RightBottomX    = context.FloatValue("SearchFace.Data.Records[" + i + "].RightBottomX");
                record.RightBottomY    = context.FloatValue("SearchFace.Data.Records[" + i + "].RightBottomY");
                record.Score           = context.FloatValue("SearchFace.Data.Records[" + i + "].Score");
                record.TargetImageUrl  = context.StringValue("SearchFace.Data.Records[" + i + "].TargetImageUrl");
                record.SourceId        = context.StringValue("SearchFace.Data.Records[" + i + "].SourceId");

                data_records.Add(record);
            }
            data.Records            = data_records;
            searchFaceResponse.Data = data;

            return(searchFaceResponse);
        }