update Response

master
jay 2024-05-11 18:44:01 +08:00
parent 1f25abd8f7
commit 310c6f0683
1 changed files with 6 additions and 1 deletions

View File

@ -23,6 +23,7 @@
package cc.iotkit.common.api;
import cn.hutool.core.util.IdUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@ -30,9 +31,13 @@ import lombok.NoArgsConstructor;
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Response {
public class Response<T> {
private Integer code;
private String message;
private Object data;
private String requestId;
public static <T> Response success(T data) {
return new Response(200,"成功", data, IdUtil.simpleUUID());
}
}