ResourceController.java 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.fdage.controller;
  2. import com.fdage.dto.ResourceTree;
  3. import com.fdage.service.IResourceService;
  4. import com.fdage.util.AjaxJson;
  5. import io.swagger.annotations.Api;
  6. import io.swagger.annotations.ApiOperation;
  7. import lombok.extern.slf4j.Slf4j;
  8. import org.springframework.beans.factory.annotation.Autowired;
  9. import org.springframework.stereotype.Controller;
  10. import org.springframework.web.bind.annotation.PostMapping;
  11. import org.springframework.web.bind.annotation.RequestMapping;
  12. import org.springframework.web.bind.annotation.ResponseBody;
  13. import java.util.List;
  14. /**
  15. * Created by Hb_zzZ on 2020/7/28.
  16. */
  17. @Controller
  18. @RequestMapping("/zhoushan/resource")
  19. @Slf4j
  20. @Api(tags = "权限资源模块")
  21. public class ResourceController {
  22. @Autowired
  23. private IResourceService resourceService;
  24. @PostMapping("find")
  25. @ResponseBody
  26. @ApiOperation("获取所以资源(树形结构)")
  27. public AjaxJson find() throws Exception {
  28. // List<ResourceEntity> result = resourceService.findList(Sort.by("sort").ascending());
  29. List<ResourceTree> listTree = resourceService.getTree();
  30. return AjaxJson.success(listTree);
  31. }
  32. }