上传每日一健身模块初始化
This commit is contained in:
parent
25d8e8bb72
commit
7f35654f72
@ -80,6 +80,7 @@ const (
|
||||
ModuleMline core.M_Modules = "mline" //主线模块
|
||||
ModulePvp core.M_Modules = "pvp" //实时pvp
|
||||
ModulePandaTakekan core.M_Modules = "pandatakekan" //熊猫武馆
|
||||
ModuleFitness core.M_Modules = "fitness" //每日一健
|
||||
)
|
||||
|
||||
// 数据表名定义处
|
||||
|
29
modules/fitness/api.go
Normal file
29
modules/fitness/api.go
Normal file
@ -0,0 +1,29 @@
|
||||
package fitness
|
||||
|
||||
import (
|
||||
"go_dreamfactory/modules"
|
||||
|
||||
"go_dreamfactory/lego/core"
|
||||
)
|
||||
|
||||
/*
|
||||
API
|
||||
*/
|
||||
type apiComp struct {
|
||||
modules.MCompGate
|
||||
service core.IService
|
||||
module *Forum
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *apiComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MCompGate.Init(service, module, comp, options)
|
||||
this.module = module.(*Forum)
|
||||
this.service = service
|
||||
return
|
||||
}
|
||||
|
||||
func (this *apiComp) Start() (err error) {
|
||||
err = this.MCompGate.Start()
|
||||
return
|
||||
}
|
25
modules/fitness/configure.go
Normal file
25
modules/fitness/configure.go
Normal file
@ -0,0 +1,25 @@
|
||||
package fitness
|
||||
|
||||
import (
|
||||
"go_dreamfactory/modules"
|
||||
|
||||
"go_dreamfactory/lego/core"
|
||||
)
|
||||
|
||||
const (
|
||||
game_equipment = "game_equipment.json"
|
||||
)
|
||||
|
||||
/*
|
||||
配置读取组件
|
||||
*/
|
||||
type configureComp struct {
|
||||
modules.MCompConfigure
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||
this.MCompConfigure.Init(service, module, comp, options)
|
||||
|
||||
return
|
||||
}
|
26
modules/fitness/modelFitness.go
Normal file
26
modules/fitness/modelFitness.go
Normal file
@ -0,0 +1,26 @@
|
||||
package fitness
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
/*
|
||||
数据读取组件
|
||||
*/
|
||||
type modelFitnessComp struct {
|
||||
modules.MCompModel
|
||||
module *Forum
|
||||
}
|
||||
|
||||
//组件初始化接口
|
||||
func (this *modelFitnessComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, opt core.IModuleOptions) (err error) {
|
||||
this.TableName = comm.TableForum
|
||||
this.MCompModel.Init(service, module, comp, opt)
|
||||
this.module = module.(*Forum)
|
||||
|
||||
//创建uid索引
|
||||
|
||||
return
|
||||
}
|
44
modules/fitness/module.go
Normal file
44
modules/fitness/module.go
Normal file
@ -0,0 +1,44 @@
|
||||
package fitness
|
||||
|
||||
import (
|
||||
"go_dreamfactory/comm"
|
||||
"go_dreamfactory/lego/core"
|
||||
"go_dreamfactory/modules"
|
||||
)
|
||||
|
||||
/*
|
||||
模块名:每日一健
|
||||
描述:武馆子系统 健身系统
|
||||
开发:李伟
|
||||
*/
|
||||
func NewModule() core.IModule {
|
||||
m := new(Forum)
|
||||
return m
|
||||
}
|
||||
|
||||
type Forum struct {
|
||||
modules.ModuleBase
|
||||
api_comp *apiComp
|
||||
configure *configureComp
|
||||
modelFitness *modelFitnessComp
|
||||
}
|
||||
|
||||
//模块名
|
||||
func (this *Forum) GetType() core.M_Modules {
|
||||
return comm.ModuleFitness
|
||||
}
|
||||
|
||||
//模块初始化接口 注册用户创建角色事件
|
||||
func (this *Forum) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
|
||||
err = this.ModuleBase.Init(service, module, options)
|
||||
return
|
||||
}
|
||||
|
||||
//装备组件
|
||||
func (this *Forum) OnInstallComp() {
|
||||
this.ModuleBase.OnInstallComp()
|
||||
this.api_comp = this.RegisterComp(new(apiComp)).(*apiComp)
|
||||
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
|
||||
this.modelFitness = this.RegisterComp(new(modelFitnessComp)).(*modelFitnessComp)
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user