go_dreamfactory/modules/model/module.go
2022-06-14 19:32:02 +08:00

39 lines
933 B
Go

package model
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
func NewModule() core.IModule {
m := new(Model)
return m
}
type Model struct {
modules.ModuleBase
api_comp *Api_Comp
db_comp *DB_Comp
db_service *DBService_Comp
configure_comp *Configure_Comp
}
func (this *Model) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Model) GetType() core.M_Modules {
return comm.SM_LogModelModule
}
func (this *Model) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
this.db_comp = this.RegisterComp(new(DB_Comp)).(*DB_Comp)
this.db_service = this.RegisterComp(new(DBService_Comp)).(*DBService_Comp)
this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp)
}