package martialhall import ( "go_dreamfactory/comm" "go_dreamfactory/lego/base" "go_dreamfactory/lego/core" "go_dreamfactory/modules" ) /* 模块名:武馆 描述:练功房相关业务 开发:李伟 */ func NewModule() core.IModule { m := new(Martialhall) return m } type Martialhall struct { modules.ModuleBase service base.IRPCXService //rpc服务对象 通过这个对象可以发布服务和调用其他服务的接口 api_comp *apiComp configure *configureComp modelMartialhall *modelMartialhall } //模块名 func (this *Martialhall) GetType() core.M_Modules { return comm.ModuleMartialhall } //模块初始化接口 注册用户创建角色事件 func (this *Martialhall) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) { err = this.ModuleBase.Init(service, module, options) this.service = service.(base.IRPCXService) return } func (this *Martialhall) Start() (err error) { err = this.ModuleBase.Start() return } //装备组件 func (this *Martialhall) OnInstallComp() { this.ModuleBase.OnInstallComp() this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp) this.configure = this.RegisterComp(new(configureComp)).(*configureComp) this.modelMartialhall = this.RegisterComp(new(modelMartialhall)).(*modelMartialhall) }