feat:增加一个作品列表接口

This commit is contained in:
cjy 2026-01-13 15:19:13 +08:00
parent 49caaa73c6
commit e6ca737fb1
2 changed files with 22 additions and 0 deletions

View File

@ -47,6 +47,7 @@ func MediaRouter(r *gin.RouterGroup) {
work.POST("remind", serviceCast.Remind) work.POST("remind", serviceCast.Remind)
work.POST("publish-info", serviceCast.PublishInfo) work.POST("publish-info", serviceCast.PublishInfo)
work.POST("import-batch", serviceCast.ImportWorkBatch) work.POST("import-batch", serviceCast.ImportWorkBatch)
work.POST("list-published", serviceCast.WorkListPublished)
} }
script := auth.Group("script") script := auth.Group("script")

View File

@ -1805,3 +1805,24 @@ func checkAndReuploadImage(imageUrl string, mediaType string) (string, error) {
} }
return compressUrl, nil return compressUrl, nil
} }
// WorkListPublished 获取已发布的作品列表
func WorkListPublished(ctx *gin.Context) {
var (
req *cast.WorkListPublishedReq
resp *cast.WorkListPublishedResp
)
var err error
if err = ctx.ShouldBind(&req); err != nil {
service.Error(ctx, err)
return
}
newCtx := NewCtxWithUserInfo(ctx)
resp, err = service.CastProvider.WorkListPublished(newCtx, req)
if err != nil {
service.Error(ctx, err)
return
}
service.Success(ctx, resp)
return
}