@@ -263,6 +263,8 @@ func (h *SettingHandler) GetSettings(c *gin.Context) {
263263 AvailableChannelsEnabled : settings .AvailableChannelsEnabled ,
264264
265265 AffiliateEnabled : settings .AffiliateEnabled ,
266+
267+ BillingStatementEmailConfig : settings .BillingStatementEmailConfig ,
266268 }
267269
268270 // OpenAI fast policy (stored under a dedicated setting key)
@@ -569,6 +571,9 @@ type UpdateSettingsRequest struct {
569571 // 风控中心功能开关
570572 RiskControlEnabled * bool `json:"risk_control_enabled"`
571573
574+ // Billing statement email config (JSON string, only updated when non-empty)
575+ BillingStatementEmailConfig * string `json:"billing_statement_email_config,omitempty"`
576+
572577 // OpenAI fast/flex policy (optional, only updated when provided)
573578 OpenAIFastPolicySettings * dto.OpenAIFastPolicySettings `json:"openai_fast_policy_settings,omitempty"`
574579}
@@ -1505,6 +1510,12 @@ func (h *SettingHandler) UpdateSettings(c *gin.Context) {
15051510 }
15061511 return previousSettings .RiskControlEnabled
15071512 }(),
1513+ BillingStatementEmailConfig : func () string {
1514+ if req .BillingStatementEmailConfig != nil {
1515+ return * req .BillingStatementEmailConfig
1516+ }
1517+ return previousSettings .BillingStatementEmailConfig
1518+ }(),
15081519 }
15091520
15101521 authSourceDefaults := & service.AuthSourceDefaultSettings {
@@ -1783,9 +1794,9 @@ func (h *SettingHandler) UpdateSettings(c *gin.Context) {
17831794
17841795 AvailableChannelsEnabled : updatedSettings .AvailableChannelsEnabled ,
17851796
1786- AffiliateEnabled : updatedSettings .AffiliateEnabled ,
1787-
1788- RiskControlEnabled : updatedSettings .RiskControlEnabled ,
1797+ AffiliateEnabled : updatedSettings .AffiliateEnabled ,
1798+ RiskControlEnabled : updatedSettings . RiskControlEnabled ,
1799+ BillingStatementEmailConfig : updatedSettings .BillingStatementEmailConfig ,
17891800 }
17901801 if fastPolicy , err := h .settingService .GetOpenAIFastPolicySettings (c .Request .Context ()); err != nil {
17911802 slog .Error ("openai_fast_policy_settings_get_failed" , "error" , err )
0 commit comments