Files
loggerx/middleware.go
T

15 lines
254 B
Go
Raw Normal View History

2024-04-19 09:16:07 +08:00
package loggerx
import (
"context"
uuid "github.com/satori/go.uuid"
)
// 可以被引入的中间件
// 自动设置请求ID
func SetTradeId(ctx context.Context) context.Context {
return context.WithValue(ctx, "trade_id", uuid.NewV4().String())
}