同步历史版本代码

This commit is contained in:
2026-03-03 09:32:22 -08:00
parent 7d46b31866
commit 4d8516b2e1
140 changed files with 8399 additions and 489 deletions
+9
View File
@@ -12,6 +12,7 @@ type customPaymentLogicModel interface {
FindAll(ctx context.Context) ([]*Payment, error)
FindListByPage(ctx context.Context, page, size int, req *Filter) (int64, []*Payment, error)
FindAvailableMethods(ctx context.Context) ([]*Payment, error)
FindListByPlatform(ctx context.Context, platform string) ([]*Payment, error)
}
// NewModel returns a model for the database table.
@@ -67,3 +68,11 @@ func (m *customPaymentModel) FindListByPage(ctx context.Context, page, size int,
})
return total, resp, err
}
func (m *customPaymentModel) FindListByPlatform(ctx context.Context, platform string) ([]*Payment, error) {
var resp []*Payment
err := m.QueryNoCacheCtx(ctx, &resp, func(conn *gorm.DB, v interface{}) error {
return conn.Model(&Payment{}).Where("mark = ?", platform).Find(v).Error
})
return resp, err
}
+23
View File
@@ -127,3 +127,26 @@ func (l *CryptoSaaSConfig) Unmarshal(data []byte) error {
aux := (*Alias)(l)
return json.Unmarshal(data, &aux)
}
type AppleIAPConfig struct {
ProductIds []string `json:"product_ids"`
KeyID string `json:"key_id"`
IssuerID string `json:"issuer_id"`
PrivateKey string `json:"private_key"`
Sandbox bool `json:"sandbox"`
}
func (l *AppleIAPConfig) Marshal() ([]byte, error) {
type Alias AppleIAPConfig
return json.Marshal(&struct {
*Alias
}{
Alias: (*Alias)(l),
})
}
func (l *AppleIAPConfig) Unmarshal(data []byte) error {
type Alias AppleIAPConfig
aux := (*Alias)(l)
return json.Unmarshal(data, &aux)
}