重构支付接口,以动态支持多种产品类型,整合长短效套餐的购买支付逻辑;引入 decimal 类型的金额计算;

This commit is contained in:
2025-05-20 17:14:07 +08:00
parent 689964e3ef
commit 6f1bc72912
45 changed files with 891 additions and 754 deletions

View File

@@ -6,6 +6,7 @@ import (
"gorm.io/gen/field"
"gorm.io/gorm"
"gorm.io/gorm/schema"
"strings"
)
var g *gen.Generator
@@ -23,9 +24,10 @@ func main() {
)
g = gen.NewGenerator(gen.Config{
OutPath: "web/queries",
ModelPkgPath: "models",
Mode: gen.WithDefaultQuery | gen.WithoutContext,
OutPath: "web/queries",
ModelPkgPath: "models",
FieldWithTypeTag: true,
Mode: gen.WithDefaultQuery | gen.WithoutContext,
})
g.UseDB(db)
@@ -35,6 +37,9 @@ func main() {
if field.Type == "time.Time" {
field.Type = "orm.LocalDateTime"
}
if strings.Contains(field.Tags(), "numeric") {
field.Type = "decimal.Decimal"
}
return field
}),
gen.FieldRename("contact_qq", "ContactQQ"),