Commit 5e295728 by zzrdark

1.增加分页查询

parent b8493227
......@@ -17,5 +17,5 @@ import org.springframework.web.bind.annotation.RequestParam;
public interface UserClient {
@PostMapping("/sys/func/list")
PageDto funcList();
PageDto funcList(@RequestParam Integer page, @RequestParam("limit") Integer pageSize);
}
......@@ -7,6 +7,7 @@ import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
......@@ -24,8 +25,15 @@ public class SystemController {
private UserClient userClient;
@PostMapping("/module/list")
public R funcList(){
PageDto pageDto = userClient.funcList();
public R funcList(@RequestParam Integer page, @RequestParam Integer pageSize){
if (page==null && page==0){
page = 1;
}
if (pageSize==null && pageSize==0){
pageSize = 10;
}
PageDto pageDto = userClient.funcList(page,pageSize);
return new R().put("data",pageDto);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment