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