初始化项目
This commit is contained in:
55
digitalhuman/consts/digitalhuman_status.go
Normal file
55
digitalhuman/consts/digitalhuman_status.go
Normal file
@@ -0,0 +1,55 @@
|
||||
package consts
|
||||
|
||||
// DigitalHumanStatus 数字人状态类型
|
||||
type DigitalHumanStatus int
|
||||
|
||||
// 数字人状态常量
|
||||
const (
|
||||
DigitalHumanStatusInactive DigitalHumanStatus = 0 // 停用
|
||||
DigitalHumanStatusActive DigitalHumanStatus = 1 // 启用
|
||||
)
|
||||
|
||||
// GetDigitalHumanStatusText 获取数字人状态文本
|
||||
func GetDigitalHumanStatusText(status int) string {
|
||||
switch status {
|
||||
case int(DigitalHumanStatusInactive):
|
||||
return "停用"
|
||||
case int(DigitalHumanStatusActive):
|
||||
return "启用"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
|
||||
// GetAllDigitalHumanStatusKeyValue 获取所有数字人状态选项
|
||||
func GetAllDigitalHumanStatusKeyValue() []DigitalHumanStatusKeyValue {
|
||||
return []DigitalHumanStatusKeyValue{
|
||||
{Value: int(DigitalHumanStatusInactive), Label: "停用"},
|
||||
{Value: int(DigitalHumanStatusActive), Label: "启用"},
|
||||
}
|
||||
}
|
||||
|
||||
// DigitalHumanStatusKeyValue 数字人状态键值对
|
||||
type DigitalHumanStatusKeyValue struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
|
||||
// GetStatusText 获取状态文本(向后兼容)
|
||||
func GetStatusText(status int) string {
|
||||
return GetDigitalHumanStatusText(status)
|
||||
}
|
||||
|
||||
// GetAllStatusKeyValue 获取所有状态选项(向后兼容)
|
||||
func GetAllStatusKeyValue() []StatusKeyValue {
|
||||
return []StatusKeyValue{
|
||||
{Value: int(DigitalHumanStatusInactive), Label: "停用"},
|
||||
{Value: int(DigitalHumanStatusActive), Label: "启用"},
|
||||
}
|
||||
}
|
||||
|
||||
// StatusKeyValue 状态键值对(向后兼容)
|
||||
type StatusKeyValue struct {
|
||||
Value int `json:"value"`
|
||||
Label string `json:"label"`
|
||||
}
|
||||
Reference in New Issue
Block a user