day day up

This commit is contained in:
谢小军
2020-01-08 20:21:30 +08:00
parent 0a32dfe0e3
commit 204164e8b9
9 changed files with 90 additions and 20 deletions

View File

@@ -46,4 +46,23 @@ func (f optionFunc) apply(o *options) {
f(o)
}
`
genlogic = `{{$obj := .}}{{$list := $obj.Em}}
type _{{$obj.StructName}}Mgr struct {
*_BaseMgr
}
// {{$obj.StructName}}Mgr open func
func {{$obj.StructName}}Mgr(db *gorm.DB) *_{{$obj.StructName}}Mgr {
if db == nil {
panic(fmt.Errorf("{{$obj.StructName}}Mgr init need db"))
}
return &_{{$obj.StructName}}Mgr{_BaseMgr: &_BaseMgr{DB: db}}
}
// GetTableName get sql table name.获取数据库名字
func (obj *_{{$obj.StructName}}Mgr) GetTableName() string {
return "{{$obj.TableName}}"
}
`
)