package model import ( "go_dreamfactory/comm" "go_dreamfactory/lego/core" "go_dreamfactory/modules" "time" ) func NewModule() core.IModule { m := new(Model) return m } type Model struct { modules.ModuleBase api_comp *Api_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) Start() (err error) { err = this.ModuleBase.Start() //go this.RunWriteDB() return } func (this *Model) GetType() core.M_Modules { return comm.SM_LogModelMueule } func (this *Model) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp) this.configure_comp = this.RegisterComp(new(Configure_Comp)).(*Configure_Comp) } func (this *Model) RunWriteDB() { for { time.Sleep(time.Second) } }