智能押金与33优化
This commit is contained in:
@@ -51,6 +51,7 @@ type PublishOptionsDTO struct {
|
||||
BanEvidenceOptions []string `json:"ban_evidence_options"`
|
||||
FireLevelMin int `json:"fire_level_min"`
|
||||
PriceConfig PublishPriceConfig `json:"price_config"`
|
||||
DepositRecommend PublishDepositRecommend `json:"deposit_recommend_config"`
|
||||
RatioConfig PublishRatioConfig `json:"ratio_config"`
|
||||
}
|
||||
|
||||
@@ -80,6 +81,17 @@ type PublishPriceConfig struct {
|
||||
RatioDescription string `json:"ratio_description"`
|
||||
}
|
||||
|
||||
type PublishDepositRecommend struct {
|
||||
BaseAmount float64 `json:"base_amount"`
|
||||
SkinGroupRules []PublishDepositSkinGroupRule `json:"skin_group_rules"`
|
||||
}
|
||||
|
||||
type PublishDepositSkinGroupRule struct {
|
||||
GroupKey string `json:"group_key"`
|
||||
Label string `json:"label"`
|
||||
AmountPerItem float64 `json:"amount_per_item"`
|
||||
}
|
||||
|
||||
type PublishRatioConfig struct {
|
||||
InsuranceBaseRatios []PublishInsuranceBaseRatio `json:"insurance_base_ratios"`
|
||||
ConfigItems []PublishRatioConfigItem `json:"config_items"`
|
||||
|
||||
@@ -87,6 +87,14 @@ func DefaultPublishOptions() PublishOptionsDTO {
|
||||
PricePlaceholder: "填写币数、保险、体力和负重后自动计算;发布总价=纯币基础价+额外消耗品",
|
||||
RatioDescription: "1:xx 表示 1 元人民币(RMB)等价兑换 xx 万哈夫币",
|
||||
},
|
||||
DepositRecommend: PublishDepositRecommend{
|
||||
BaseAmount: 50,
|
||||
SkinGroupRules: []PublishDepositSkinGroupRule{
|
||||
{GroupKey: "melee", Label: "刀皮", AmountPerItem: 5},
|
||||
{GroupKey: "operatorGold", Label: "干员金皮", AmountPerItem: 10},
|
||||
{GroupKey: "operatorRed", Label: "干员红皮", AmountPerItem: 30},
|
||||
},
|
||||
},
|
||||
RatioConfig: PublishRatioConfig{
|
||||
InsuranceBaseRatios: []PublishInsuranceBaseRatio{
|
||||
{Insurance: "3*3", Ratio: 40},
|
||||
|
||||
@@ -229,6 +229,12 @@ func normalizePublishOptions(options *PublishOptionsDTO) {
|
||||
if options.PriceConfig.RatioDescription == "" {
|
||||
options.PriceConfig.RatioDescription = defaults.PriceConfig.RatioDescription
|
||||
}
|
||||
if options.DepositRecommend.BaseAmount <= 0 {
|
||||
options.DepositRecommend.BaseAmount = defaults.DepositRecommend.BaseAmount
|
||||
}
|
||||
if len(options.DepositRecommend.SkinGroupRules) == 0 {
|
||||
options.DepositRecommend.SkinGroupRules = defaults.DepositRecommend.SkinGroupRules
|
||||
}
|
||||
if len(options.RatioConfig.InsuranceBaseRatios) == 0 {
|
||||
options.RatioConfig.InsuranceBaseRatios = defaults.RatioConfig.InsuranceBaseRatios
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user