go_dreamfactory/modules/troll/module.go
2022-10-28 11:55:16 +08:00

51 lines
1.1 KiB
Go

/*
模块名:Troll
描述:巨怪商队
开发:梅雄风
*/
package troll
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Troll struct {
modules.ModuleBase
modelTroll *modelTroll
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Troll{}
}
func (this *Troll) GetType() core.M_Modules {
return comm.ModuleTroll
}
func (this *Troll) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Troll) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelTroll = this.RegisterComp(new(modelTroll)).(*modelTroll)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Troll) ModifyTrollData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelTroll.modifyTrollDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}