package timer import ( "yunyan/comm" "yunyan/modules" "yunyan/lego/core" ) func NewModule() core.IModule { m := new(Timer) return m } type Timer struct { modules.ModuleBase model *modelComp options *Options } func (this *Timer) GetType() core.M_Modules { return comm.ModuleTimer } func (this *Timer) NewOptions() (options core.IModuleOptions) { return new(Options) } func (this *Timer) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { this.options = options.(*Options) if err = this.ModuleBase.Init(service, module, options); err != nil { return } return } func (this *Timer) Start() (err error) { if err = this.ModuleBase.Start(); err != nil { return } return } func (this *Timer) OnInstallComp() { this.ModuleBase.OnInstallComp() this.model = this.RegisterComp(new(modelComp)).(*modelComp) }