go_dreamfactory/modules/caravan/module.go
2023-04-25 17:49:06 +08:00

46 lines
1.1 KiB
Go

package caravan
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Caravan struct {
modules.ModuleBase
modelCaravan *modelCaravan
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Caravan{}
}
func (this *Caravan) GetType() core.M_Modules {
return comm.ModuleTroll
}
func (this *Caravan) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Caravan) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelCaravan = this.RegisterComp(new(modelCaravan)).(*modelCaravan)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息 修改数据
func (this *Caravan) ModifyCaravanData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelCaravan.modifyCaravanDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}