package models import ( _ "github.com/go-sql-driver/mysql" "hongze/hongze_cygxzs/utils" "time" "rdluck_tools/orm" ) func init() { _ = orm.RegisterDataBase("default", "mysql", utils.MYSQL_URL) orm.SetMaxIdleConns("default", 50) orm.SetMaxOpenConns("default", 100) db, _ := orm.GetDB("default") db.SetConnMaxLifetime(10 * time.Minute) //注册对象 orm.RegisterModel( new(WxUser), new(CygxSession), new(WxUserLog), new(WxUserCode), new(UserRecord), new(CygxUserRecord), ) }