go_dreamfactory/modules/library/module.go
2022-09-07 20:07:56 +08:00

47 lines
1.1 KiB
Go

package library
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
"go_dreamfactory/pb"
)
type Library struct {
modules.ModuleBase
modelLibrary *modelLibrary
api *apiComp
configure *configureComp
}
func NewModule() core.IModule {
return &Library{}
}
func (this *Library) GetType() core.M_Modules {
return comm.ModuleLibrary
}
func (this *Library) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Library) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.modelLibrary = this.RegisterComp(new(modelLibrary)).(*modelLibrary)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}
// 接口信息
func (this *Library) ModifyLibraryData(uid string, data map[string]interface{}) (code pb.ErrorCode) {
err := this.modelLibrary.modifyLibraryDataByObjId(uid, data)
if err != nil {
code = pb.ErrorCode_DBError
}
return
}