feat(quality-owner): 增加开通协议与强制阅读

This commit is contained in:
yml2213
2026-11-05 11:45:02 +08:00
parent 15030237c4
commit 09f244a93d
13 changed files with 735 additions and 50 deletions
@@ -40,7 +40,7 @@ var defaultConfigs = []defaultConfig{
{Key: "order.return_overdue_grace_minutes", Value: "10", Description: "预计截止后结账宽限分钟数"},
{Key: "listing.review_required", Value: "false", Description: "发布账号是否需要后台人工审核"},
{Key: "listing.publish_cooldown_minutes", Value: "5", Description: "同一用户两次新增发布账号的最小间隔分钟数(0 表示关闭)"},
{Key: qualityowner.ConfigKey, Value: qualityowner.DefaultConfigValue(), Description: "优质号主保证金与无忧租号保险费率配置 JSON"},
{Key: qualityowner.ConfigKey, Value: qualityowner.DefaultConfigValue(), Description: "优质号主保证金、开通协议与无忧租号保险费率配置 JSON"},
{Key: listingPublishAgreementsConfigKey, Value: defaultListingPublishAgreementsConfigValue(), Description: "发布账号前协议配置 JSON"},
{Key: orderAgreementsConfigKey, Value: defaultOrderAgreementsConfigValue(), Description: "下单前协议配置 JSON"},
{Key: postRentalNoticeConfigKey, Value: defaultPostRentalNoticeConfigValue(), Description: "租后须知配置 JSON"},
@@ -134,6 +134,12 @@ func (r *Repository) List(ctx context.Context) ([]ConfigDTO, error) {
}
items := make([]ConfigDTO, 0, len(rows))
for _, row := range rows {
if row.Key == qualityowner.ConfigKey {
rules, err := qualityowner.ParseConfigValue(row.Value)
if err == nil {
row.Value, _ = qualityowner.MarshalConfig(rules)
}
}
items = append(items, toDTO(row))
}
return items, nil