响应数据耗时使用float64
This commit is contained in:
parent
53b9196970
commit
2a49316904
@ -38,7 +38,7 @@ func Send(ctx *gin.Context, code interface{}, httpCode int, data interface{}) {
|
|||||||
define.ResponseTraceIDField: ctx.GetString(define.TraceIDField),
|
define.ResponseTraceIDField: ctx.GetString(define.TraceIDField),
|
||||||
define.ResponseRequestIDField: ctx.GetString(define.RequestIDField),
|
define.ResponseRequestIDField: ctx.GetString(define.RequestIDField),
|
||||||
define.ResponseDataField: data,
|
define.ResponseDataField: data,
|
||||||
define.HandleRequestCostField: (time.Now().UnixNano() - ctx.GetInt64(define.StartRequestTimeField)) / 1e9,
|
define.HandleRequestCostField: float64(time.Now().UnixNano()-ctx.GetInt64(define.StartRequestTimeField)) / 1e9,
|
||||||
}
|
}
|
||||||
responseException := exception.New(code, httpCode, responseData)
|
responseException := exception.New(code, httpCode, responseData)
|
||||||
ctx.JSON(responseException.GetHttpCode(), responseException.GetData())
|
ctx.JSON(responseException.GetHttpCode(), responseException.GetData())
|
||||||
|
Loading…
Reference in New Issue
Block a user