@@ -129,6 +129,7 @@ func (s *AppServer) handlePublishContent(ctx context.Context, args map[string]in
129129 content , _ := args ["content" ].(string )
130130 imagePathsInterface , _ := args ["images" ].([]interface {})
131131 tagsInterface , _ := args ["tags" ].([]interface {})
132+ productsInterface , _ := args ["products" ].([]interface {})
132133
133134 var imagePaths []string
134135 for _ , path := range imagePathsInterface {
@@ -144,14 +145,21 @@ func (s *AppServer) handlePublishContent(ctx context.Context, args map[string]in
144145 }
145146 }
146147
148+ var products []string
149+ for _ , p := range productsInterface {
150+ if pStr , ok := p .(string ); ok {
151+ products = append (products , pStr )
152+ }
153+ }
154+
147155 // 解析定时发布参数
148156 scheduleAt , _ := args ["schedule_at" ].(string )
149157 visibility := parseVisibility (args )
150158
151159 // 解析原创参数
152160 isOriginal , _ := args ["is_original" ].(bool )
153161
154- logrus .Infof ("MCP: 发布内容 - 标题: %s, 图片数量: %d, 标签数量: %d, 定时: %s, 原创: %v, visibility: %s" , title , len (imagePaths ), len (tags ), scheduleAt , isOriginal , visibility )
162+ logrus .Infof ("MCP: 发布内容 - 标题: %s, 图片数量: %d, 标签数量: %d, 定时: %s, 原创: %v, visibility: %s, 商品: %v " , title , len (imagePaths ), len (tags ), scheduleAt , isOriginal , visibility , products )
155163
156164 // 构建发布请求
157165 req := & PublishRequest {
@@ -162,6 +170,7 @@ func (s *AppServer) handlePublishContent(ctx context.Context, args map[string]in
162170 ScheduleAt : scheduleAt ,
163171 IsOriginal : isOriginal ,
164172 Visibility : visibility ,
173+ Products : products ,
165174 }
166175
167176 // 执行发布
@@ -193,6 +202,7 @@ func (s *AppServer) handlePublishVideo(ctx context.Context, args map[string]inte
193202 content , _ := args ["content" ].(string )
194203 videoPath , _ := args ["video" ].(string )
195204 tagsInterface , _ := args ["tags" ].([]interface {})
205+ productsInterface , _ := args ["products" ].([]interface {})
196206
197207 var tags []string
198208 for _ , tag := range tagsInterface {
@@ -201,6 +211,13 @@ func (s *AppServer) handlePublishVideo(ctx context.Context, args map[string]inte
201211 }
202212 }
203213
214+ var products []string
215+ for _ , p := range productsInterface {
216+ if pStr , ok := p .(string ); ok {
217+ products = append (products , pStr )
218+ }
219+ }
220+
204221 if videoPath == "" {
205222 return & MCPToolResult {
206223 Content : []MCPContent {{
@@ -215,7 +232,7 @@ func (s *AppServer) handlePublishVideo(ctx context.Context, args map[string]inte
215232 scheduleAt , _ := args ["schedule_at" ].(string )
216233 visibility := parseVisibility (args )
217234
218- logrus .Infof ("MCP: 发布视频 - 标题: %s, 标签数量: %d, 定时: %s, visibility: %s" , title , len (tags ), scheduleAt , visibility )
235+ logrus .Infof ("MCP: 发布视频 - 标题: %s, 标签数量: %d, 定时: %s, visibility: %s, 商品: %v " , title , len (tags ), scheduleAt , visibility , products )
219236
220237 // 构建发布请求
221238 req := & PublishVideoRequest {
@@ -225,6 +242,7 @@ func (s *AppServer) handlePublishVideo(ctx context.Context, args map[string]inte
225242 Tags : tags ,
226243 ScheduleAt : scheduleAt ,
227244 Visibility : visibility ,
245+ Products : products ,
228246 }
229247
230248 // 执行发布
0 commit comments