This commit is contained in:
白茶清欢 2022-01-13 23:04:02 +08:00
parent 393bc77655
commit 1ded95c813

View File

@ -27,7 +27,7 @@ func Response(ctx *gin.Context, code interface{}, message string, data interface
"message": message, "message": message,
"data": data, "data": data,
"trace_id": ctx.GetString("trace_id"), "trace_id": ctx.GetString("trace_id"),
"cost": time.Since(time.Unix(ctx.GetInt64("start_time"), 0)).Milliseconds(), "cost": time.Now().UnixMilli() - ctx.GetInt64("start_time"),
} }
ctx.JSON(http.StatusOK, responseData) ctx.JSON(http.StatusOK, responseData)
} }