敏捷工具
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.

34 lines
1012 B

2 years ago
  1. package com.whn.hellospring.controller;
  2. import com.whn.hellospring.common.StateMessage;
  3. import com.whn.hellospring.common.Status;
  4. import com.whn.hellospring.model.MenuDO;
  5. import com.whn.hellospring.service.MenuService;
  6. import org.springframework.beans.factory.annotation.Autowired;
  7. import org.springframework.web.bind.annotation.GetMapping;
  8. import org.springframework.web.bind.annotation.RequestMapping;
  9. import org.springframework.web.bind.annotation.RestController;
  10. import java.util.List;
  11. @RestController
  12. @RequestMapping(value = "/menu")
  13. public class MenuController {
  14. @Autowired
  15. MenuService service;
  16. /**
  17. * 获取菜单
  18. */
  19. @GetMapping(value = "/get")
  20. public Status getMenuTypeList(){
  21. try{
  22. List<MenuDO> menuTypeList = service.getMenuTypeList();
  23. Status status = new Status(StateMessage.SUCCESS, menuTypeList);
  24. return status;
  25. } catch (Exception e) {
  26. return new Status(StateMessage.UN_KNOW_REASON);
  27. }
  28. }
  29. }