57 lines
1.8 KiB
Go
57 lines
1.8 KiB
Go
package controller
|
|
|
|
import (
|
|
"ai-agent/digital-human/model/dto"
|
|
"ai-agent/digital-human/service"
|
|
"context"
|
|
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
type video struct{}
|
|
|
|
// Video 视频控制器
|
|
var Video = new(video)
|
|
|
|
// CreateVideo 创建视频
|
|
func (c *video) CreateVideo(ctx context.Context, req *dto.CreateVideoReq) (res *dto.CreateVideoRes, err error) {
|
|
return service.Video.Create(ctx, req)
|
|
}
|
|
|
|
// ListVideo 获取视频列表
|
|
func (c *video) ListVideo(ctx context.Context, req *dto.ListVideoReq) (res *dto.ListVideoRes, err error) {
|
|
return service.Video.List(ctx, req)
|
|
}
|
|
|
|
// GetVideo 获取视频详情
|
|
func (c *video) GetVideo(ctx context.Context, req *dto.GetVideoReq) (res *dto.GetVideoRes, err error) {
|
|
return service.Video.GetOne(ctx, req.ID)
|
|
}
|
|
|
|
// UpdateVideo 更新视频
|
|
func (c *video) UpdateVideo(ctx context.Context, req *dto.UpdateVideoReq) (res *beans.ResponseEmpty, err error) {
|
|
err = service.Video.Update(ctx, req)
|
|
return
|
|
}
|
|
|
|
// DeleteVideo 删除视频
|
|
func (c *video) DeleteVideo(ctx context.Context, req *dto.DeleteVideoReq) (res *beans.ResponseEmpty, err error) {
|
|
err = service.Video.Delete(ctx, req.ID)
|
|
return
|
|
}
|
|
|
|
// GenerateVideo 生成视频
|
|
func (c *video) GenerateVideo(ctx context.Context, req *dto.GenerateVideoReq) (res *dto.GenerateVideoRes, err error) {
|
|
return service.Video.Generate(ctx, req)
|
|
}
|
|
|
|
// GetVideoStatusOptions 获取视频状态选项
|
|
func (c *video) GetVideoStatusOptions(ctx context.Context, req *dto.GetVideoStatusOptionsReq) (res *dto.GetVideoStatusOptionsRes, err error) {
|
|
return service.Video.GetStatusOptions(ctx, req)
|
|
}
|
|
|
|
// GetResolutionOptions 获取分辨率选项
|
|
func (c *video) GetResolutionOptions(ctx context.Context, req *dto.GetResolutionOptionsReq) (res *dto.GetResolutionOptionsRes, err error) {
|
|
return service.Video.GetResolutionOptions(ctx, req)
|
|
}
|