Download setting/operation_setting/payment_setting.go from AZILS/new-api: direct link, hf CLI and curl.
- Browser
- Download file 649 Bytes
-
https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/operation_setting/payment_setting.go
- Command line
-
hf download hf://spaces/AZILS/new-api/setting/operation_setting/payment_setting.go
-
curl -L -o payment_setting.go https://huggingface.co/spaces/AZILS/new-api/resolve/main/setting/operation_setting/payment_setting.go
649 Bytes
| package operation_setting | |
| import "github.com/QuantumNous/new-api/setting/config" | |
| type PaymentSetting struct { | |
| AmountOptions []int `json:"amount_options"` | |
| AmountDiscount map[int]float64 `json:"amount_discount"` // 充值金额对应的折扣,例如 100 元 0.9 表示 100 元充值享受 9 折优惠 | |
| } | |
| // 默认配置 | |
| var paymentSetting = PaymentSetting{ | |
| AmountOptions: []int{10, 20, 50, 100, 200, 500}, | |
| AmountDiscount: map[int]float64{}, | |
| } | |
| func init() { | |
| // 注册到全局配置管理器 | |
| config.GlobalConfig.Register("payment_setting", &paymentSetting) | |
| } | |
| func GetPaymentSetting() *PaymentSetting { | |
| return &paymentSetting | |
| } | |