ResourceController.java 1022 Bytes
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
package com.lyms.cm.controller.sys;

import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.lyms.cm.entity.sys.Resource;
import com.lyms.cm.service.sys.ResourceService;
import com.lyms.web.controller.BaseController;

@Controller
@RequestMapping("/resource")
public class ResourceController extends BaseController {

@Autowired
private ResourceService resourceService;
@RequestMapping("/list")
public String list() {
return "/resource/resource_list";
}

@RequestMapping("/getResourceList")
@ResponseBody
public Map<String, Object> getResourceList(){
Page<Resource> page = getPage();
return toGridData(resourceService.selectPage(page, new EntityWrapper<Resource>().orderBy("sorted")));
}
}