56 lines
1.1 KiB
Go
56 lines
1.1 KiB
Go
package web
|
|
|
|
import (
|
|
"go_dreamfactory/comm"
|
|
"go_dreamfactory/modules"
|
|
cfg "go_dreamfactory/sys/configure/structs"
|
|
|
|
"go_dreamfactory/lego/core"
|
|
)
|
|
|
|
func NewModule() core.IModule {
|
|
m := new(Web)
|
|
return m
|
|
}
|
|
|
|
type Web struct {
|
|
modules.ModuleBase
|
|
options *Options
|
|
table *cfg.TbItem
|
|
api_comp *Api_Comp
|
|
}
|
|
|
|
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) Start() (err error) {
|
|
err = this.ModuleBase.Start()
|
|
// var (
|
|
// data interface{}
|
|
// )
|
|
// if err = configure.RegisterConfigure("tbitem.json", cfg.NewTbItem); err != nil {
|
|
// return
|
|
// }
|
|
// if data, err = configure.GetConfigure("tbitem.json"); err != nil {
|
|
// return
|
|
// }
|
|
// this.table = data.(*cfg.TbItem)
|
|
return
|
|
}
|
|
|
|
func (this *Web) OnInstallComp() {
|
|
this.ModuleBase.OnInstallComp()
|
|
this.api_comp = this.RegisterComp(new(Api_Comp)).(*Api_Comp)
|
|
}
|