feat: 添加商品绑定功能
- 在图文发布和视频发布流程中集成商品绑定功能 - 新增 Products 字段到发布请求结构体 - 实现 go-rod 原生商品绑定函数(bindProducts) - 商品绑定失败将阻断发布流程并返回具体错误信息 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -35,6 +35,7 @@ type PublishRequest struct {
|
||||
ScheduleAt string `json:"schedule_at,omitempty"` // 定时发布时间,ISO8601格式,为空则立即发布
|
||||
IsOriginal bool `json:"is_original,omitempty"` // 是否声明原创
|
||||
Visibility string `json:"visibility,omitempty"` // 可见范围: "公开可见"(默认), "仅自己可见", "仅互关好友可见"
|
||||
Products []string `json:"products,omitempty"` // 商品关键词列表,用于绑定带货商品
|
||||
}
|
||||
|
||||
// LoginStatusResponse 登录状态响应
|
||||
@@ -67,6 +68,7 @@ type PublishVideoRequest struct {
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
ScheduleAt string `json:"schedule_at,omitempty"` // 定时发布时间,ISO8601格式,为空则立即发布
|
||||
Visibility string `json:"visibility,omitempty"` // 可见范围: "公开可见"(默认), "仅自己可见", "仅互关好友可见"
|
||||
Products []string `json:"products,omitempty"` // 商品关键词列表,用于绑定带货商品
|
||||
}
|
||||
|
||||
// PublishVideoResponse 发布视频响应
|
||||
@@ -217,6 +219,7 @@ func (s *XiaohongshuService) PublishContent(ctx context.Context, req *PublishReq
|
||||
ScheduleTime: scheduleTime,
|
||||
IsOriginal: req.IsOriginal,
|
||||
Visibility: req.Visibility,
|
||||
Products: req.Products,
|
||||
}
|
||||
|
||||
// 执行发布
|
||||
@@ -307,6 +310,7 @@ func (s *XiaohongshuService) PublishVideo(ctx context.Context, req *PublishVideo
|
||||
VideoPath: req.Video,
|
||||
ScheduleTime: scheduleTime,
|
||||
Visibility: req.Visibility,
|
||||
Products: req.Products,
|
||||
}
|
||||
|
||||
// 执行发布
|
||||
|
||||
Reference in New Issue
Block a user