feat(payment): 虎皮椒聚合支付 - 官方插件与跨平台可执行文件
新增 xunhupay 官方包,支付 RPC 与宿主只保留订单和验签边界;官方支付包同时带上各系统 provider,避免把 Linux ELF 当成本机入口。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
e5a5f0ccc8
commit
a23df0cb32
63 files changed
+2070
-128
No files matched your search
@@ -11,7 +11,7 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
const CurrentSchemaVersion int64 = 18
|
||||
const CurrentSchemaVersion int64 = 19
|
||||
|
||||
const baselineSchemaChecksum = "sha256:open-ai-canvas-schema-v1-20260830"
|
||||
const schemaMigrationAppliedAtIndexChecksum = "sha256:schema-migrations-applied-at-index-v2-20260830"
|
||||
@@ -76,6 +76,7 @@ var schemaMigrations = []migration{
|
||||
{version: 18, name: "agent_memory_settings", checksum: "sha256:agent-memory-settings-v18-20260917", apply: func(tx *gorm.DB) error {
|
||||
return tx.AutoMigrate(&model.AgentMemorySetting{})
|
||||
}},
|
||||
{version: 19, name: "payment_plugin_version", checksum: "sha256:payment-plugin-version-v19-20260917", apply: migrateSchemaV19},
|
||||
}
|
||||
|
||||
func migrateSchemaV14(tx *gorm.DB) error {
|
||||
@@ -239,6 +240,28 @@ func migrateSchemaV5(tx *gorm.DB) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func migrateSchemaV19(tx *gorm.DB) error {
|
||||
for _, value := range []any{&model.PaymentProviderConfig{}, &model.PaymentOrder{}} {
|
||||
if !tx.Migrator().HasTable(value) {
|
||||
continue
|
||||
}
|
||||
if err := addPaymentPluginVersionColumn(tx, value); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func addPaymentPluginVersionColumn(tx *gorm.DB, value any) error {
|
||||
if tx.Migrator().HasColumn(value, "plugin_version") {
|
||||
return nil
|
||||
}
|
||||
if err := tx.Migrator().AddColumn(value, "PluginVersion"); err != nil {
|
||||
return fmt.Errorf("增加支付插件版本列:%w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func migrateSchemaV6(tx *gorm.DB) error {
|
||||
if !tx.Migrator().HasTable(&model.Resource{}) {
|
||||
return fmt.Errorf("资源表不存在")
|
||||
|
||||
Reference in new issue
Block a user