84 lines
3.5 KiB
Go
84 lines
3.5 KiB
Go
package config
|
||
|
||
// 本文件按业务功能域组织实验参数:每个域的 key 定义与其默认值就近放在一起,
|
||
// 新增/查找参数时只需定位到对应业务域这一节即可。
|
||
// KeysDefault 汇总所有默认值,NewUser 初始化用户参数时遍历它。
|
||
|
||
var KeysDefault = mergeDefaults(
|
||
vipPayDefaults,
|
||
pkgUpdateDefaults,
|
||
pkgInstallDefaults,
|
||
)
|
||
|
||
func mergeDefaults(maps ...map[string]any) map[string]any {
|
||
out := make(map[string]any)
|
||
for _, m := range maps {
|
||
for k, v := range m {
|
||
out[k] = v
|
||
}
|
||
}
|
||
return out
|
||
}
|
||
|
||
// ==================== 会员与支付 ====================
|
||
|
||
const (
|
||
ServiceFreeDay = "server.free.day" // 免费使用天数
|
||
ServiceVipExpireNotice = "server.vip.expire.notice" // 会员到期提示语
|
||
ServiceVipExpireButton = "server.vip.expire.button" // 会员到期按钮文字
|
||
ServiceVipExpireUrl = "server.vip.expire.url" // 会员到期跳转地址
|
||
ServiceFirstPayWay = "server.first.pay.way" // 首次激活支付方式:coupon | recharge
|
||
ServicePayWay = "server.pay.way" // 后续支付方式:coupon | recharge
|
||
ServerCouponNotice = "server.coupon.notice" // 兑换码输入提示语
|
||
ServiceCouponSubmitButton = "server.coupon.submit.button" // 兑换码提交按钮文字
|
||
ButtonTxtContractCustomer = "server.button.contract.customer" // 联系客服按钮文字
|
||
)
|
||
|
||
var vipPayDefaults = map[string]any{
|
||
ServiceFreeDay: "1",
|
||
ServiceVipExpireNotice: "您的会员已过期,请联系客服充值",
|
||
ServiceVipExpireButton: "充值",
|
||
ServiceVipExpireUrl: "",
|
||
ServiceFirstPayWay: "coupon",
|
||
ServicePayWay: "coupon",
|
||
ServerCouponNotice: "请输入兑换码",
|
||
ServiceCouponSubmitButton: "提交",
|
||
ButtonTxtContractCustomer: "联系客服",
|
||
}
|
||
|
||
// ==================== 包更新 ====================
|
||
|
||
const (
|
||
ServiceUpdateBeforeDay = "server.update.before.day" // 提示更新天数
|
||
ServiceForceUpdateDay = "server.force.update.day" // 强制更新天数
|
||
ServiceUpdateNotice = "server.update.notice" // 更新提示语
|
||
ServiceForceUpdateNotice = "server.force.update.notice" // 强制更新提示语
|
||
ServiceUpdateOtherNotice = "server.update.other.notice" // 换包更新提示语
|
||
)
|
||
|
||
var pkgUpdateDefaults = map[string]any{
|
||
ServiceUpdateBeforeDay: "30",
|
||
ServiceForceUpdateDay: "7",
|
||
ServiceUpdateNotice: "您的包将于%s到期,请你前往AppStore更新应用",
|
||
ServiceForceUpdateNotice: "请您先备份好聊天记录,再前往AppStore更新应用。否则数据会丢失",
|
||
ServiceUpdateOtherNotice: "您需要下载新的应用,请注意备份聊天记录",
|
||
}
|
||
|
||
// ==================== 包缺失与安装 ====================
|
||
|
||
const (
|
||
ServiceUserPackageLack = "server.user.package.lack" // 未查询到用户包信息提示语
|
||
ServicePackageLackButton = "server.package.lack.button" // 用户包缺失按钮文字
|
||
ServicePackageLackUrl = "server.package.lack.url" // 用户包缺失下载地址
|
||
ServiceContactCustomer = "server.contact.customer" // 联系客服提示语
|
||
ServiceInstallButton = "server.install.button" // 安装按钮文字
|
||
)
|
||
|
||
var pkgInstallDefaults = map[string]any{
|
||
ServiceUserPackageLack: "请您重新安装",
|
||
ServicePackageLackButton: "安装",
|
||
ServicePackageLackUrl: "",
|
||
ServiceContactCustomer: "安装包缺失,请联系客服解决:wangfuduo@batiao8.com",
|
||
ServiceInstallButton: "安装",
|
||
}
|