diff --git a/iot-common-core/src/main/java/cc/iotkit/common/api/Response.java b/iot-common-core/src/main/java/cc/iotkit/common/api/Response.java index fc46c8b..a4cb93e 100755 --- a/iot-common-core/src/main/java/cc/iotkit/common/api/Response.java +++ b/iot-common-core/src/main/java/cc/iotkit/common/api/Response.java @@ -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 { private Integer code; private String message; private Object data; private String requestId; + + public static Response success(T data) { + return new Response(200,"成功", data, IdUtil.simpleUUID()); + } }