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