com.easy.core.domain.ApiResult Maven / Gradle / Ivy
The newest version!
package com.easy.core.domain;
import com.easy.core.enumx.FailureEnum;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
* 返回结果封装
*/
@Data
public class ApiResult {
private int code;
private T data;
private boolean success;
private String message;
public static ApiResult ok() {
ApiVoidResult result = new ApiVoidResult();
result.setSuccess(true);
return result;
}
public static ApiResult ok(T t) {
ApiObjectResult result = new ApiObjectResult();
result.setSuccess(true);
result.setData(t);
return (ApiResult) result;
}
public ApiResult data(T data) {
this.data = data;
return this;
}
public static ApiResult
© 2015 - 2025 Weber Informatics LLC | Privacy Policy