go_dreamfactory/modules/monkey/module.go
2023-11-24 14:31:25 +08:00

50 lines
1.0 KiB
Go

package monkey
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
func NewModule() core.IModule {
m := new(Monkey)
return m
}
/*
模块名称:猜颜色
*/
type Monkey struct {
modules.ModuleBase
service comm.IService
api *apiComp
configure *configureComp
model *modelComp
}
// 模块名
func (this *Monkey) GetType() core.M_Modules {
return comm.ModuleMonkey
}
// 模块初始化接口
func (this *Monkey) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.service = service.(comm.IService)
return
}
func (this *Monkey) Start() (err error) {
if err = this.ModuleBase.Start(); err != nil {
return
}
return
}
func (this *Monkey) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
}