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] != "" {