feat: 移除“租户管理员为用户充值 / 每租户一套余额”能力:余额统一为全局用户余额

This commit is contained in:
2025-12-23 10:59:59 +08:00
parent dd7bcdfb98
commit a80c9b759b
39 changed files with 566 additions and 1869 deletions

View File

@@ -1686,15 +1686,12 @@ func (x NullOrderStatusStr) Value() (driver.Value, error) {
const (
// OrderTypeContentPurchase is a OrderType of type content_purchase.
OrderTypeContentPurchase OrderType = "content_purchase"
// OrderTypeTopup is a OrderType of type topup.
OrderTypeTopup OrderType = "topup"
)
var ErrInvalidOrderType = fmt.Errorf("not a valid OrderType, try [%s]", strings.Join(_OrderTypeNames, ", "))
var _OrderTypeNames = []string{
string(OrderTypeContentPurchase),
string(OrderTypeTopup),
}
// OrderTypeNames returns a list of possible string values of OrderType.
@@ -1708,7 +1705,6 @@ func OrderTypeNames() []string {
func OrderTypeValues() []OrderType {
return []OrderType{
OrderTypeContentPurchase,
OrderTypeTopup,
}
}
@@ -1726,7 +1722,6 @@ func (x OrderType) IsValid() bool {
var _OrderTypeValue = map[string]OrderType{
"content_purchase": OrderTypeContentPurchase,
"topup": OrderTypeTopup,
}
// ParseOrderType attempts to convert a string to a OrderType.
@@ -2004,8 +1999,6 @@ func (x NullRoleStr) Value() (driver.Value, error) {
}
const (
// TenantLedgerTypeCreditTopup is a TenantLedgerType of type credit_topup.
TenantLedgerTypeCreditTopup TenantLedgerType = "credit_topup"
// TenantLedgerTypeDebitPurchase is a TenantLedgerType of type debit_purchase.
TenantLedgerTypeDebitPurchase TenantLedgerType = "debit_purchase"
// TenantLedgerTypeCreditRefund is a TenantLedgerType of type credit_refund.
@@ -2021,7 +2014,6 @@ const (
var ErrInvalidTenantLedgerType = fmt.Errorf("not a valid TenantLedgerType, try [%s]", strings.Join(_TenantLedgerTypeNames, ", "))
var _TenantLedgerTypeNames = []string{
string(TenantLedgerTypeCreditTopup),
string(TenantLedgerTypeDebitPurchase),
string(TenantLedgerTypeCreditRefund),
string(TenantLedgerTypeFreeze),
@@ -2039,7 +2031,6 @@ func TenantLedgerTypeNames() []string {
// TenantLedgerTypeValues returns a list of the values for TenantLedgerType
func TenantLedgerTypeValues() []TenantLedgerType {
return []TenantLedgerType{
TenantLedgerTypeCreditTopup,
TenantLedgerTypeDebitPurchase,
TenantLedgerTypeCreditRefund,
TenantLedgerTypeFreeze,
@@ -2061,7 +2052,6 @@ func (x TenantLedgerType) IsValid() bool {
}
var _TenantLedgerTypeValue = map[string]TenantLedgerType{
"credit_topup": TenantLedgerTypeCreditTopup,
"debit_purchase": TenantLedgerTypeDebitPurchase,
"credit_refund": TenantLedgerTypeCreditRefund,
"freeze": TenantLedgerTypeFreeze,

View File

@@ -398,7 +398,7 @@ func ContentAccessStatusItems() []requests.KV {
// orders
// swagger:enum OrderType
// ENUM( content_purchase, topup )
// ENUM( content_purchase )
type OrderType string
// Description returns the Chinese label for the specific enum value.
@@ -406,8 +406,6 @@ func (t OrderType) Description() string {
switch t {
case OrderTypeContentPurchase:
return "购买内容"
case OrderTypeTopup:
return "充值"
default:
return "未知类型"
}
@@ -460,14 +458,12 @@ func OrderStatusItems() []requests.KV {
// tenant_ledgers
// swagger:enum TenantLedgerType
// ENUM( credit_topup, debit_purchase, credit_refund, freeze, unfreeze, adjustment )
// ENUM( debit_purchase, credit_refund, freeze, unfreeze, adjustment )
type TenantLedgerType string
// Description returns the Chinese label for the specific enum value.
func (t TenantLedgerType) Description() string {
switch t {
case TenantLedgerTypeCreditTopup:
return "充值入账"
case TenantLedgerTypeDebitPurchase:
return "购买扣款"
case TenantLedgerTypeCreditRefund: