49 lines
1.0 KiB
Go
49 lines
1.0 KiB
Go
package web
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/modules/user"
|
|
|
|
"go_dreamfactory/lego/core"
|
|
"go_dreamfactory/lego/core/cbase"
|
|
)
|
|
|
|
/*
|
|
模块名:web
|
|
描述:为服务集群提供一些http服务接口 方便测试和后期运维实现
|
|
开发:李伟
|
|
*/
|
|
func NewModule() core.IModule {
|
|
m := new(Web)
|
|
return m
|
|
}
|
|
|
|
type Web struct {
|
|
cbase.ModuleBase
|
|
options *Options
|
|
api_comp *Api_Comp //提供weba pi服务的组件
|
|
modelUser *user.ModelUser
|
|
}
|
|
|
|
//模块名
|
|
func (this *Web) GetType() core.M_Modules {
|
|
return comm.ModuleWeb
|
|
}
|
|
|
|
//模块自定义参数
|
|
func (this *Web) NewOptions() (options core.IModuleOptions) {
|
|
return new(Options)
|
|
}
|
|
|
|
func (this *Web) 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 *Web) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
|
|
this.modelUser = this.RegisterComp(new(user.ModelUser)).(*user.ModelUser)
|
|
}
|