feat: 为视频发布功能新增HTTP API接口和完善文档 (#179)
* 重构 publish tab 选择逻辑,把公共代码提取到同一个函数中 * feat: 为视频发布功能新增HTTP API接口和完善文档 - 新增 /api/v1/publish_video HTTP接口 - 添加 publishVideoHandler 处理函数 - 更新 API.md 增加视频发布接口文档 - 更新 README.md 和 README_EN.md 增加视频发布功能说明 - 在MCP工具列表中补充 publish_with_video 工具说明
This commit is contained in:
@@ -81,6 +81,26 @@ func (s *AppServer) publishHandler(c *gin.Context) {
|
||||
respondSuccess(c, result, "发布成功")
|
||||
}
|
||||
|
||||
// publishVideoHandler 发布视频内容
|
||||
func (s *AppServer) publishVideoHandler(c *gin.Context) {
|
||||
var req PublishVideoRequest
|
||||
if err := c.ShouldBindJSON(&req); err != nil {
|
||||
respondError(c, http.StatusBadRequest, "INVALID_REQUEST",
|
||||
"请求参数错误", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
// 执行视频发布
|
||||
result, err := s.xiaohongshuService.PublishVideo(c.Request.Context(), &req)
|
||||
if err != nil {
|
||||
respondError(c, http.StatusInternalServerError, "PUBLISH_VIDEO_FAILED",
|
||||
"视频发布失败", err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
respondSuccess(c, result, "视频发布成功")
|
||||
}
|
||||
|
||||
// listFeedsHandler 获取Feeds列表
|
||||
func (s *AppServer) listFeedsHandler(c *gin.Context) {
|
||||
// 获取 Feeds 列表
|
||||
|
||||
Reference in New Issue
Block a user