All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
68 lines
1.6 KiB
Go
68 lines
1.6 KiB
Go
package constants
|
|
|
|
// GetPackageTypeName 返回套餐类型中文名称。
|
|
func GetPackageTypeName(packageType string) string {
|
|
switch packageType {
|
|
case PackageTypeFormal:
|
|
return "正式套餐"
|
|
case PackageTypeAddon:
|
|
return "附加套餐"
|
|
default:
|
|
return "未知"
|
|
}
|
|
}
|
|
|
|
// GetPackageCalendarTypeName 返回套餐周期类型中文名称。
|
|
func GetPackageCalendarTypeName(calendarType string) string {
|
|
switch calendarType {
|
|
case PackageCalendarTypeNaturalMonth:
|
|
return "自然月"
|
|
case PackageCalendarTypeByDay:
|
|
return "按天"
|
|
default:
|
|
return "未知"
|
|
}
|
|
}
|
|
|
|
// GetPackageDataResetCycleName 返回套餐流量重置周期中文名称。
|
|
func GetPackageDataResetCycleName(cycle string) string {
|
|
switch cycle {
|
|
case PackageDataResetDaily:
|
|
return "每日"
|
|
case PackageDataResetMonthly:
|
|
return "每月"
|
|
case PackageDataResetYearly:
|
|
return "每年"
|
|
case PackageDataResetNone:
|
|
return "不重置"
|
|
default:
|
|
return "未知"
|
|
}
|
|
}
|
|
|
|
// GetPackageExpiryBaseName 返回套餐到期时间基准中文名称。
|
|
func GetPackageExpiryBaseName(expiryBase string) string {
|
|
switch expiryBase {
|
|
case PackageExpiryBaseFromActivation:
|
|
return "实名激活时起算"
|
|
case PackageExpiryBaseFromPurchase:
|
|
return "购买时起算"
|
|
default:
|
|
return "未知"
|
|
}
|
|
}
|
|
|
|
// GetPackagePriceConfigStatusName 返回套餐价格配置状态中文名称。
|
|
func GetPackagePriceConfigStatusName(status int) string {
|
|
switch status {
|
|
case PackagePriceConfigStatusGiftZero:
|
|
return "赠送0价"
|
|
case PackagePriceConfigStatusConfigured:
|
|
return "已配置非0"
|
|
case PackagePriceConfigStatusUnconfigured:
|
|
return "未配置"
|
|
default:
|
|
return "未知"
|
|
}
|
|
}
|