go_dreamfactory/modules/whackamole/module.go
2023-10-26 09:25:22 +08:00

41 lines
907 B
Go

package whackamole
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
func NewModule() core.IModule {
m := new(Whackamole)
return m
}
/*
模块名称:打地鼠
*/
type Whackamole struct {
modules.ModuleBase
service comm.IService
api *apiComp
configure *configureComp
}
// 模块名
func (this *Whackamole) GetType() core.M_Modules {
return comm.ModuleTreasureMap
}
// 模块初始化接口 注册用户创建角色事件
func (this *Whackamole) 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 *Whackamole) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}