package com.sckw.core.web.response.result;

import com.fasterxml.jackson.annotation.JsonInclude;

/**
 * @description: 数据封装
 * @author: lfdc
 * @copyright
 * @create: 2022-01-27 09:49
 **/
public class Data {
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Object body;
    @JsonInclude(JsonInclude.Include.NON_NULL)
    private Page page;

    public static Data getData() {
        return new Data();
    }

    public static Data getData(Object data) {
        Data da = new Data();
        da.setBody(data);
        return da;
    }

    public static Data getData(Object data, Page page) {
        Data da = new Data();
        da.setBody(data);
        da.setPage(page);
        return da;
    }

    public Object getBody() {
        return this.body;
    }

    public Page getPage() {
        return this.page;
    }

    public void setBody(Object body) {
        this.body = body;
    }

    public void setPage(Page page) {
        this.page = page;
    }

    @Override
    public String toString() {
        return "Data(body=" + this.getBody() + ", page=" + this.getPage() + ")";
    }

    public Data() {
    }

    public Data(Object body, Page page) {
        this.body = body;
        this.page = page;
    }
}
