feat: 植物识别百科ai助手迁移
This commit is contained in:
@@ -31,12 +31,16 @@ func NewCreatePostLogic(ctx context.Context, svcCtx *svc.ServiceContext) *Create
|
||||
|
||||
func (l *CreatePostLogic) CreatePost(req *types.CreatePostReq) error {
|
||||
userId := fmt.Sprintf("%v", l.ctx.Value("userId"))
|
||||
imgIds := req.ImgIds
|
||||
if len(imgIds) == 0 && len(req.OssIds) > 0 {
|
||||
imgIds = req.OssIds
|
||||
}
|
||||
_, err := l.svcCtx.PlantRpc.CreatePost(l.ctx, &plant.CreatePostReq{
|
||||
UserId: userId,
|
||||
Title: req.Title,
|
||||
Content: req.Content,
|
||||
Location: req.Location,
|
||||
ImgIds: req.ImgIds,
|
||||
ImgIds: imgIds,
|
||||
TopicId: req.TopicId,
|
||||
})
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user