示例#1
0
        public async Task <BaseResponse <List <YachtSimilarItem> > > SearchSimilar(YachtSimilarSearchModel searchModel)
        {
            try
            {
                string url       = _baseYatchApiUrl + _yachtPortalApiUrl.Yatchs.SearchSimilar;
                string paramater = ConvertToUrlParameter(searchModel);
                url = url + paramater;
                var response = await _apiExcute.GetData <List <YachtSimilarItem> >(url, null);

                return(response);
            }
            catch (Exception ex)
            {
                return(BaseResponse <List <YachtSimilarItem> > .InternalServerError(message : ex.Message, fullMsg : ex.StackTrace));
            }
        }
示例#2
0
        public async Task <IActionResult> YachtSearchSimilarResult(string yachtId, string country, YachtSimilarSearchModel searchModel)
        {
            searchModel.ExcludeYachtID = Convert.ToInt32(Terminator.Decrypt(yachtId));
            var yatchApiResponse = await _yatchService.SearchSimilar(searchModel);

            var responseData    = yatchApiResponse.GetDataResponse();
            var searchModelPass = new YachtSearchModel
            {
                CheckIn    = searchModel.CheckIn,
                CheckOut   = searchModel.CheckOut,
                City       = searchModel.City,
                Passengers = searchModel.NumOfPassenger,
                Country    = country
            };

            foreach (var item in responseData)
            {
                await PreparingYachtCustomProperties(item);

                PreparingYachtLink(item, searchModelPass);
            }
            return(Ok(responseData));
        }
示例#3
0
        public IActionResult SearchSimilarYacht([FromQuery] YachtSimilarSearchModel searchModel)
        {
            var result = _yachtService.YachtSearchSimilarStoreProcedure(searchModel);

            return(Ok(result));
        }