feat: 迁移plant

This commit is contained in:
Blizzard
2026-05-23 13:55:05 +08:00
parent a93477ea8e
commit ae6d03d351
228 changed files with 25296 additions and 917 deletions
@@ -5,9 +5,11 @@ package post
import (
"context"
"fmt"
"sundynix-micro-go/app/plant/api/internal/svc"
"sundynix-micro-go/app/plant/api/internal/types"
"sundynix-micro-go/app/plant/rpc/plant"
"github.com/zeromicro/go-zero/core/logx"
)
@@ -18,7 +20,7 @@ type LikePostLogic struct {
svcCtx *svc.ServiceContext
}
// 点赞帖子
// 点赞/取消点赞帖子
func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePostLogic {
return &LikePostLogic{
Logger: logx.WithContext(ctx),
@@ -28,7 +30,10 @@ func NewLikePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LikePost
}
func (l *LikePostLogic) LikePost(req *types.IdReq) error {
// todo: add your logic here and delete this line
return nil
userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
_, err := l.svcCtx.PlantRpc.LikePost(l.ctx, &plant.LikePostReq{
PostId: req.Id,
UserId: userId,
})
return err
}