后台接受参数如下:
package com.gpdi.lxq.eladmin.entity.page;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @description:分页请求
* @author: Lxq
* @date: 2020/1/19 17:27
*/
public class PageRequest {
/**
* 当前页码
*/
private int pageNum = 1;
/**
* 每页数量
*/
private int pageSize = 10;
public List<Map<String, Object>> getParams() {
return params;
}
public void setParams(List<Map<String, Object>> params) {
this.params = params;
}
/**
* 查询参数
*/
private List<Map<String, Object>> params = new ArrayList<>();
public int getPageNum() {
return pageNum;
}
public void setPageNum(int pageNum) {
this.pageNum = pageNum;
}
public int getPageSize() {
return pageSize;
}
public void setPageSize(int pageSize) {
this.pageSize = pageSize;
}
public Object getParam(String key) {
return getParams().get(0).get(key);
}
}
Postman中参数格式如下图所示:
记得.Headers里面 Key: Content-Type Value: application/json
搞定收工。