67 lines
1.6 KiB
Go
67 lines
1.6 KiB
Go
package dailytask
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/lego/sys/event"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type Dailytask struct {
|
|
modules.ModuleBase
|
|
service core.IService
|
|
caravan comm.ICaravan
|
|
battle comm.IBattle
|
|
sys comm.ISys
|
|
api *apiComp
|
|
configure *configureComp
|
|
modelDailytask *ModelDailytask
|
|
}
|
|
|
|
func NewModule() core.IModule {
|
|
return &Dailytask{}
|
|
}
|
|
|
|
func (this *Dailytask) GetType() core.M_Modules {
|
|
return comm.ModuleDailytask
|
|
}
|
|
|
|
func (this *Dailytask) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleBase.Init(service, module, options)
|
|
this.service = service
|
|
return
|
|
}
|
|
|
|
func (this *Dailytask) Start() (err error) {
|
|
err = this.ModuleBase.Start()
|
|
var module core.IModule
|
|
if module, err = this.service.GetModule(comm.ModuleBattle); err != nil {
|
|
return
|
|
}
|
|
this.battle = module.(comm.IBattle)
|
|
if module, err = this.service.GetModule(comm.ModuleSys); err != nil {
|
|
return
|
|
}
|
|
this.sys = module.(comm.ISys)
|
|
if module, err = this.service.GetModule(comm.ModuleCaravan); err != nil {
|
|
return
|
|
}
|
|
this.caravan = module.(comm.ICaravan)
|
|
|
|
event.RegisterGO(comm.EventUserLogin, this.EventUserLogin)
|
|
return
|
|
}
|
|
|
|
func (this *Dailytask) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
this.modelDailytask = this.RegisterComp(new(ModelDailytask)).(*ModelDailytask)
|
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
|
|
|
}
|
|
|
|
// 用户登录
|
|
func (this *Dailytask) EventUserLogin(session comm.IUserSession) {
|
|
|
|
}
|