| 1234567891011121314151617181920212223242526272829303132 |
- 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 GetPostLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- func NewGetPostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPostLogic {
- return &GetPostLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *GetPostLogic) GetPost(req *types.GetPostReq) (resp *types.GetPostRsp, err error) {
- value := l.ctx.Value("user_id")
- fmt.Println("存储的字段是:", value)
- return
- }
|