Esempio n. 1
0
        public ResultJson <GetRestaurantListResponse> UserPreferenceRest(GetUserPreferenceRestRequest request)
        {
            ResultJson <GetRestaurantListResponse> result = new ResultJson <GetRestaurantListResponse>();
            var List_Customer = CacheForModelCustomerLike.Instance.GetCustomLike(request.UserId);

            List_Customer = List_Customer.Where(p => p.type == UserLikeTypeVariable.RestLike).ToList();
            var List_Rest = CacheForModelRestaurant.Instance.RestaurantList();

            foreach (var item in List_Customer)
            {
                var rest = List_Rest.Where(p => p.id == item.lid).FirstOrDefault();
                if (rest != null)
                {
                    GetRestaurantListResponse response = new GetRestaurantListResponse(rest, request.CoordX, request.CoordY, SeachRange2);
                    result.ListData.Add(response);
                }
            }
            result.ListData = Paging.Instance.PageData(result.ListData, request.PageNo);
            if (result.ListData.Count != 0)
            {
                result.HttpCode = 200;
                result.Message  = Enum_Message.SuccessMessage.Enum_GetString();
            }
            else
            {
                result.HttpCode = 300;
                result.Message  = Enum_Message.NoMoreDataMessage.Enum_GetString();
            }
            return(result);
        }
 public ResultJson <GetRestaurantListResponse> UserPreferenceRest(GetUserPreferenceRestRequest request)
 {
     return(RestaurantBiz.Instance.UserPreferenceRest(request));
 }