48 lines
1.1 KiB
Go
48 lines
1.1 KiB
Go
package hunting
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/modules"
|
|
"go_dreamfactory/pb"
|
|
)
|
|
|
|
type Hunting struct {
|
|
modules.ModuleBase
|
|
modelHunting *modelHunting
|
|
api *apiComp
|
|
configure *configureComp
|
|
modulerank *ModelRank
|
|
}
|
|
|
|
func NewModule() core.IModule {
|
|
return &Hunting{}
|
|
}
|
|
|
|
func (this *Hunting) GetType() core.M_Modules {
|
|
return comm.ModuleHunting
|
|
}
|
|
|
|
func (this *Hunting) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleBase.Init(service, module, options)
|
|
|
|
return
|
|
}
|
|
|
|
func (this *Hunting) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
|
|
this.modelHunting = this.RegisterComp(new(modelHunting)).(*modelHunting)
|
|
this.modulerank = this.RegisterComp(new(ModelRank)).(*ModelRank)
|
|
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
|
}
|
|
|
|
// 接口信息
|
|
func (this *Hunting) ModifyHuntingData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
|
|
err := this.modelHunting.modifyHuntingDataByObjId(uid, data)
|
|
if err != nil {
|
|
code = pb.ErrorCode_DBError
|
|
}
|
|
return
|
|
}
|