add model
添加model支持
This commit is contained in:
@@ -122,7 +122,7 @@ func {{$obj.StructName}}Mgr(db *gorm.DB) *_{{$obj.StructName}}Mgr {
|
||||
panic(fmt.Errorf("{{$obj.StructName}}Mgr need init by db"))
|
||||
}
|
||||
ctx, cancel := context.WithCancel(context.Background())
|
||||
return &_{{$obj.StructName}}Mgr{_BaseMgr: &_BaseMgr{DB: db.Table("{{GetTablePrefixName $obj.TableName}}"), isRelated: globalIsRelated,ctx:ctx,cancel:cancel,timeout:-1}}
|
||||
return &_{{$obj.StructName}}Mgr{_BaseMgr: &_BaseMgr{DB: db.Model({{$obj.StructName}}{}), isRelated: globalIsRelated,ctx:ctx,cancel:cancel,timeout:-1}}
|
||||
}
|
||||
|
||||
// GetTableName get sql table name.获取数据库名字
|
||||
|
||||
Reference in New Issue
Block a user