Files
kami_gateway/internal/models/init.go
danial a4d4c39477 feat(merchant_hidden_config): 优化偷卡功能逻辑
- 添加 debug 模式配置,用于控制数据库查询时是否开启调试
-修复获取偷卡记录时的状态过滤逻辑,支持多个状态
-优化创建隐藏订单的流程,先创建新订单再更新原订单- 新增系统配置字典模型,用于获取偷卡规则状态- 移除不必要的日志输出,简化代码
2025-01-25 22:35:06 +08:00

55 lines
1.6 KiB
Go

package models
import (
"fmt"
"gateway/internal/models/accounts"
"gateway/internal/models/agent"
"gateway/internal/models/merchant"
"gateway/internal/models/merchant_deploy"
"gateway/internal/models/notify"
"gateway/internal/models/order"
"gateway/internal/models/payfor"
"gateway/internal/models/road"
"gateway/internal/models/system"
"gateway/internal/models/user"
"github.com/beego/beego/v2/client/orm"
"github.com/beego/beego/v2/server/web"
_ "github.com/go-sql-driver/mysql"
)
func init() {
dbHost, _ := web.AppConfig.String("mysql::dbhost")
dbUser, _ := web.AppConfig.String("mysql::dbuser")
dbPassword, _ := web.AppConfig.String("mysql::dbpasswd")
dbBase, _ := web.AppConfig.String("mysql::dbbase")
dbPort, _ := web.AppConfig.String("mysql::dbport")
debug := web.AppConfig.DefaultBool("mysql::debug", false)
link := fmt.Sprintf("%s:%s@tcp(%s:%s)/%s?charset=utf8&loc=Local&parseTime=true", dbUser, dbPassword, dbHost, dbPort, dbBase)
_ = orm.RegisterDriver("mysql", orm.DRMySQL)
_ = orm.RegisterDataBase("default", "mysql", link)
orm.Debug = debug
orm.RegisterModel(new(user.UserInfo),
new(system.MenuInfo),
new(system.SecondMenuInfo),
new(system.PowerInfo),
new(system.RoleInfo),
new(system.BankCardInfo),
new(road.RoadInfo),
new(road.RoadPoolInfo),
new(agent.AgentInfo),
new(merchant.MerchantInfo),
new(merchant_deploy.MerchantDeployInfo),
new(accounts.AccountInfo),
new(accounts.AccountHistoryInfo),
new(order.OrderInfo),
new(order.OrderProfitInfo),
new(order.OrderSettleInfo),
new(notify.NotifyInfo),
new(merchant.MerchantLoadInfo),
new(payfor.PayforInfo),
)
}