go_dreamfactory/modules/gourmet/module.go
2022-08-18 15:11:20 +08:00

51 lines
1.1 KiB
Go

/*
模块名:Gourmet
描述:美食家模块
开发:梅雄风
*/
package gourmet
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Gourmet struct {
modules.ModuleBase
modelGourmet *modelGourmet
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Gourmet{}
}
func (this *Gourmet) GetType() core.M_Modules {
return comm.ModuleGourmet
}
func (this *Gourmet) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Gourmet) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelGourmet = this.RegisterComp(new(modelGourmet)).(*modelGourmet)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Gourmet) ModifyGourmetData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelGourmet.modifyGourmetDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}