Examples of DishModel


Examples of com.softserve.academy.food.model.DishModel

    @Transactional
    public DishModel getDish(int id) {
        if (dishDao.get(id) != null) {
            return dishDao.get(id).toModel();
        }
        return new DishModel();
    }
View Full Code Here

Examples of com.softserve.academy.food.model.DishModel

        weight = dish.getWeight();

    }

    public DishModel toModel() {
        return new DishModel(this);
    }
View Full Code Here

Examples of com.softserve.academy.food.model.DishModel

    //dish by id
    @RequestMapping(value = "/android/dish/{id}")
    public
    @ResponseBody
    DishModel getDishById(@PathVariable int id) {
        DishModel dish = menuService.getDish(id);
        return dish;
    }
View Full Code Here

Examples of com.softserve.academy.food.model.DishModel

    }

    @RequestMapping(value = "/dishes/{id}", method = RequestMethod.GET)
    protected String getDish(@PathVariable int id, Model model) {
        ArrayList<String> names = new ArrayList<String>();
        DishModel mod = dishService.getDish(id);
        names.add(mod.toString());
        model.addAttribute("helloMessage", names);
        return "helloPage";
    }
View Full Code Here

Examples of com.softserve.academy.food.model.DishModel

  }
 
  @Test
  public void getEmpty()
  {
    assertTrue( mService.getDish(1).equals(new DishModel()) );
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.