package com.cm.common.result;

import io.swagger.annotations.ApiModel;

import java.io.Serializable;

/**
 * @ClassName: SuccessResultData
 * @Description: 返回结果带对象
 * @Author: WangGeng
 * @Date: 2019/3/11 9:31 AM
 * @Version: 1.0
 **/
@ApiModel
public class SuccessResultData<T> extends SuccessResult {

    private static final long serialVersionUID = 2292105832378967169L;
    private T data;

    public SuccessResultData(T data) {
        this.data = data;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"data\":")
                .append(data);
        sb.append('}');
        return sb.toString();
    }

}
