package thyyxxk.webserver.utils; import thyyxxk.webserver.config.exception.ExceptionEnum; import thyyxxk.webserver.entity.ResultVo; /** * @author dj */ public class ResultVoUtil { public static ResultVo success() { return new ResultVo<>(); } public static ResultVo success(T data) { return new ResultVo<>(data); } public static ResultVo success(ExceptionEnum exceptionEnum, String message) { return new ResultVo<>(exceptionEnum, message); } public static ResultVo success(ExceptionEnum exceptionEnum) { return new ResultVo<>(exceptionEnum); } public static ResultVo fail(ExceptionEnum exceptionEnum) { return new ResultVo<>(exceptionEnum); } public static ResultVo fail(ExceptionEnum exceptionEnum, String message) { return new ResultVo<>(exceptionEnum, message); } public static ResultVo fail(ExceptionEnum exceptionEnum, T data) { return new ResultVo<>(exceptionEnum, data); } public static ResultVo fail(ExceptionEnum exceptionEnum, String message, T data) { return new ResultVo<>(exceptionEnum, message, data); } }