fix: 兼容以前的 code 设计, 计划替换
This commit is contained in:
@ -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] != "" {
|
||||
|
Reference in New Issue
Block a user