go_dreamfactory/modules/moonlv/module.go

45 lines
1.1 KiB
Go

package moonlv
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/sys/log"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Moonlv struct {
modules.ModuleBase
api *apiComp
configure *configureComp
modelMoonlv *modelMoonlv
service core.IService
}
func NewModule() core.IModule {
return &Moonlv{}
}
func (this *Moonlv) GetType() core.M_Modules {
return comm.ModuleMoonlv
}
func (this *Moonlv) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
if err = this.ModuleBase.Init(service, module, options); err != nil {
return
}
this.service = service
return
}
func (this *Moonlv) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelMoonlv = this.RegisterComp(new(modelMoonlv)).(*modelMoonlv)
}
func (this *Moonlv) BuriedsNotify(session comm.IUserSession, conds []*pb.ConIProgress) {
this.Debug("护月任务通知", log.Field{Key: "uid", Value: session.GetUserId()}, log.Field{Key: "conds", Value: conds})
}