初始化项目

This commit is contained in:
2026-04-27 10:54:32 +08:00
parent 28976d3e7d
commit ba360bc89b
20 changed files with 589 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package consts
// VideoStatus 视频状态类型
type VideoStatus int
// 视频生成状态常量
const (
VideoStatusGenerating VideoStatus = 0 // 生成中
VideoStatusSuccess VideoStatus = 1 // 成功
VideoStatusFailed VideoStatus = 2 // 失败
)
// GetVideoStatusText 获取视频状态文本
func GetVideoStatusText(status int) string {
switch status {
case int(VideoStatusGenerating):
return "生成中"
case int(VideoStatusSuccess):
return "成功"
case int(VideoStatusFailed):
return "失败"
default:
return "未知"
}
}
// GetAllVideoStatusKeyValue 获取所有视频状态选项
func GetAllVideoStatusKeyValue() []VideoStatusKeyValue {
return []VideoStatusKeyValue{
{Value: int(VideoStatusGenerating), Label: "生成中"},
{Value: int(VideoStatusSuccess), Label: "成功"},
{Value: int(VideoStatusFailed), Label: "失败"},
}
}
// VideoStatusKeyValue 视频状态键值对
type VideoStatusKeyValue struct {
Value int `json:"value"`
Label string `json:"label"`
}