go_dreamfactory/modules/herotask/module.go

54 lines
1.1 KiB
Go

package herotask
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type HeroTask struct {
modules.ModuleBase
service core.IService
api *apiComp
configure *configureComp
modeltask *Modeltask
open bool
}
func NewModule() core.IModule {
return &HeroTask{}
}
func (this *HeroTask) GetType() core.M_Modules {
return comm.ModuleHeroTask
}
func (this *HeroTask) 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 *HeroTask) Start() (err error) {
err = this.ModuleBase.Start()
return
}
func (this *HeroTask) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modeltask = this.RegisterComp(new(Modeltask)).(*Modeltask)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 活动开启
func (this *HeroTask) ActivityNotice(hdlist *pb.DBHuodong) {
switch hdlist.Itype {
case comm.KFSevenTask:
this.open = true
break
}
}