package logic import ( "context" "fmt" "slow_wild_api/apps/internal/svc" "slow_wild_api/apps/internal/types" "github.com/zeromicro/go-zero/core/logx" ) type GetUserProfileLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserProfileLogic { return &GetUserProfileLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *GetUserProfileLogic) GetUserProfile(req *types.GetUserProfileReq) (resp *types.GetUserProfileRes, err error) { value := l.ctx.Value("user_id") fmt.Println("存储的字段是:", value) return }