From 4372d4d283841e43d2fb566453f766f8a058c227 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 8 Jun 2022 19:27:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0comm=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- comm/core.go | 12 ++++-------- comm/imodule.go | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) create mode 100644 comm/imodule.go diff --git a/comm/core.go b/comm/core.go index 7f6cdff3d..1888e5496 100644 --- a/comm/core.go +++ b/comm/core.go @@ -14,6 +14,7 @@ const ( SC_ServiceGateRouteComp core.S_Comps = "SC_GateRouteComp" //s_comps.ISC_GateRouteComp ) +//模块名定义处 const ( SM_GateModule core.M_Modules = "gateway" //gate模块 网关服务模块 SM_WebModule core.M_Modules = "web" //web模块 @@ -23,6 +24,7 @@ const ( SM_FriendModule core.M_Modules = "friend" //好友模块 ) +//RPC服务接口定义处 const ( //Rpc Rpc_GatewayRoute core.Rpc_Key = "Rpc_GatewayRoute" //网关路由 Rpc_GatewayAgentBuild core.Rpc_Key = "Rpc_GatewayAgentBuild" //代理绑定 绑定用户Id @@ -33,25 +35,19 @@ const ( //Rpc Rpc_GatewayAgentClose core.Rpc_Key = "Rpc_GatewayAgentClose" //代理关闭 关闭用户连接 ) +//事件类型定义处 const ( Event_UserLogin core.Event_Key = "Event_UserLogin" //登录事件 Event_CreateUser core.Event_Key = "Event_CreateUser" //创建角色事件 Event_UserOffline core.Event_Key = "Event_UserOffline" //用户离线事件 ) +// 服务网关组件接口定义 type ISC_GateRouteComp interface { core.IServiceComp RegisterRoute(methodName string, comp reflect.Value, msg reflect.Type, fn reflect.Method) } -type Imail interface { - CreateNewMail(uId string) -} - -type IPack interface { - //GetRewaredItems(uId string, itmes map[uint32]uint32) -} - //用户会话 type IUserSession interface { GetSessionId() string diff --git a/comm/imodule.go b/comm/imodule.go new file mode 100644 index 000000000..d2611e34a --- /dev/null +++ b/comm/imodule.go @@ -0,0 +1,16 @@ +package comm + +/* +业务模块 对外接口定义处 +*/ + +type ( + //邮件业务模块对外接口定义 提供给其他模块使用的 + Imail interface { + CreateNewMail(uId string) + } + //背包模块对外接口定义 提供给其他模块使用的 + IPack interface { + //GetRewaredItems(uId string, itmes map[uint32]uint32) + } +)