接口入口函数首个参数支持custom context
This commit is contained in:
@ -20,7 +20,7 @@ import (
|
||||
)
|
||||
|
||||
type Context struct {
|
||||
Gin *gin.Context // 继承 gin context
|
||||
Context *gin.Context // 继承 gin context
|
||||
Trace *trace.Runtime // trace 实例
|
||||
TraceID string
|
||||
RequestID string
|
||||
@ -53,7 +53,7 @@ func NewContext(ginCtx *gin.Context) *Context {
|
||||
return traceID
|
||||
}
|
||||
ctx := &Context{
|
||||
Gin: ginCtx,
|
||||
Context: ginCtx,
|
||||
Trace: trace.NewRuntime(traceID, 1),
|
||||
TraceID: traceID,
|
||||
RequestID: getRequestID(ginCtx, traceID),
|
||||
|
Reference in New Issue
Block a user