go_dreamfactory/modules/gm/module.go
2022-07-13 14:14:26 +08:00

52 lines
1.1 KiB
Go

package gm
import (
"go_dreamfactory/comm"
"go_dreamfactory/modules/user"
"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 *user.ModelUser
modelNotify *modelNotifyComp
configure *configureComp
}
//模块名
func (this *GM) GetType() core.M_Modules {
return comm.ModuleWeb
}
//模块自定义参数
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(user.ModelUser)).(*user.ModelUser)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
}