七月迭代短暂完结,还有很多后端的关键东西没有弄,这是一版赶时间做的东西
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
All checks were successful
构建并部署到测试环境(无 SSH) / build-and-deploy (push) Successful in 8m26s
This commit is contained in:
67
pkg/constants/package_export.go
Normal file
67
pkg/constants/package_export.go
Normal file
@@ -0,0 +1,67 @@
|
||||
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 "未知"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user