getuserprofilelogic.go 674 B

1234567891011121314151617181920212223242526272829303132
  1. package logic
  2. import (
  3. "context"
  4. "fmt"
  5. "slow_wild_api/apps/internal/svc"
  6. "slow_wild_api/apps/internal/types"
  7. "github.com/zeromicro/go-zero/core/logx"
  8. )
  9. type GetUserProfileLogic struct {
  10. logx.Logger
  11. ctx context.Context
  12. svcCtx *svc.ServiceContext
  13. }
  14. func NewGetUserProfileLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserProfileLogic {
  15. return &GetUserProfileLogic{
  16. Logger: logx.WithContext(ctx),
  17. ctx: ctx,
  18. svcCtx: svcCtx,
  19. }
  20. }
  21. func (l *GetUserProfileLogic) GetUserProfile(req *types.GetUserProfileReq) (resp *types.GetUserProfileRes, err error) {
  22. value := l.ctx.Value("user_id")
  23. fmt.Println("存储的字段是:", value)
  24. return
  25. }