com.base4j.mvc.sys.controller.SysLogController Maven / Gradle / Ivy
package com.base4j.mvc.sys.controller;
import com.base4j.mvc.base.controller.BaseController;
import com.base4j.mvc.base.param.Param;
import com.base4j.mvc.sys.entity.SysLog;
import com.base4j.mvc.sys.service.SysLogService;
import com.base4j.mvc.util.Res;
import com.base4j.mybatis.base.QueryParams;
import com.github.pagehelper.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@RestController
@RequestMapping("/sys/log")
public class SysLogController extends BaseController {
@Autowired
private SysLogService sysLogService;
@RequestMapping("/selectExtendPageByParam/{pageNum}/{pageSize}")
public Res selectExtendPageByParam(@PathVariable int pageNum, @PathVariable int pageSize, @RequestParam Map params) {
Page page = sysLogService.selectExtendPageByParam(pageNum, pageSize, params);
Map pageInfo = new HashMap();
pageInfo.put("total", page.getTotal());
pageInfo.put("pages", page.getPages());
pageInfo.put("page", page);
return Res.ok(pageInfo);
}
}