敏捷工具
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.3 KiB

2 years ago
  1. package com.whn.hellospring.service;
  2. import com.whn.hellospring.model.MenuDO;
  3. import com.whn.hellospring.repository.MenuCoffeeRepository;
  4. import com.whn.hellospring.repository.MenuRepository;
  5. import lombok.extern.slf4j.Slf4j;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.stereotype.Service;
  8. import java.util.List;
  9. @Service
  10. @Slf4j
  11. public class MenuService {
  12. @Autowired
  13. private MenuRepository menuRepository;
  14. @Autowired
  15. private MenuCoffeeRepository menuCoffeeRepository;
  16. /**
  17. * 获取菜单类型列表
  18. */
  19. public List<MenuDO> getMenuTypeList() {
  20. return menuRepository.getMenuList();
  21. // List<MenuDTO> returnList = new ArrayList<>();
  22. // for (MenuDO menudo : menuRepository.getMenuList()) {
  23. // Optional<MenuCoffeeDO> coffeeList = menuCoffeeRepository.findById(menudo.getId());
  24. //
  25. // MenuDTO menuDTO = new MenuDTO();
  26. // if (coffeeList.isPresent()) menuDTO.setCoffee_list(MyOptional.toList(coffeeList));
  27. // menuDTO.setId(menudo.getId());
  28. // menuDTO.setCreateTime(menudo.getCreateTime());
  29. // menuDTO.setUpdateTime(menudo.getUpdateTime());
  30. // menuDTO.setType(menudo.getType());
  31. //
  32. // returnList.add(menuDTO);
  33. // }
  34. // return returnList;
  35. }
  36. }