41 lines
1013 B
Go
41 lines
1013 B
Go
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"`
|
|
}
|