package thyyxxk.webserver.utils;

import thyyxxk.webserver.config.exception.ExceptionEnum;
import thyyxxk.webserver.entity.ResultVo;

/**
 * @author dj
 */
public class ResultVoUtil {

    public static <T> ResultVo<T> success() {
        return new ResultVo<>();
    }

    public static <T> ResultVo<T> success(T data) {
        return new ResultVo<>(data);
    }

    public static <T> ResultVo<T> success(ExceptionEnum exceptionEnum, String message) {
        return new ResultVo<>(exceptionEnum, message);
    }

    public static <T> ResultVo<T> success(ExceptionEnum exceptionEnum, T data) {
        return new ResultVo<>(exceptionEnum, data);
    }

    public static <T> ResultVo<T> success(ExceptionEnum exceptionEnum, String message, T data) {
        return new ResultVo<>(exceptionEnum, message, data);
    }

    public static <T> ResultVo<T> success(ExceptionEnum exceptionEnum) {
        return new ResultVo<>(exceptionEnum);
    }

    public static <T> ResultVo<T> fail(ExceptionEnum exceptionEnum) {
        return new ResultVo<>(exceptionEnum);
    }

    public static <T> ResultVo<T> fail(ExceptionEnum exceptionEnum, String message) {
        return new ResultVo<>(exceptionEnum, message);
    }

    public static <T> ResultVo<T> fail(ExceptionEnum exceptionEnum, T data) {
        return new ResultVo<>(exceptionEnum, data);
    }

    public static <T> ResultVo<T> fail(ExceptionEnum exceptionEnum, String message, T data) {
        return new ResultVo<>(exceptionEnum, message, data);
    }
}
