You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
480 B
22 lines
480 B
package com.example.ainative.common; |
|
|
|
import lombok.AllArgsConstructor; |
|
import lombok.Data; |
|
import lombok.NoArgsConstructor; |
|
|
|
@Data |
|
@AllArgsConstructor |
|
@NoArgsConstructor |
|
public class Result<T> { |
|
private Integer code; |
|
private String msg; |
|
private T data; |
|
|
|
public static <T> Result<T> success(T data) { |
|
return new Result<>(200, "success", data); |
|
} |
|
|
|
public static <T> Result<T> error(String msg) { |
|
return new Result<>(500, msg, null); |
|
} |
|
}
|
|
|