/** * this method finds the Restaurant for given id from database. * * @param id * @return Restaurant */ public Restaurant findRestaurantById(String id) { Address address = new Address(); address.setAddress1("First Floor, Ektha Pearl"); address.setAddress2("Above Ratnadeep Supermarket"); address.setArea("Kothaguda"); address.setCity("Hyderabad"); address.setState("Telangana"); address.setPincode("500081"); address.setMobileNumber("9032814444"); List<String> restaurantUrls = new ArrayList<String>(); restaurantUrls.add("/RES_04/courosel1.png"); restaurantUrls.add("/RES_04/courosel2.png"); restaurantUrls.add("/RES_04/courosel3.png"); StringBuffer addInformation = new StringBuffer(); addInformation.append("1) Valet Parking").append("\n").append("Alchol available"); // available meal types will have meal type, menu description or menu url and available days RestaurantProfile restaurantProfile = new RestaurantProfile( "RES_04", "Anantara Fine Dining Bar & Banquets", address, "http://www.facebook.com/Anantara", "/RES_04/logo.png", restaurantUrls, addInformation.toString()); List<Meal> availableMeals = new ArrayList<Meal>(); Meal brunchMealType = new Meal(MealType.BRUNCH, new BigDecimal(800)); brunchMealType.setTimings("08:00 AM to 10:00 AM"); availableMeals.add(brunchMealType); Meal lunchMealType = new Meal(MealType.LUNCH, new BigDecimal(1000)); lunchMealType.setTimings("12:00 PM to 03:00 PM"); availableMeals.add(lunchMealType); Meal dinnerMealType = new Meal(MealType.DINNER, new BigDecimal(900)); dinnerMealType.setTimings("07:00 PM to 10:00 PM"); availableMeals.add(dinnerMealType); List<Date> holidayDates = new ArrayList<Date>(); holidayDates.add(new Date()); Restaurant restaurant = new Restaurant(restaurantProfile); restaurant.setAvailableMeals(availableMeals); restaurant.setReviews(new Reviews(3.5f, 256)); restaurant.setHolidayDates(holidayDates); return restaurant; }
/** * This method will return List of RestaurantSearchDetail for given filterCriteria. * * @param filterCriteria * @return List<RestaurantSearchDetail> */ public List<RestaurantSearchDetail> findRestaurantByFilterCriteria( FilterCriteria filterCriteria) { List<RestaurantSearchDetail> restaurantSearchDetailList = new ArrayList<RestaurantSearchDetail>(); Address address = new Address(); address.setAddress1("First Floor, Ektha Pearl"); address.setAddress2("Above Ratnadeep Supermarket"); address.setArea("Kothaguda"); address.setCity("Hyderabad"); address.setState("Telangana"); address.setPincode("500081"); address.setMobileNumber("9032814444"); List<String> restaurantUrls = new ArrayList<String>(); restaurantUrls.add("/RES_04/courosel1.png"); restaurantUrls.add("/RES_04/courosel2.png"); restaurantUrls.add("/RES_04/courosel3.png"); StringBuffer addInformation = new StringBuffer(); addInformation.append("1) Valet Parking").append("\n").append("Alchol available"); // available meal types will have meal type, menu description or menu url and available days RestaurantProfile restaurantProfile = new RestaurantProfile( "RES_04", "Anantara Fine Dining Bar & Banquets", address, "http://www.facebook.com/Anantara", "/RES_04/logo.png", restaurantUrls, addInformation.toString()); RestaurantSearchDetail restaurantSearchDetail = new RestaurantSearchDetail( restaurantProfile, new BigDecimal(900), 10, new BigDecimal(810), new BigDecimal(90), 4.8f); restaurantSearchDetailList.add(restaurantSearchDetail); return restaurantSearchDetailList; }
/** * This will get the preferred restaurant offers on the home page * * @param city * @return List<MainPageOffer> */ public List<MainPageOffer> getMainPageOffers(String city) { List<MainPageOffer> mainPageOffers = new ArrayList<MainPageOffer>(); // will pass this value to sql query if (logger.isDebugEnabled()) { logger.debug("Getting the Main Page offers for city {} ", city); } Address address = new Address(); address.setAddress1("First Floor, Ektha Pearl"); address.setAddress2("Above Ratnadeep Supermarket"); address.setArea("Kothaguda"); address.setCity("Hyderabad"); address.setState("Telangana"); address.setPincode("500081"); address.setMobileNumber("9032814444"); List<String> restaurantUrls = new ArrayList<String>(); restaurantUrls.add("/RES_04/courosel1.png"); RestaurantProfile restaurantProfile = new RestaurantProfile( "RES_04", "Anantara Fine Dining Bar & Banquets", address, null, null, restaurantUrls, null); MainPageOffer offer = new MainPageOffer(restaurantProfile, 20.00f); mainPageOffers.add(offer); mainPageOffers.add(offer); mainPageOffers.add(offer); return mainPageOffers; }