| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package logic
- import (
- "context"
- "slow_wild_api/apps/internal/svc"
- "slow_wild_api/apps/internal/types"
- "git.banshen.xyz/huangguangrong/slow_wild_protobuff/slowwild/slowwildserver"
- "github.com/zeromicro/go-zero/core/logx"
- )
- type GetUserPostCollectionListLogic struct {
- logx.Logger
- ctx context.Context
- svcCtx *svc.ServiceContext
- }
- // 获取用户收藏的帖子列表
- func NewGetUserPostCollectionListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserPostCollectionListLogic {
- return &GetUserPostCollectionListLogic{
- Logger: logx.WithContext(ctx),
- ctx: ctx,
- svcCtx: svcCtx,
- }
- }
- func (l *GetUserPostCollectionListLogic) GetUserPostCollectionList(req *types.GetUserPostCollectionListReq) (resp *types.BaseReturnData, err error) {
- resp = &types.BaseReturnData{}
- rpcResp, err := l.svcCtx.SlowWildPb.GetUserPostCollectionList(l.ctx, &slowwildserver.GetUserPostCollectionListReq{
- QueryUserId: req.QueryUserId,
- Page: req.Page,
- PageSize: req.PageSize,
- })
- if err != nil {
- return nil, err
- }
- resp.Data = map[string]interface{}{
- "list": rpcResp.GetList(),
- "total": rpcResp.GetTotal(),
- }
- return
- }
|