旧时光

This commit is contained in:
wh_zcy 2023-04-23 14:50:49 +08:00
parent c9a04e6d81
commit bf8a33eba4
6 changed files with 113 additions and 0 deletions

View File

@ -85,6 +85,7 @@ const (
ModuleParkour core.M_Modules = "parkour" //跑酷系统
ModuleTools core.M_Modules = "tools" //工具
ModuleReputation core.M_Modules = "reputation" //阵营声望
ModuleOldtimes core.M_Modules = "oldtimes" //旧时光
)
// 数据表名定义处
@ -255,6 +256,9 @@ const (
TableParkourMatch = "parkourmatch"
///坐骑表
TableParkourMounts = "parkourmounts"
//旧时光
TableOldtimes = "oldtimes"
)
// RPC服务接口定义处

20
modules/oldtimes/api.go Normal file
View File

@ -0,0 +1,20 @@
package oldtimes
import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type apiComp struct {
modules.MCompGate
service base.IRPCXService
module *Oldtimes
}
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.service = service.(base.IRPCXService)
this.module = module.(*Oldtimes)
return
}

View File

@ -0,0 +1,23 @@
package oldtimes
import (
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
cfg "go_dreamfactory/sys/configure/structs"
)
const (
gameLinestoryMainTask = "game_linestroymaintask.json"
)
type configureComp struct {
modules.MCompConfigure
}
func (this *configureComp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompConfigure.Init(service, module, comp, options)
err = this.LoadMultiConfigure(map[string]interface{}{
gameLinestoryMainTask: cfg.NewGameLinestoryMainTask,
})
return
}

View File

@ -0,0 +1,21 @@
package oldtimes
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type ModelOldtimes struct {
modules.MCompModel
moduleOldtimes *Oldtimes
service core.IService
}
func (this *ModelOldtimes) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
err = this.MCompModel.Init(service, module, comp, options)
this.TableName = comm.TableOldtimes
this.moduleOldtimes = module.(*Oldtimes)
this.service = service
return
}

View File

@ -0,0 +1,43 @@
package oldtimes
import (
"go_dreamfactory/comm"
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/modules"
)
type Oldtimes struct {
modules.ModuleBase
api *apiComp
service base.IRPCXService
configure *configureComp
modelOldtimes *ModelOldtimes
}
func NewModule() core.IModule {
return &Oldtimes{}
}
func (this *Oldtimes) Init(service core.IService, module core.IModule, options core.IModuleOptions) (err error) {
err = this.ModuleBase.Init(service, module, options)
return
}
func (this *Oldtimes) OnInstallComp() {
this.ModuleBase.OnInstallComp()
this.api = this.RegisterComp(new(apiComp)).(*apiComp)
this.configure = this.RegisterComp(new(configureComp)).(*configureComp)
this.modelOldtimes = this.RegisterComp(new(ModelOldtimes)).(*ModelOldtimes)
}
func (this *Oldtimes) GetType() core.M_Modules {
return comm.ModuleOldtimes
}
func (this *Oldtimes) Start() (err error) {
err = this.ModuleBase.Start()
return
}

View File

@ -27,6 +27,7 @@ import (
"go_dreamfactory/modules/mline"
"go_dreamfactory/modules/moonfantasy"
"go_dreamfactory/modules/notify"
"go_dreamfactory/modules/oldtimes"
"go_dreamfactory/modules/pagoda"
"go_dreamfactory/modules/parkour"
"go_dreamfactory/modules/pay"
@ -121,6 +122,7 @@ func main() {
parkour.NewModule(),
tools.NewModule(),
reputation.NewModule(),
oldtimes.NewModule(),
)
}