context.go 315 B

1234567891011121314
  1. package common
  2. import (
  3. "context"
  4. context2 "git.ikuban.com/server/kratos-utils/http/context"
  5. )
  6. func NewContext(accountID int64) context.Context {
  7. ctx := context.Background()
  8. ctx = context2.AppendToContext(ctx, "user_id", accountID)
  9. ctx = context2.AppendToContext(ctx, "account_id", accountID)
  10. return ctx
  11. }