package link.at17.mid.tushare.dto;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Data;
import lombok.experimental.Accessors;

/**
 * 后台查询结果，适配 layui
 * @author Doghole
 **/
@Data
@Accessors(chain = true)
public class LayPageResp<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 3706125181722544872L;

    //状态码
    private int code;

    //提示消息
    private String msg;

    //总条数
    private long count;

    //表格数据
    private List<T> data;
    
    public LayPageResp() {}
    
    public LayPageResp(IPage<T> page) {
        this.data = page.getRecords();
        this.count = page.getTotal();
    }
}
