From 310c6f06839de59a4d084a694fa0235e67ddb6b9 Mon Sep 17 00:00:00 2001 From: jay <75509151@qq.com> Date: Sat, 11 May 2024 18:44:01 +0800 Subject: [PATCH] update Response --- .../src/main/java/cc/iotkit/common/api/Response.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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()); + } }