From 002f5f15fbac002fe02884747aebe3e06437b0b3 Mon Sep 17 00:00:00 2001 From: zhaoyupeng Date: Fri, 4 Jul 2025 10:17:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=BC=E5=AE=B9=E4=BB=A5=E5=89=8D?= =?UTF-8?q?=E7=9A=84=20code=20=E8=AE=BE=E8=AE=A1,=20=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E6=9B=BF=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resp/resp.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resp/resp.go b/resp/resp.go index 790ba3e..c8e2890 100644 --- a/resp/resp.go +++ b/resp/resp.go @@ -10,6 +10,8 @@ type res struct { Msg string `json:"msg"` Data any `json:"data"` Err any `json:"err"` + // Deprecated: 200:1, other: -1 + Code int `json:"code"` } func R200(c *gin.Context, data any, msgs ...string) { @@ -17,6 +19,7 @@ func R200(c *gin.Context, data any, msgs ...string) { Status: 200, Msg: Msg200, Data: data, + Code: 1, } if len(msgs) > 0 && msgs[0] != "" {