Ejemplo n.º 1
0
        /// <summary>
        /// 查询艺龙酒店列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public QueryHotelInfoResponseModel QueryHotelList(QueryHotelInfoRequestModel query)
        {
            HotelListRequestEntity requestElong =
                Mapper.Map <QueryHotelInfoRequestModel, HotelListRequestEntity>(query);
            string responseElong = _hotelListService.QueryStr(requestElong);
            BaseHotelResponseModel <QueryHotelInfoResponseModel> responseModel =
                JsonConvert.DeserializeObject <BaseHotelResponseModel <QueryHotelInfoResponseModel> >(responseElong);

            if (responseModel.Code != "0")
            {
                throw new Exception("api异常,请稍后再试");
            }
            return(responseModel.Result);

            //HotelListResponseEntity responseElong = _hotelListService.Query(requestElong);
            //return Mapper.Map<HotelListResponseEntity, QueryHotelInfoResponseModel>(responseElong);
        }
Ejemplo n.º 2
0
 public string QueryStr(HotelListRequestEntity request)
 {
     return(HotelApiAccess.Query(request, "hotel.list"));
 }
Ejemplo n.º 3
0
 public HotelListResponseEntity Query(HotelListRequestEntity request)
 {
     return(HotelApiAccess.Query <HotelListRequestEntity, HotelListResponseEntity>(request, "hotel.list").Result);
 }