package com.crm.rely.backend.core.dto.base;

import com.crm.rely.backend.core.constant.Constants;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * Created by max on 2020/3/31.
 */
@Data
@NoArgsConstructor
public class BaseReportResultDto<T, S> extends BaseResultDto<T> {

    private PageDto page;

    private S sum;

    public BaseReportResultDto(PageDto page) {
        this.page = page;
    }

    public BaseReportResultDto(int code, String msg) {
        super(code, msg);
    }

    public BaseReportResultDto(int code, String msg, T data, PageDto page) {
        super(code, msg, data);
        this.page = page;
    }

    public BaseReportResultDto(int code, String msg, PageDto page) {
        super(code, msg);
        this.page = page;
    }

    public BaseReportResultDto(int code, String msg, T data, S sum, PageDto page) {
        super(code, msg, data);
        this.page = page;
        this.sum = sum;
    }

    public BaseReportResultDto(T data, S sum, PageDto page) {
        this(Constants.SUCCESS_CODE, "", data, sum, page);
    }

}
