diff --git a/app/net.go b/app/net.go index f4432fc..b3e86b4 100644 --- a/app/net.go +++ b/app/net.go @@ -248,13 +248,18 @@ func (w *ResponseWriter) Error(err error) { if len(message) == 0 { message = http.StatusText(status) } - w.Send(status, map[string]any{"code": code, "message": message}) + w.Send(status, map[string]any{ + "code": code, + "message": message, + "success": code == 0, + }) } func (w *ResponseWriter) Ok(data any, message ...string) { info := map[string]any{ "code": 0, "message": "ok", + "success": true, "data": data, } if len(message) > 0 {