diff --git a/server/gamesapi/common/types.go b/server/gamesapi/common/types.go index 15f0eeb6..e8696e44 100644 --- a/server/gamesapi/common/types.go +++ b/server/gamesapi/common/types.go @@ -6,3 +6,6 @@ type App interface { type RouterGroup interface { } + +type ServiceMgr interface { +} diff --git a/server/gamesapi/constant/constant.go b/server/gamesapi/constant/constant.go index 1c284727..c8140346 100644 --- a/server/gamesapi/constant/constant.go +++ b/server/gamesapi/constant/constant.go @@ -1,12 +1,9 @@ package constant -const ( - MAIL_DB = "maildb" -) - const ( APP_MODULE_IDX = iota ROUTER_MODULE_IDX CONTROLLER_MGR_MODULE_IDX + SERVICE_MGR_MODULE_IDX MAX_MODULE_IDX ) diff --git a/server/gamesapi/global/global.go b/server/gamesapi/global/global.go index 5f713443..82033a59 100644 --- a/server/gamesapi/global/global.go +++ b/server/gamesapi/global/global.go @@ -9,15 +9,21 @@ import ( var modules [constant.MAX_MODULE_IDX]q5.Module var initOrders = []int32{ + constant.SERVICE_MGR_MODULE_IDX, constant.ROUTER_MODULE_IDX, } var app common.App +var serviceMgr common.ServiceMgr func GetApp() common.App { return app } +func GetServiceMgr() common.ServiceMgr { + return serviceMgr +} + func RegModule(idx int32, m q5.Module) { fmt.Printf("RegModule module %d\n", idx) modules[idx] = m @@ -28,7 +34,7 @@ func RegModule(idx int32, m q5.Module) { } case constant.ROUTER_MODULE_IDX: { - + serviceMgr = m.(common.ServiceMgr) } default: { diff --git a/server/gamesapi/service/export.go b/server/gamesapi/service/export.go new file mode 100644 index 00000000..405e578e --- /dev/null +++ b/server/gamesapi/service/export.go @@ -0,0 +1,12 @@ +package service + +import ( + "main/constant" + "main/global" +) + +var _serviceMgr = new(serviceMgr) + +func init() { + global.RegModule(constant.SERVICE_MGR_MODULE_IDX, _serviceMgr) +} diff --git a/server/gamesapi/service/servicemgr.go b/server/gamesapi/service/servicemgr.go new file mode 100644 index 00000000..b7128169 --- /dev/null +++ b/server/gamesapi/service/servicemgr.go @@ -0,0 +1,11 @@ +package service + +type serviceMgr struct { +} + +func (this *serviceMgr) Init() { + + +func (this *serviceMgr) UnInit() { + +}