| 12345678910111213141516171819202122232425262728293031323334353637383940 | package commonimport (	"context"	"time"	context2 "git.ikuban.com/server/kratos-utils/http/context")func NewContext(parentCtx context.Context) context.Context {	ctx := &AccountContext{ctx: parentCtx}	return ctx}func NewContextWithAccountID(parentCtx context.Context, accountID int64) context.Context {	ctx := &AccountContext{ctx: parentCtx}	newCtx := context2.AppendToContext(ctx, "user_id", accountID)	newCtx = context2.AppendToContext(newCtx, "account_id", accountID)	return newCtx}type AccountContext struct {	ctx context.Context}func (this *AccountContext) Deadline() (deadline time.Time, ok bool) {	return}func (*AccountContext) Done() <-chan struct{} {	return nil}func (this *AccountContext) Err() error {	return nil}func (this *AccountContext) Value(key interface{}) interface{} {	return this.ctx.Value(key)}
 |