refactor: Private bool → Visibility string 支持多种可见范围 (#464)
* docs: 更新 API 文档以包含 private 参数的用途和可选性。 * refactor: visibility 功能从 Private bool 重构为 Visibility string 将发布时可见范围参数从 `Private bool` 改为 `Visibility string`, 支持三种选项:公开可见(默认)、仅自己可见、仅互关好友可见。 - 使用精确 CSS selector 替代遍历 span/label/div 的宽泛选择器 - 新增参数校验,不支持的选项直接返回错误 - 更新 API 文档和 MCP jsonschema 描述 - 与 upstream IsOriginal(原创声明) 功能共存 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: yryangang <dd101bb@qq.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -34,6 +34,7 @@ type PublishRequest struct {
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
ScheduleAt string `json:"schedule_at,omitempty"` // 定时发布时间,ISO8601格式,为空则立即发布
|
||||
IsOriginal bool `json:"is_original,omitempty"` // 是否声明原创
|
||||
Visibility string `json:"visibility,omitempty"` // 可见范围: "公开可见"(默认), "仅自己可见", "仅互关好友可见"
|
||||
}
|
||||
|
||||
// LoginStatusResponse 登录状态响应
|
||||
@@ -65,6 +66,7 @@ type PublishVideoRequest struct {
|
||||
Video string `json:"video" binding:"required"`
|
||||
Tags []string `json:"tags,omitempty"`
|
||||
ScheduleAt string `json:"schedule_at,omitempty"` // 定时发布时间,ISO8601格式,为空则立即发布
|
||||
Visibility string `json:"visibility,omitempty"` // 可见范围: "公开可见"(默认), "仅自己可见", "仅互关好友可见"
|
||||
}
|
||||
|
||||
// PublishVideoResponse 发布视频响应
|
||||
@@ -214,6 +216,7 @@ func (s *XiaohongshuService) PublishContent(ctx context.Context, req *PublishReq
|
||||
ImagePaths: imagePaths,
|
||||
ScheduleTime: scheduleTime,
|
||||
IsOriginal: req.IsOriginal,
|
||||
Visibility: req.Visibility,
|
||||
}
|
||||
|
||||
// 执行发布
|
||||
@@ -303,6 +306,7 @@ func (s *XiaohongshuService) PublishVideo(ctx context.Context, req *PublishVideo
|
||||
Tags: req.Tags,
|
||||
VideoPath: req.Video,
|
||||
ScheduleTime: scheduleTime,
|
||||
Visibility: req.Visibility,
|
||||
}
|
||||
|
||||
// 执行发布
|
||||
|
||||
Reference in New Issue
Block a user