go_dreamfactory/modules/gm/module.go
2022-07-13 18:59:04 +08:00

52 lines
1.2 KiB
Go

package gm
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
)
/*
模块名:gm
描述:提供管理员相关的http接口
开发:李伟
*/
func NewModule() core.IModule {
m := new(GM)
return m
}
type GM struct {
cbase.ModuleBase
options *Options
api_comp *Api_Comp //提供weba pi服务的组件
modelUser *modelUserComp
modelNotify *modelNotifyComp
configure *configureComp
}
//模块名
func (this *GM) GetType() core.M_Modules {
return comm.ModuleGM
}
//模块自定义参数
func (this *GM) NewOptions() (options core.IModuleOptions) {
return new(Options)
}
func (this *GM) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
this.options = options.(*Options)
return
}
func (this *GM) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
this.modelUser = this.RegisterComp(new(modelUserComp)).(*modelUserComp)
this.modelNotify = this.RegisterComp(new(modelNotifyComp)).(*modelNotifyComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}