52 lines
1.1 KiB
Go
52 lines
1.1 KiB
Go
package achieve
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
)
|
|
|
|
type Achieve struct {
|
|
modules.ModuleBase
|
|
service core.IService
|
|
wtask comm.IWtask
|
|
api *apiComp
|
|
model *modelComp
|
|
configure *configureComp
|
|
}
|
|
|
|
func NewModule() core.IModule {
|
|
return &Achieve{}
|
|
}
|
|
|
|
func (this *Achieve) GetType() core.M_Modules {
|
|
return comm.ModuleAchieve
|
|
}
|
|
|
|
func (this *Achieve) 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 *Achieve) Start() (err error) {
|
|
if err = this.ModuleBase.Start(); err != nil {
|
|
return
|
|
}
|
|
var module core.IModule
|
|
if module, err = this.service.GetModule(comm.ModuleWtask); err != nil {
|
|
return
|
|
}
|
|
this.wtask = module.(comm.IWtask)
|
|
return
|
|
}
|
|
|
|
func (this *Achieve) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
this.model = this.RegisterComp(new(modelComp)).(*modelComp)
|
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
|
}
|