50 lines
1.1 KiB
Go
50 lines
1.1 KiB
Go
package egghunt
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(Egghunt)
|
|
return m
|
|
}
|
|
|
|
/*
|
|
模块名称:猜颜色
|
|
*/
|
|
type Egghunt struct {
|
|
modules.ModuleBase
|
|
service comm.IService
|
|
api *apiComp
|
|
configure *configureComp
|
|
model *modelComp
|
|
}
|
|
|
|
// 模块名
|
|
func (this *Egghunt) GetType() core.M_Modules {
|
|
return comm.ModuleEgghunt
|
|
}
|
|
|
|
// 模块初始化接口 注册用户创建角色事件
|
|
func (this *Egghunt) 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 *Egghunt) Start() (err error) {
|
|
if err = this.ModuleBase.Start(); err != nil {
|
|
return
|
|
}
|
|
return
|
|
}
|
|
|
|
func (this *Egghunt) 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)
|
|
}
|