分頁返回類PageResult

1、實現序列化接口
2、返回數據的rows屬性,爲了確保傳遞不同類型的數據,要設置爲泛型(其他實體類也都要實現序列化接口)
3、無參和有參構造方法

public class PageResult implements Serializable {
    private Long total;

    private List<?> rows;

    public PageResult() {
    }

    public PageResult(Long total, List<?> rows) {
        this.total = total;
        this.rows = rows;
    }

    public Long getTotal() {
        return total;
    }

    public void setTotal(Long total) {
        this.total = total;
    }

    public List<?> getRows() {
        return rows;
    }

    public void setRows(List<?> rows) {
        this.rows = rows;
    }
}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章