package com.uas.eis.sdk.resp;

import com.uas.eis.sdk.entity.StepWorkApiResult;


/**
 * @author
 * @email
 * @date 2021-12-22 20:00
 */
public class StepWorkApiResponse {

    public static <T> StepWorkApiResult<T> successRsp(int code, String msg) {
        return new StepWorkApiResult<T>().setSuccess(true).setCode(code).setMsg(msg);
    }

    public static <T> StepWorkApiResult<T> successRsp(int code,T data) {
        return new StepWorkApiResult<T>().setSuccess(true).setData(data).setCode(code);
    }

    public static <T> StepWorkApiResult<T> successRsp(int code, String msg,T data) {
        return new StepWorkApiResult<T>().setSuccess(true).setCode(code).setMsg(msg).setData(data);
    }

    public static <T> StepWorkApiResult<T> successRsp(T data) {
        return successRsp(200,data);
    }


    public static <T> StepWorkApiResult<T> failRsp(int code, String msg) {
        return new StepWorkApiResult<T>().setSuccess(false).setCode(code).setMsg(msg);
    }


    public static <T> StepWorkApiResult<T> failRsp(int code, String msg, T data) {
        return new StepWorkApiResult<T>().setSuccess(false).setCode(code).setMsg(msg).setData(data);
    }
    public static <T> StepWorkApiResult<T> failRsp(T data) {
        return new StepWorkApiResult<T>().setSuccess(false).setData(data);
    }

}
