src/main/java/com/sulei/controller/admin/WashServiceController.java
(开头部分) 2KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
package com.sulei.controller.admin;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sulei.entity.WasService;
import com.sulei.service.WashService;
import com.sulei.util.DateUtil;
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 java.util.HashMap;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/admin/washservice")
public class WashServiceController {
@Autowired
private WashService washService;
/**
* 列表画面 GET
*
* @return
*/
@RequestMapping("list")
public String list() {
return "view/admin/washservice/list";
}
/**
* 分页查询
*
* @param page
* @param limit
* @param wasService
* @return
*/
@RequestMapping("getPageList")
@ResponseBody
public Object getPageList(Integer page, Integer limit, WasService wasService) {
PageHelper.startPage(page, limit);
List<WasService> wasServices = washService.getPageList(wasService);
PageInfo pageInfo = new PageInfo(wasServices);
Map<String, Object> tableData = new HashMap<String, Object>();
//这是layui要求返回的json数据格式
tableData.put("code", 0);
tableData.put("msg", "");
//将全部数据的条数作为count传给前台(一共多少条)
tableData.put("count", pageInfo.getTotal());
//将分页后的数据返回(每页要显示的数据)
tableData.put("data", pageInfo.getList());
return tableData;
}
/**
后面还有 51 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。
