Пример #1
0
 public static void main(String[] args) {
   List<UserMeal> mealList =
       Arrays.asList(
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 30, 10, 0), "Завтрак", 500),
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 30, 13, 0), "Обед", 1000),
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 30, 20, 0), "Ужин", 500),
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 31, 10, 0), "Завтрак", 1000),
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 31, 13, 0), "Обед", 500),
           new UserMeal(LocalDateTime.of(2015, Month.MAY, 31, 20, 0), "Ужин", 510));
   getFilteredWithExceeded(mealList, LocalTime.of(7, 0), LocalTime.of(12, 0), 2000);
   //        .toLocalDate();
   //        .toLocalTime();
 }
 public List<UserMealWithExceed> getBetween(
     LocalDate startDate, LocalTime startTime, LocalDate endDate, LocalTime endTime) {
   int userId = LoggedUser.id();
   LOG.info(
       "getBetween dates {} - {} for time {} - {} for User {}",
       startDate,
       endDate,
       startTime,
       endTime,
       userId);
   return UserMealsUtil.getFilteredWithExceeded(
       service.getBetweenDates(startDate, endDate, userId),
       startTime,
       endTime,
       LoggedUser.getCaloriesPerDay());
 }