go_dreamfactory/modules/web/module.go
2022-06-08 19:10:43 +08:00

46 lines
932 B
Go

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