001/*
002 *    Copyright 2024-2025, Warm-Flow (290631660@qq.com).
003 *
004 *    Licensed under the Apache License, Version 2.0 (the "License");
005 *    you may not use this file except in compliance with the License.
006 *    You may obtain a copy of the License at
007 *
008 *       https://www.apache.org/licenses/LICENSE-2.0
009 *
010 *    Unless required by applicable law or agreed to in writing, software
011 *    distributed under the License is distributed on an "AS IS" BASIS,
012 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *    See the License for the specific language governing permissions and
014 *    limitations under the License.
015 */
016package org.dromara.warm.flow.core.dto;
017
018import java.io.Serializable;
019import java.util.List;
020
021/**
022 * 表格分页数据对象
023 *
024 * @author ruoyi
025 */
026public class FlowPage<T> implements Serializable
027{
028    private static final long serialVersionUID = 1L;
029
030    /** 总记录数 */
031    private long total;
032
033    /** 列表数据 */
034    private List<T> rows;
035
036    /** 消息状态码 */
037    private int code;
038
039    /** 消息内容 */
040    private String msg;
041
042    /**
043     * 表格数据对象
044     */
045    public FlowPage()
046    {
047    }
048
049    /**
050     * 分页
051     *
052     * @param list 列表数据
053     * @param total 总记录数
054     */
055    public FlowPage(List<T> list, int total)
056    {
057        this.rows = list;
058        this.total = total;
059    }
060
061    public long getTotal() {
062        return total;
063    }
064
065    public FlowPage<T> setTotal(long total) {
066        this.total = total;
067        return this;
068    }
069
070    public List<T> getRows() {
071        return rows;
072    }
073
074    public FlowPage<T> setRows(List<T> rows) {
075        this.rows = rows;
076        return this;
077    }
078
079    public int getCode() {
080        return code;
081    }
082
083    public FlowPage<T> setCode(int code) {
084        this.code = code;
085        return this;
086    }
087
088    public String getMsg() {
089        return msg;
090    }
091
092    public FlowPage<T> setMsg(String msg) {
093        this.msg = msg;
094        return this;
095    }
096}