Beispiel #1
0
        public QueryHotelDetailResponseModel QueryHotelDetail(QueryHotelDetailRequestModel query)
        {
            HotelDetailRequestEntity requestElong =
                Mapper.Map <QueryHotelDetailRequestModel, HotelDetailRequestEntity>(query);
            string responseElong = _hotelDetail.QueryStr(requestElong);
            BaseHotelResponseModel <QueryHotelDetailResponseModel> responseModel =
                JsonConvert.DeserializeObject <BaseHotelResponseModel <QueryHotelDetailResponseModel> >(responseElong);

            if (responseModel.Code != "0")
            {
                throw new Exception("api异常,请稍后再试");
            }
            return(responseModel.Result);
        }
Beispiel #2
0
        public HotelListResponseEntity Query(HotelDetailRequestEntity request)
        {
            var result = HotelApiAccess.Query <HotelDetailRequestEntity, HotelListResponseEntity>(request, "hotel.detail").Result;

            //#region 担保过滤
            //if (result.Hotels == null || (!result.Hotels.Any()))
            //{
            //    return result;
            //}
            //if (result.Hotels[0].Rooms == null || (!result.Hotels[0].Rooms.Any()))
            //{
            //    return result;
            //}
            //foreach (var room in result.Hotels[0].Rooms)
            //{
            //    if (room.RatePlans != null && room.RatePlans.Any())
            //    {
            //        room.RatePlans = room.RatePlans.Where(a => string.IsNullOrWhiteSpace(a.GuaranteeRuleIds)).ToArray();
            //    }
            //}
            //#endregion
            return(result);
        }
Beispiel #3
0
 public string QueryStr(HotelDetailRequestEntity request)
 {
     return(HotelApiAccess.Query(request, "hotel.detail"));
 }