Merge branch 'dev' of http://git.legu.cc/liwei_3d/go_dreamfactory into dev
This commit is contained in:
commit
92378b0c5a
@ -50,10 +50,17 @@
|
|||||||
"text": "故事发生在很久以前的古代中国,而且要从一只喜欢滚来滚去、滚来滚去的大熊猫身上说起。"
|
"text": "故事发生在很久以前的古代中国,而且要从一只喜欢滚来滚去、滚来滚去的大熊猫身上说起。"
|
||||||
},
|
},
|
||||||
"stroyid": [
|
"stroyid": [
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
3,
|
||||||
|
-1,
|
||||||
3
|
3
|
||||||
],
|
],
|
||||||
"condition": [
|
"condition": [
|
||||||
0
|
0,
|
||||||
|
1,
|
||||||
|
2,
|
||||||
|
4
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -18,5 +18,25 @@
|
|||||||
"msgid": "forum.watchhero",
|
"msgid": "forum.watchhero",
|
||||||
"routrules": "~/worker",
|
"routrules": "~/worker",
|
||||||
"describe": "论坛查看目标英雄接口"
|
"describe": "论坛查看目标英雄接口"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"msgid": "chat.crosschannel",
|
||||||
|
"routrules": "~/worker",
|
||||||
|
"describe": "聊天系统跨服聊天频道请求"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"msgid": "chat.chanagechannel",
|
||||||
|
"routrules": "~/worker",
|
||||||
|
"describe": "切换聊天频道"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"msgid": "chat.getlist",
|
||||||
|
"routrules": "~/worker",
|
||||||
|
"describe": "获取聊天记录"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"msgid": "chat.send",
|
||||||
|
"routrules": "~/worker",
|
||||||
|
"describe": "聊天消息发送"
|
||||||
}
|
}
|
||||||
]
|
]
|
@ -2,9 +2,7 @@
|
|||||||
{
|
{
|
||||||
"key": 1,
|
"key": 1,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 10,
|
||||||
10
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -16,9 +14,7 @@
|
|||||||
{
|
{
|
||||||
"key": 2,
|
"key": 2,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 20,
|
||||||
20
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -30,9 +26,7 @@
|
|||||||
{
|
{
|
||||||
"key": 3,
|
"key": 3,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 30,
|
||||||
30
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -44,9 +38,7 @@
|
|||||||
{
|
{
|
||||||
"key": 4,
|
"key": 4,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 40,
|
||||||
40
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -58,9 +50,7 @@
|
|||||||
{
|
{
|
||||||
"key": 5,
|
"key": 5,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 50,
|
||||||
50
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -72,9 +62,7 @@
|
|||||||
{
|
{
|
||||||
"key": 6,
|
"key": 6,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 60,
|
||||||
60
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -86,9 +74,7 @@
|
|||||||
{
|
{
|
||||||
"key": 7,
|
"key": 7,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 70,
|
||||||
70
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -100,9 +86,7 @@
|
|||||||
{
|
{
|
||||||
"key": 8,
|
"key": 8,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 80,
|
||||||
80
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -114,9 +98,7 @@
|
|||||||
{
|
{
|
||||||
"key": 9,
|
"key": 9,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 90,
|
||||||
90
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -128,9 +110,7 @@
|
|||||||
{
|
{
|
||||||
"key": 10,
|
"key": 10,
|
||||||
"pagoda_type": 1,
|
"pagoda_type": 1,
|
||||||
"layer_num": [
|
"layer_num": 100,
|
||||||
100
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -142,9 +122,7 @@
|
|||||||
{
|
{
|
||||||
"key": 11,
|
"key": 11,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 5,
|
||||||
5
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -156,9 +134,7 @@
|
|||||||
{
|
{
|
||||||
"key": 12,
|
"key": 12,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 10,
|
||||||
10
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -170,9 +146,7 @@
|
|||||||
{
|
{
|
||||||
"key": 13,
|
"key": 13,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 15,
|
||||||
15
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -184,9 +158,7 @@
|
|||||||
{
|
{
|
||||||
"key": 14,
|
"key": 14,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 20,
|
||||||
20
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -198,9 +170,7 @@
|
|||||||
{
|
{
|
||||||
"key": 15,
|
"key": 15,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 25,
|
||||||
25
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -212,9 +182,7 @@
|
|||||||
{
|
{
|
||||||
"key": 16,
|
"key": 16,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 30,
|
||||||
30
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -226,9 +194,7 @@
|
|||||||
{
|
{
|
||||||
"key": 17,
|
"key": 17,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 35,
|
||||||
35
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -240,9 +206,7 @@
|
|||||||
{
|
{
|
||||||
"key": 18,
|
"key": 18,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 40,
|
||||||
40
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -254,9 +218,7 @@
|
|||||||
{
|
{
|
||||||
"key": 19,
|
"key": 19,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 45,
|
||||||
45
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
@ -268,9 +230,7 @@
|
|||||||
{
|
{
|
||||||
"key": 20,
|
"key": 20,
|
||||||
"pagoda_type": 2,
|
"pagoda_type": 2,
|
||||||
"layer_num": [
|
"layer_num": 50,
|
||||||
50
|
|
||||||
],
|
|
||||||
"reward": [
|
"reward": [
|
||||||
{
|
{
|
||||||
"a": "attr",
|
"a": "attr",
|
||||||
|
@ -4,7 +4,7 @@ services:
|
|||||||
name: 外网
|
name: 外网
|
||||||
url: ws://119.3.89.14:7891/gateway
|
url: ws://119.3.89.14:7891/gateway
|
||||||
- service:
|
- service:
|
||||||
sid: 2
|
sid: "dfz"
|
||||||
name: 赵长远
|
name: 赵长远
|
||||||
url: ws://10.0.0.238:7891/gateway
|
url: ws://10.0.0.238:7891/gateway
|
||||||
- service:
|
- service:
|
||||||
@ -12,6 +12,6 @@ services:
|
|||||||
name: 内网
|
name: 内网
|
||||||
url: ws://10.0.0.9:7891/gateway
|
url: ws://10.0.0.9:7891/gateway
|
||||||
- service:
|
- service:
|
||||||
sid: 4
|
sid: "dfmxf"
|
||||||
name: service4
|
name: 梅雄风
|
||||||
url: ws://10.0.0.101:7891/gateway
|
url: ws://10.0.0.85:7891/gateway
|
@ -20,7 +20,7 @@ type ConfigServiceImpl struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type ServiceConf struct {
|
type ServiceConf struct {
|
||||||
SId int32 `yaml:"sid"`
|
SId string `yaml:"sid"`
|
||||||
Name string `yaml:"name"`
|
Name string `yaml:"name"`
|
||||||
Url string `yaml:"url"`
|
Url string `yaml:"url"`
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ func (c *ConfigServiceImpl) Unmarshal() error {
|
|||||||
srvConf := &ServiceConf{}
|
srvConf := &ServiceConf{}
|
||||||
switch kk {
|
switch kk {
|
||||||
case "sid":
|
case "sid":
|
||||||
srvConf.SId = vv[kk].(int32)
|
srvConf.SId = vv[kk].(string)
|
||||||
case "name":
|
case "name":
|
||||||
srvConf.Name = vv[kk].(string)
|
srvConf.Name = vv[kk].(string)
|
||||||
case "url":
|
case "url":
|
||||||
|
@ -86,28 +86,21 @@ func (c *ConnServiceImpl) ListenerPush() {
|
|||||||
methodStr := msg.Data.TypeUrl
|
methodStr := msg.Data.TypeUrl
|
||||||
methodName := common.SubStr(methodStr, 20, len(methodStr))
|
methodName := common.SubStr(methodStr, 20, len(methodStr))
|
||||||
p := &model.PushModel{
|
p := &model.PushModel{
|
||||||
// MainType: msg.MainType,
|
|
||||||
// SubType: msg.SubType,
|
|
||||||
MethodName: methodName,
|
MethodName: methodName,
|
||||||
DataTime: time.Now().Format(time.RFC3339),
|
DataTime: time.Now().Format(time.RFC3339),
|
||||||
// Rsp: msg.Data,
|
Msg: msg,
|
||||||
Msg: msg,
|
|
||||||
}
|
}
|
||||||
logrus.WithFields(
|
logrus.WithFields(
|
||||||
logrus.Fields{"MainType": msg.MainType, "SubType": msg.SubType},
|
logrus.Fields{"MainType": msg.MainType, "SubType": msg.SubType},
|
||||||
).Debug(methodName)
|
).Debug(methodName)
|
||||||
|
|
||||||
renderRespPanel := func(p *model.PushModel) {
|
renderRespPanel := func(p *model.PushModel) {
|
||||||
// data, err := anypb.New(p.Msg)
|
c.obs.Notify(observer.EVENT_REQ_RSP, p.Msg)
|
||||||
// if err != nil {
|
|
||||||
// logrus.Error(err)
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
c.obs.Notify(observer.EVENT_CASE_RSP, p.Msg)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if strings.HasSuffix(methodName, "Push") {
|
if strings.HasSuffix(methodName, "Push") {
|
||||||
c.obs.Notify(observer.EVENT_APP_PUSH, p)
|
c.obs.Notify(observer.EVENT_APP_MONI, p)
|
||||||
|
c.obs.Notify(observer.EVENT_USER_CHANGE, p)
|
||||||
if methodName == "NotifyErrorNotifyPush" {
|
if methodName == "NotifyErrorNotifyPush" {
|
||||||
renderRespPanel(p)
|
renderRespPanel(p)
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,10 @@ const (
|
|||||||
//用户详情
|
//用户详情
|
||||||
EVENT_USERINFO Event = "userinfo"
|
EVENT_USERINFO Event = "userinfo"
|
||||||
//协议推送
|
//协议推送
|
||||||
EVENT_APP_PUSH Event = "push"
|
EVENT_APP_MONI Event = "push"
|
||||||
|
EVENT_USER_CHANGE = "chanage"
|
||||||
//测试用例响应事件
|
//测试用例响应事件
|
||||||
EVENT_CASE_RSP Event = "response"
|
EVENT_REQ_RSP Event = "response"
|
||||||
// 清空 ui数据事件
|
// 清空 ui数据事件
|
||||||
EVENT_UI_CLEAN = "uiclean"
|
EVENT_UI_CLEAN = "uiclean"
|
||||||
)
|
)
|
||||||
|
@ -15,8 +15,8 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
type PttService interface {
|
type PttService interface {
|
||||||
Login(sid, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp)
|
Login(sid, account string) (code pb.ErrorCode)
|
||||||
CreateRole(nickName string) (code pb.ErrorCode, rsp *pb.UserCreateResp)
|
CreateRole(nickName string) (code pb.ErrorCode)
|
||||||
GetUser() *UserInfo
|
GetUser() *UserInfo
|
||||||
SetUser(dbUser *pb.DBUser, dbUserExpand *pb.DBUserExpand)
|
SetUser(dbUser *pb.DBUser, dbUserExpand *pb.DBUserExpand)
|
||||||
SendToClient(mainType, subType string, rsp proto.Message) error
|
SendToClient(mainType, subType string, rsp proto.Message) error
|
||||||
@ -61,7 +61,7 @@ func (p *PttServiceImpl) SendToClient(mainType, subType string, rsp proto.Messag
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
func (p *PttServiceImpl) Login(sid, account string) (code pb.ErrorCode, rsp *pb.UserLoginResp) {
|
func (p *PttServiceImpl) Login(sid, account string) (code pb.ErrorCode) {
|
||||||
head := &pb.UserMessage{MainType: string(comm.ModuleUser), SubType: user.UserSubTypeLogin}
|
head := &pb.UserMessage{MainType: string(comm.ModuleUser), SubType: user.UserSubTypeLogin}
|
||||||
head.Sec = common.BuildSecStr(sid, account)
|
head.Sec = common.BuildSecStr(sid, account)
|
||||||
if err := p.connService.SendMsg(head, &pb.UserLoginReq{
|
if err := p.connService.SendMsg(head, &pb.UserLoginReq{
|
||||||
@ -72,29 +72,11 @@ func (p *PttServiceImpl) Login(sid, account string) (code pb.ErrorCode, rsp *pb.
|
|||||||
logrus.WithField("err", err).Error("Login")
|
logrus.WithField("err", err).Error("Login")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//respone
|
|
||||||
for {
|
|
||||||
if cd, msg := p.connService.ReceiveMsg(); cd != pb.ErrorCode_Success {
|
|
||||||
code = cd
|
|
||||||
break
|
|
||||||
} else {
|
|
||||||
//suc
|
|
||||||
rsp = &pb.UserLoginResp{}
|
|
||||||
if msg.MainType == string(comm.ModuleUser) && msg.SubType == user.UserSubTypeLogin {
|
|
||||||
if !comm.ProtoUnmarshal(msg, rsp) {
|
|
||||||
code = pb.ErrorCode_PbError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// create role
|
// create role
|
||||||
func (p *PttServiceImpl) CreateRole(nickName string) (code pb.ErrorCode, rsp *pb.UserCreateResp) {
|
func (p *PttServiceImpl) CreateRole(nickName string) (code pb.ErrorCode) {
|
||||||
head := &pb.UserMessage{MainType: string(comm.ModuleUser), SubType: user.UserSubTypeCreate}
|
head := &pb.UserMessage{MainType: string(comm.ModuleUser), SubType: user.UserSubTypeCreate}
|
||||||
head.Sec = common.BuildSecStr(p.user.DbUser.Sid, p.user.DbUser.Binduid)
|
head.Sec = common.BuildSecStr(p.user.DbUser.Sid, p.user.DbUser.Binduid)
|
||||||
if err := p.connService.SendMsg(head, &pb.UserCreateReq{
|
if err := p.connService.SendMsg(head, &pb.UserCreateReq{
|
||||||
@ -104,26 +86,5 @@ func (p *PttServiceImpl) CreateRole(nickName string) (code pb.ErrorCode, rsp *pb
|
|||||||
logrus.WithField("err", err).Error("CreateRole")
|
logrus.WithField("err", err).Error("CreateRole")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//response
|
|
||||||
// for {
|
|
||||||
// if cd, msg := p.connService.ReceiveMsg(); cd != pb.ErrorCode_Success {
|
|
||||||
// code = cd
|
|
||||||
// break
|
|
||||||
// } else {
|
|
||||||
// rsp = &pb.UserCreateResp{}
|
|
||||||
// if msg.MainType == string(comm.ModuleUser) && msg.SubType == user.UserSubTypeCreate {
|
|
||||||
// if !comm.ProtoUnmarshal(msg, rsp) {
|
|
||||||
// code = pb.ErrorCode_PbError
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// logrus.
|
|
||||||
// WithFields(logrus.Fields{"nickname": nickName}).
|
|
||||||
// WithFields(logrus.Fields{"rsp": rsp.IsSucc}).
|
|
||||||
// Debug("response create role")
|
|
||||||
// break
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -5,6 +5,7 @@ import (
|
|||||||
"go_dreamfactory/cmd/v2/lib/common"
|
"go_dreamfactory/cmd/v2/lib/common"
|
||||||
"go_dreamfactory/cmd/v2/model"
|
"go_dreamfactory/cmd/v2/model"
|
||||||
"go_dreamfactory/cmd/v2/service/observer"
|
"go_dreamfactory/cmd/v2/service/observer"
|
||||||
|
"time"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
@ -71,8 +72,9 @@ func (a appMonitor) OnClose() bool {
|
|||||||
|
|
||||||
// monitor list data
|
// monitor list data
|
||||||
func (this *appMonitor) Run() {
|
func (this *appMonitor) Run() {
|
||||||
this.obs.AddListener(observer.EVENT_APP_PUSH, observer.Listener{
|
this.obs.AddListener(observer.EVENT_APP_MONI, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
|
time.Sleep(time.Millisecond * 20)
|
||||||
data := d.(*model.PushModel)
|
data := d.(*model.PushModel)
|
||||||
this.monitorData.DataList = append(this.monitorData.DataList, data)
|
this.monitorData.DataList = append(this.monitorData.DataList, data)
|
||||||
this.reloadMonitorData()
|
this.reloadMonitorData()
|
||||||
|
@ -46,7 +46,7 @@ func (a *appTester) LazyInit(obs observer.Observer) error {
|
|||||||
if view, ok := viewRegister[viewKey]; ok {
|
if view, ok := viewRegister[viewKey]; ok {
|
||||||
view.Init(obs, globalWin.w)
|
view.Init(obs, globalWin.w)
|
||||||
resLog := widget.NewMultiLineEntry()
|
resLog := widget.NewMultiLineEntry()
|
||||||
obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(data interface{}, args ...interface{}) {
|
OnNotify: func(data interface{}, args ...interface{}) {
|
||||||
if data == nil {
|
if data == nil {
|
||||||
return
|
return
|
||||||
|
@ -20,3 +20,7 @@ func (this *BaseformView) Init(obs observer.Observer, w fyne.Window) {
|
|||||||
this.form = widget.NewForm()
|
this.form = widget.NewForm()
|
||||||
this.form.SubmitText = common.BUTTON_OK
|
this.form.SubmitText = common.BUTTON_OK
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *BaseformView) Load() {
|
||||||
|
this.form.OnSubmit()
|
||||||
|
}
|
||||||
|
@ -65,7 +65,7 @@ func (this *FriendAgreeView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
|
|
||||||
// listener applyListdata
|
// listener applyListdata
|
||||||
func (this *FriendAgreeView) dataListener() {
|
func (this *FriendAgreeView) dataListener() {
|
||||||
this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*pb.UserMessage)
|
data := d.(*pb.UserMessage)
|
||||||
if !(data.MainType == string(comm.ModuleFriend) &&
|
if !(data.MainType == string(comm.ModuleFriend) &&
|
||||||
|
@ -46,7 +46,7 @@ func (this *FriendBlacklistView) CreateView(t *model.TestCase) fyne.CanvasObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *FriendBlacklistView) dataListener() {
|
func (this *FriendBlacklistView) dataListener() {
|
||||||
this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*pb.UserMessage)
|
data := d.(*pb.UserMessage)
|
||||||
if !(data.MainType == string(comm.ModuleFriend) &&
|
if !(data.MainType == string(comm.ModuleFriend) &&
|
||||||
|
@ -10,6 +10,7 @@ import (
|
|||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
|
"fyne.io/fyne/v2/theme"
|
||||||
"fyne.io/fyne/v2/widget"
|
"fyne.io/fyne/v2/widget"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
@ -17,6 +18,7 @@ import (
|
|||||||
//好友列表
|
//好友列表
|
||||||
type FriendListView struct {
|
type FriendListView struct {
|
||||||
FriendListBaseView //继承支持好友列表的基类
|
FriendListBaseView //继承支持好友列表的基类
|
||||||
|
friendList func()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
||||||
@ -27,7 +29,7 @@ func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
this.createList()
|
this.createList()
|
||||||
|
|
||||||
// new friendlist btn
|
// new friendlist btn
|
||||||
friendList := func() {
|
this.friendList = func() {
|
||||||
if err := service.GetPttService().SendToClient(
|
if err := service.GetPttService().SendToClient(
|
||||||
string(comm.ModuleFriend),
|
string(comm.ModuleFriend),
|
||||||
friend.FriendSubTypeList,
|
friend.FriendSubTypeList,
|
||||||
@ -36,10 +38,26 @@ func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
}
|
}
|
||||||
this.friendData = model.NewFriendModelList()
|
this.friendData = model.NewFriendModelList()
|
||||||
}
|
}
|
||||||
friendListBtn := widget.NewButton("好友列表", friendList)
|
friendListBtn := widget.NewButton("好友列表", this.friendList)
|
||||||
|
|
||||||
|
//点赞
|
||||||
|
zanBtn := widget.NewButtonWithIcon("点赞", theme.ConfirmIcon(), func() {
|
||||||
|
|
||||||
|
if err := service.GetPttService().SendToClient(
|
||||||
|
t.MainType,
|
||||||
|
friend.FriendSubTypeZan,
|
||||||
|
&pb.FriendZanReq{
|
||||||
|
FriendId: this.selFriendIds[0],
|
||||||
|
},
|
||||||
|
); err != nil {
|
||||||
|
logrus.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.applyListBtnFun()
|
||||||
|
})
|
||||||
|
|
||||||
// layout
|
// layout
|
||||||
split := container.NewHSplit(this.dataList, container.NewVBox(friendListBtn))
|
split := container.NewHSplit(this.dataList, container.NewVBox(friendListBtn, zanBtn))
|
||||||
split.Offset = 1
|
split.Offset = 1
|
||||||
|
|
||||||
//data listener for
|
//data listener for
|
||||||
@ -47,8 +65,12 @@ func (this *FriendListView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
return split
|
return split
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (this *FriendListView) Load() {
|
||||||
|
this.friendList()
|
||||||
|
}
|
||||||
|
|
||||||
func (this *FriendListView) dataListener() {
|
func (this *FriendListView) dataListener() {
|
||||||
this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*pb.UserMessage)
|
data := d.(*pb.UserMessage)
|
||||||
if !(data.MainType == string(comm.ModuleFriend) &&
|
if !(data.MainType == string(comm.ModuleFriend) &&
|
||||||
@ -61,6 +83,7 @@ func (this *FriendListView) dataListener() {
|
|||||||
logrus.Error("unmarshal err")
|
logrus.Error("unmarshal err")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.friendData = model.NewFriendModelList()
|
||||||
for _, v := range rsp.List {
|
for _, v := range rsp.List {
|
||||||
fm := &model.FriendModel{
|
fm := &model.FriendModel{
|
||||||
Uid: v.UserId,
|
Uid: v.UserId,
|
||||||
|
@ -23,22 +23,6 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
//init required
|
//init required
|
||||||
this.initFriendList()
|
this.initFriendList()
|
||||||
|
|
||||||
//点赞
|
|
||||||
zanBtn := widget.NewButtonWithIcon("点赞", theme.ConfirmIcon(), func() {
|
|
||||||
|
|
||||||
if err := service.GetPttService().SendToClient(
|
|
||||||
t.MainType,
|
|
||||||
t.SubType,
|
|
||||||
&pb.FriendZanReq{
|
|
||||||
FriendId: this.selFriendIds[0],
|
|
||||||
},
|
|
||||||
); err != nil {
|
|
||||||
logrus.Error(err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.applyListBtnFun()
|
|
||||||
})
|
|
||||||
|
|
||||||
receiveBtn := widget.NewButtonWithIcon("获赞", theme.ConfirmIcon(), func() {
|
receiveBtn := widget.NewButtonWithIcon("获赞", theme.ConfirmIcon(), func() {
|
||||||
|
|
||||||
if err := service.GetPttService().SendToClient(
|
if err := service.GetPttService().SendToClient(
|
||||||
@ -59,7 +43,7 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
if err := service.GetPttService().SendToClient(
|
if err := service.GetPttService().SendToClient(
|
||||||
string(comm.ModuleFriend),
|
string(comm.ModuleFriend),
|
||||||
friend.FriendSubTypeZanList,
|
friend.FriendSubTypeZanList,
|
||||||
&pb.FriendListReq{}); err != nil {
|
&pb.FriendZanlistReq{}); err != nil {
|
||||||
logrus.Error(err)
|
logrus.Error(err)
|
||||||
}
|
}
|
||||||
this.friendData = model.NewFriendModelList()
|
this.friendData = model.NewFriendModelList()
|
||||||
@ -70,7 +54,7 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
this.createList()
|
this.createList()
|
||||||
|
|
||||||
// layout
|
// layout
|
||||||
split := container.NewHSplit(this.dataList, container.NewVBox(zanListBtn, zanBtn, receiveBtn))
|
split := container.NewHSplit(this.dataList, container.NewVBox(zanListBtn, receiveBtn))
|
||||||
split.Offset = 1
|
split.Offset = 1
|
||||||
|
|
||||||
this.dataListener()
|
this.dataListener()
|
||||||
@ -78,7 +62,7 @@ func (this *FriendZanView) CreateView(t *model.TestCase) fyne.CanvasObject {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (this *FriendZanView) dataListener() {
|
func (this *FriendZanView) dataListener() {
|
||||||
this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*pb.UserMessage)
|
data := d.(*pb.UserMessage)
|
||||||
if !(data.MainType == string(comm.ModuleFriend) &&
|
if !(data.MainType == string(comm.ModuleFriend) &&
|
||||||
@ -91,6 +75,7 @@ func (this *FriendZanView) dataListener() {
|
|||||||
logrus.Error("unmarshal err")
|
logrus.Error("unmarshal err")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.friendData = model.NewFriendModelList()
|
||||||
for _, v := range rsp.List {
|
for _, v := range rsp.List {
|
||||||
fm := &model.FriendModel{
|
fm := &model.FriendModel{
|
||||||
Uid: v.UserId,
|
Uid: v.UserId,
|
||||||
|
@ -5,6 +5,8 @@ import (
|
|||||||
"go_dreamfactory/cmd/v2/lib/common"
|
"go_dreamfactory/cmd/v2/lib/common"
|
||||||
"go_dreamfactory/cmd/v2/service"
|
"go_dreamfactory/cmd/v2/service"
|
||||||
"go_dreamfactory/cmd/v2/service/observer"
|
"go_dreamfactory/cmd/v2/service/observer"
|
||||||
|
"go_dreamfactory/comm"
|
||||||
|
"go_dreamfactory/modules/user"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -60,7 +62,7 @@ func NewMainWindow(ui *UIImpl) MainWindow {
|
|||||||
|
|
||||||
ui.obs.AddListener(observer.EVENT_PING, observer.Listener{
|
ui.obs.AddListener(observer.EVENT_PING, observer.Listener{
|
||||||
OnNotify: func(data interface{}, args ...interface{}) {
|
OnNotify: func(data interface{}, args ...interface{}) {
|
||||||
dialog.NewConfirm("链接中断", data.(error).Error(), func(
|
conf := dialog.NewConfirm("链接中断", data.(error).Error(), func(
|
||||||
b bool) {
|
b bool) {
|
||||||
if b {
|
if b {
|
||||||
globalWin.w.Close()
|
globalWin.w.Close()
|
||||||
@ -68,7 +70,10 @@ func NewMainWindow(ui *UIImpl) MainWindow {
|
|||||||
dialog.NewInformation("提示", "重启登录", globalWin.w)
|
dialog.NewInformation("提示", "重启登录", globalWin.w)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}, globalWin.w).Show()
|
}, globalWin.w)
|
||||||
|
conf.SetDismissText("取消")
|
||||||
|
conf.SetConfirmText("退出")
|
||||||
|
conf.Show()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
return mw
|
return mw
|
||||||
@ -164,7 +169,7 @@ func (ui *MainWindowImpl) createChooseServerWindow(
|
|||||||
d.Hide()
|
d.Hide()
|
||||||
dialog.ShowError(err, parent)
|
dialog.ShowError(err, parent)
|
||||||
} else {
|
} else {
|
||||||
ch <- fmt.Sprintf("%d:%s", s.SId, s.Name)
|
ch <- fmt.Sprintf("%s:%s", s.SId, s.Name)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
return btn
|
return btn
|
||||||
@ -191,7 +196,7 @@ func (ui *MainWindowImpl) createChooseServerWindow(
|
|||||||
func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
||||||
//form
|
//form
|
||||||
account := widget.NewEntry()
|
account := widget.NewEntry()
|
||||||
account.Text = "user8120" //default account
|
account.Text = "user8080" //default account
|
||||||
// account.Validator = validation.NewRegexp(`^(\s*)$`, "account required")
|
// account.Validator = validation.NewRegexp(`^(\s*)$`, "account required")
|
||||||
// password := widget.NewPasswordEntry()
|
// password := widget.NewPasswordEntry()
|
||||||
items := []*widget.FormItem{
|
items := []*widget.FormItem{
|
||||||
@ -205,31 +210,52 @@ func (ui *MainWindowImpl) createLoginWin(sid, sname string) {
|
|||||||
} else {
|
} else {
|
||||||
if account.Text != "" {
|
if account.Text != "" {
|
||||||
logrus.WithField("account", account.Text).Debug("submit login")
|
logrus.WithField("account", account.Text).Debug("submit login")
|
||||||
if code, rsp := ui.pttService.Login(sid, account.Text); code != pb.ErrorCode_Success {
|
ui.createWindowContainer()
|
||||||
|
appName, err := ui.at.openDefaultApp()
|
||||||
|
if err != nil {
|
||||||
|
logrus.WithField("appName", appName).Error(err)
|
||||||
|
}
|
||||||
|
// 必须在创建窗口之后调用
|
||||||
|
ui.connService.ListenerPush()
|
||||||
|
if code := ui.pttService.Login(sid, account.Text); code != pb.ErrorCode_Success {
|
||||||
err := fmt.Errorf("login err: %v[%d]", code, int32(code))
|
err := fmt.Errorf("login err: %v[%d]", code, int32(code))
|
||||||
dialog.ShowError(err, ui.w)
|
dialog.ShowError(err, ui.w)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ui.w.SetTitle(fmt.Sprintf("%s[%d]", sname, sid))
|
//
|
||||||
ui.connService.ListenerPush()
|
ui.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
//show mainwindow
|
OnNotify: func(data interface{}, args ...interface{}) {
|
||||||
// logrus.Debug(rsp)
|
if data == nil {
|
||||||
ui.pttService.SetUser(rsp.Data, rsp.Ex)
|
return
|
||||||
// isCreateRole
|
}
|
||||||
if rsp.Data.Created {
|
msg := data.(*pb.UserMessage)
|
||||||
// ui.renderUserContainer()
|
if msg.MainType == string(comm.ModuleUser) &&
|
||||||
ui.createWindowContainer()
|
msg.SubType == user.UserSubTypeLogin {
|
||||||
ui.sb.setMessage(common.LABEL_WELCOME + rsp.Data.Binduid)
|
rsp := &pb.UserLoginResp{}
|
||||||
appName, err := ui.at.openDefaultApp()
|
if !comm.ProtoUnmarshal(msg, rsp) {
|
||||||
if err != nil {
|
logrus.Error("unmarshal err")
|
||||||
logrus.WithField("appName", appName).Error(err)
|
return
|
||||||
}
|
}
|
||||||
ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser())
|
|
||||||
} else {
|
|
||||||
ui.createRoleWindowPopUp()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
ui.w.SetTitle(fmt.Sprintf("%s[%s]", sname, sid))
|
||||||
|
|
||||||
|
//show mainwindow
|
||||||
|
// logrus.Debug(rsp)
|
||||||
|
ui.pttService.SetUser(rsp.Data, rsp.Ex)
|
||||||
|
// isCreateRole
|
||||||
|
if rsp.Data.Created {
|
||||||
|
// ui.renderUserContainer()
|
||||||
|
|
||||||
|
ui.sb.setMessage(common.LABEL_WELCOME + rsp.Data.Binduid)
|
||||||
|
|
||||||
|
ui.obs.Notify(observer.EVENT_USERINFO, ui.pttService.GetUser())
|
||||||
|
} else {
|
||||||
|
ui.createRoleWindowPopUp()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -268,7 +294,7 @@ func (ui *MainWindowImpl) createRoleWindowPopUp() {
|
|||||||
} else {
|
} else {
|
||||||
if nickname.Text != "" {
|
if nickname.Text != "" {
|
||||||
logrus.WithField("nickname", nickname.Text).Debug("submit crete role")
|
logrus.WithField("nickname", nickname.Text).Debug("submit crete role")
|
||||||
if code, _ := ui.pttService.CreateRole(nickname.Text); code != pb.ErrorCode_Success {
|
if code := ui.pttService.CreateRole(nickname.Text); code != pb.ErrorCode_Success {
|
||||||
err := fmt.Errorf("login err: %v[%d]", code, int32(code))
|
err := fmt.Errorf("login err: %v[%d]", code, int32(code))
|
||||||
dialog.ShowError(err, ui.w)
|
dialog.ShowError(err, ui.w)
|
||||||
} else {
|
} else {
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
type MyCaseView interface {
|
type MyCaseView interface {
|
||||||
Init(obs observer.Observer, w fyne.Window)
|
Init(obs observer.Observer, w fyne.Window)
|
||||||
CreateView(t *model.TestCase) fyne.CanvasObject
|
CreateView(t *model.TestCase) fyne.CanvasObject
|
||||||
|
Load()
|
||||||
}
|
}
|
||||||
|
|
||||||
// 1 注册接口测试的表单试图
|
// 1 注册接口测试的表单试图
|
||||||
@ -272,10 +273,10 @@ var (
|
|||||||
Rsp: &pb.FriendSearchResp{},
|
Rsp: &pb.FriendSearchResp{},
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
},
|
},
|
||||||
ff(comm.ModuleFriend, friend.FriendSubTypeZanList):{
|
ff(comm.ModuleFriend, friend.FriendSubTypeZanList): {
|
||||||
Desc: "点赞好友",
|
Desc: "点赞好友",
|
||||||
MainType: string(comm.ModuleFriend),
|
MainType: string(comm.ModuleFriend),
|
||||||
SubType: friend.FriendSubTypeSearch,
|
SubType: friend.FriendSubTypeZanList,
|
||||||
Enabled: true,
|
Enabled: true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -87,7 +87,7 @@ func (this *toyUserInfo) dataListener() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.obs.AddListener(observer.EVENT_CASE_RSP, observer.Listener{
|
this.obs.AddListener(observer.EVENT_REQ_RSP, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*pb.UserMessage)
|
data := d.(*pb.UserMessage)
|
||||||
//change name
|
//change name
|
||||||
@ -103,7 +103,7 @@ func (this *toyUserInfo) dataListener() {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
this.obs.AddListener(observer.EVENT_APP_PUSH, observer.Listener{
|
this.obs.AddListener(observer.EVENT_USER_CHANGE, observer.Listener{
|
||||||
OnNotify: func(d interface{}, args ...interface{}) {
|
OnNotify: func(d interface{}, args ...interface{}) {
|
||||||
data := d.(*model.PushModel)
|
data := d.(*model.PushModel)
|
||||||
// listener gold
|
// listener gold
|
||||||
@ -120,6 +120,9 @@ func (this *toyUserInfo) dataListener() {
|
|||||||
data.Msg.SubType == "" {
|
data.Msg.SubType == "" {
|
||||||
//TODO change exp
|
//TODO change exp
|
||||||
}
|
}
|
||||||
|
//
|
||||||
|
logrus.WithField("key", "a").Debug(data.Msg.SubType)
|
||||||
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -88,6 +88,8 @@ const (
|
|||||||
TableEquipment = "equipment"
|
TableEquipment = "equipment"
|
||||||
///聊天数据表
|
///聊天数据表
|
||||||
TableChat = "chat"
|
TableChat = "chat"
|
||||||
|
// 爬塔数据表
|
||||||
|
TablePagoda = "pagoda"
|
||||||
)
|
)
|
||||||
|
|
||||||
//RPC服务接口定义处
|
//RPC服务接口定义处
|
||||||
@ -100,6 +102,7 @@ const ( //Rpc
|
|||||||
Rpc_GatewaySendBatchMsg core.Rpc_Key = "Rpc_GatewaySendBatchMsg" //向多个用户发送消息
|
Rpc_GatewaySendBatchMsg core.Rpc_Key = "Rpc_GatewaySendBatchMsg" //向多个用户发送消息
|
||||||
Rpc_GatewaySendRadioMsg core.Rpc_Key = "Rpc_GatewaySendRadioMsg" //广播消息
|
Rpc_GatewaySendRadioMsg core.Rpc_Key = "Rpc_GatewaySendRadioMsg" //广播消息
|
||||||
Rpc_GatewayAgentClose core.Rpc_Key = "Rpc_GatewayAgentClose" //代理关闭 关闭用户连接
|
Rpc_GatewayAgentClose core.Rpc_Key = "Rpc_GatewayAgentClose" //代理关闭 关闭用户连接
|
||||||
|
Rpc_GatewayNoticeUserLogin core.Rpc_Key = "Rpc_NoticeUserLogin" //通知用户登录
|
||||||
Rpc_GatewayNoticeUserClose core.Rpc_Key = "Rpc_NoticeUserClose" //通知用户离线
|
Rpc_GatewayNoticeUserClose core.Rpc_Key = "Rpc_NoticeUserClose" //通知用户离线
|
||||||
//GM 后台消息
|
//GM 后台消息
|
||||||
Rpc_GMReleaseChatSystemMessage core.Rpc_Key = "Rpc_GMChatReleaseSystemMessage" //发布聊天系统消息
|
Rpc_GMReleaseChatSystemMessage core.Rpc_Key = "Rpc_GMChatReleaseSystemMessage" //发布聊天系统消息
|
||||||
|
@ -81,5 +81,6 @@ type IRPCXService interface {
|
|||||||
RpcGo(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (call *client.Call, err error)
|
RpcGo(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (call *client.Call, err error)
|
||||||
AcrossClusterRpcCall(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
AcrossClusterRpcCall(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
||||||
AcrossClusterRpcGo(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (call *client.Call, err error)
|
AcrossClusterRpcGo(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (call *client.Call, err error)
|
||||||
|
AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
||||||
ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error)
|
||||||
}
|
}
|
||||||
|
@ -179,6 +179,17 @@ func (this *RPCXService) AcrossClusterRpcGo(ctx context.Context, clusterTag stri
|
|||||||
return rpcx.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, nil)
|
return rpcx.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, nil)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//目标集群广播消息
|
||||||
|
//clusterTag 集群标签
|
||||||
|
///servicePath = worker 表示采用负载的方式调用 worker类型服务执行rpc方法
|
||||||
|
///servicePath = worker/worker_1 表示寻找目标服务节点调用rpc方法
|
||||||
|
///servicePath = worker/!worker_1 表示选择非worker_1的节点随机选择节点执行rpc方法
|
||||||
|
///servicePath = worker/[worker_1,worker_2] 表示随机选择[]里面的服务节点执行rpc方法
|
||||||
|
///servicePath = worker/![worker_1,worker_2] 表示随机选择非[]里面的服务节点执行rpc方法
|
||||||
|
func (this *RPCXService) AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
|
return rpcx.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
|
}
|
||||||
|
|
||||||
///全集群广播 执行目标远程服务方法
|
///全集群广播 执行目标远程服务方法
|
||||||
///servicePath = worker 表示采用负载的方式调用 worker类型服务执行rpc方法
|
///servicePath = worker 表示采用负载的方式调用 worker类型服务执行rpc方法
|
||||||
func (this *RPCXService) ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func (this *RPCXService) ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
|
@ -14,7 +14,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func Test_sys(t *testing.T) {
|
func Test_sys(t *testing.T) {
|
||||||
if err := log.OnInit(nil, log.SetFileName("test"), log.SetReportCaller(true)); err != nil {
|
if err := log.OnInit(nil, log.SetFileName("test")); err != nil {
|
||||||
fmt.Printf("log init err:%v", err)
|
fmt.Printf("log init err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -96,7 +96,7 @@ func (l *LogFileOut) openExistingOrNew(writeLen int) error {
|
|||||||
return l.rotate()
|
return l.rotate()
|
||||||
}
|
}
|
||||||
|
|
||||||
file, err := os.OpenFile(filename, os.O_APPEND|os.O_WRONLY, 0644)
|
file, err := os.OpenFile(filename, os.O_CREATE|os.O_WRONLY|os.O_TRUNC, 0666)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// if we fail to open the old log file for some reason, just ignore
|
// if we fail to open the old log file for some reason, just ignore
|
||||||
// it and open a new log file.
|
// it and open a new log file.
|
||||||
@ -217,7 +217,7 @@ func (l *LogFileOut) openNew() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
name := l.filename()
|
name := l.filename()
|
||||||
mode := os.FileMode(0600)
|
mode := os.FileMode(0666)
|
||||||
info, err := osStat(name)
|
info, err := osStat(name)
|
||||||
//备份老的日志文件
|
//备份老的日志文件
|
||||||
if err == nil {
|
if err == nil {
|
||||||
|
@ -45,7 +45,7 @@ type Logger struct {
|
|||||||
formatter Formatter //日志格式化
|
formatter Formatter //日志格式化
|
||||||
name string //日志标签
|
name string //日志标签
|
||||||
out IWrite //日志输出
|
out IWrite //日志输出
|
||||||
addCaller bool //是否打印堆栈信息
|
addCaller LevelEnabler //是否打印堆栈信息
|
||||||
addStack LevelEnabler //堆栈信息输出级别
|
addStack LevelEnabler //堆栈信息输出级别
|
||||||
callerSkip int //堆栈输出深度
|
callerSkip int //堆栈输出深度
|
||||||
}
|
}
|
||||||
@ -167,7 +167,8 @@ func (this *Logger) check(level Loglevel, msg string, args ...Field) (entry *Ent
|
|||||||
entry.Message = msg
|
entry.Message = msg
|
||||||
entry.WithFields(args...)
|
entry.WithFields(args...)
|
||||||
addStack := this.addStack.Enabled(level)
|
addStack := this.addStack.Enabled(level)
|
||||||
if !this.addCaller && !addStack {
|
addCaller := this.addCaller.Enabled(level)
|
||||||
|
if !addCaller && !addStack {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
stackDepth := stacktraceFirst
|
stackDepth := stacktraceFirst
|
||||||
@ -177,7 +178,7 @@ func (this *Logger) check(level Loglevel, msg string, args ...Field) (entry *Ent
|
|||||||
stack := captureStacktrace(this.callerSkip+callerSkipOffset, stackDepth)
|
stack := captureStacktrace(this.callerSkip+callerSkipOffset, stackDepth)
|
||||||
defer stack.Free()
|
defer stack.Free()
|
||||||
if stack.Count() == 0 {
|
if stack.Count() == 0 {
|
||||||
if this.addCaller {
|
if addCaller {
|
||||||
if entry.Err != "" {
|
if entry.Err != "" {
|
||||||
entry.Err = entry.Err + ",error: failed to get caller"
|
entry.Err = entry.Err + ",error: failed to get caller"
|
||||||
} else {
|
} else {
|
||||||
@ -187,7 +188,7 @@ func (this *Logger) check(level Loglevel, msg string, args ...Field) (entry *Ent
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
frame, more := stack.Next()
|
frame, more := stack.Next()
|
||||||
if this.addCaller {
|
if addCaller {
|
||||||
entry.Caller.Defined = frame.PC != 0
|
entry.Caller.Defined = frame.PC != 0
|
||||||
entry.Caller.PC = frame.PC
|
entry.Caller.PC = frame.PC
|
||||||
entry.Caller.File = frame.File
|
entry.Caller.File = frame.File
|
||||||
|
@ -18,7 +18,7 @@ type Options struct {
|
|||||||
FileName string //日志文件名包含
|
FileName string //日志文件名包含
|
||||||
Loglevel Loglevel //日志输出级别
|
Loglevel Loglevel //日志输出级别
|
||||||
IsDebug bool //是否是开发模式
|
IsDebug bool //是否是开发模式
|
||||||
ReportCaller bool //是否输出堆栈信息
|
ReportCaller Loglevel //是否输出堆栈信息
|
||||||
CallerSkip int //堆栈深度
|
CallerSkip int //堆栈深度
|
||||||
Encoder LogEncoder //日志输出样式
|
Encoder LogEncoder //日志输出样式
|
||||||
CupTimeTime int //日志分割时间 单位 小时
|
CupTimeTime int //日志分割时间 单位 小时
|
||||||
@ -48,7 +48,7 @@ func SetLoglevel(v Loglevel) Option {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetReportCaller(v bool) Option {
|
func SetReportCaller(v Loglevel) Option {
|
||||||
return func(o *Options) {
|
return func(o *Options) {
|
||||||
o.ReportCaller = v
|
o.ReportCaller = v
|
||||||
}
|
}
|
||||||
@ -102,8 +102,8 @@ func newOptions(config map[string]interface{}, opts ...Option) (options *Options
|
|||||||
MaxBackups: 250,
|
MaxBackups: 250,
|
||||||
Compress: false,
|
Compress: false,
|
||||||
Encoder: TextEncoder,
|
Encoder: TextEncoder,
|
||||||
CallerSkip: 0,
|
CallerSkip: 3,
|
||||||
ReportCaller: false,
|
ReportCaller: ErrorLevel,
|
||||||
IsDebug: true,
|
IsDebug: true,
|
||||||
}
|
}
|
||||||
if config != nil {
|
if config != nil {
|
||||||
@ -128,8 +128,8 @@ func newOptionsByOption(opts ...Option) (options *Options, err error) {
|
|||||||
MaxBackups: 250,
|
MaxBackups: 250,
|
||||||
Compress: false,
|
Compress: false,
|
||||||
Encoder: TextEncoder,
|
Encoder: TextEncoder,
|
||||||
CallerSkip: 0,
|
CallerSkip: 3,
|
||||||
ReportCaller: false,
|
ReportCaller: ErrorLevel,
|
||||||
IsDebug: true,
|
IsDebug: true,
|
||||||
}
|
}
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
|
@ -22,29 +22,33 @@ func newClient(options *Options) (sys *Client, err error) {
|
|||||||
sys = &Client{
|
sys = &Client{
|
||||||
options: options,
|
options: options,
|
||||||
metadata: fmt.Sprintf("stag=%s&stype=%s&sid=%s&version=%s&addr=%s", options.ServiceTag, options.ServiceType, options.ServiceId, options.ServiceVersion, "tcp@"+options.ServiceAddr),
|
metadata: fmt.Sprintf("stag=%s&stype=%s&sid=%s&version=%s&addr=%s", options.ServiceTag, options.ServiceType, options.ServiceId, options.ServiceVersion, "tcp@"+options.ServiceAddr),
|
||||||
clusterClients: make(map[string]map[string]client.XClient),
|
clusterClients: make(map[string]*clusterClients),
|
||||||
conns: make(map[string]net.Conn),
|
conns: make(map[string]net.Conn),
|
||||||
connecting: make(map[string]struct{}),
|
|
||||||
serviceMap: make(map[string]*service),
|
serviceMap: make(map[string]*service),
|
||||||
msgChan: make(chan *protocol.Message, 1000),
|
msgChan: make(chan *protocol.Message, 1000),
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type clusterClients struct {
|
||||||
|
Mu sync.RWMutex
|
||||||
|
clients map[string]client.XClient //其他集群客户端
|
||||||
|
}
|
||||||
|
|
||||||
type Client struct {
|
type Client struct {
|
||||||
options *Options
|
options *Options
|
||||||
metadata string
|
metadata string
|
||||||
writeTimeout time.Duration
|
writeTimeout time.Duration
|
||||||
AsyncWrite bool
|
AsyncWrite bool
|
||||||
clusterMu sync.RWMutex
|
clusterMu sync.RWMutex
|
||||||
clusterClients map[string]map[string]client.XClient //其他集群客户端
|
clusterClients map[string]*clusterClients //其他集群客户端
|
||||||
connsMapMu sync.RWMutex
|
connsMapMu sync.RWMutex
|
||||||
conns map[string]net.Conn
|
conns map[string]net.Conn
|
||||||
connectMapMu sync.RWMutex
|
// connectMapMu sync.RWMutex
|
||||||
connecting map[string]struct{}
|
// connecting map[string]struct{}
|
||||||
serviceMapMu sync.RWMutex
|
serviceMapMu sync.RWMutex
|
||||||
serviceMap map[string]*service
|
serviceMap map[string]*service
|
||||||
msgChan chan *protocol.Message // 接收rpcXServer推送消息
|
msgChan chan *protocol.Message // 接收rpcXServer推送消息
|
||||||
}
|
}
|
||||||
|
|
||||||
// DoMessage 服务端消息处理
|
// DoMessage 服务端消息处理
|
||||||
@ -78,11 +82,15 @@ func (this *Client) Start() (err error) {
|
|||||||
|
|
||||||
//停止RPC 服务
|
//停止RPC 服务
|
||||||
func (this *Client) Stop() (err error) {
|
func (this *Client) Stop() (err error) {
|
||||||
|
this.clusterMu.Lock()
|
||||||
for _, v := range this.clusterClients {
|
for _, v := range this.clusterClients {
|
||||||
for _, v1 := range v {
|
v.Mu.Lock()
|
||||||
|
for _, v1 := range v.clients {
|
||||||
v1.Close()
|
v1.Close()
|
||||||
}
|
}
|
||||||
|
v.Mu.Unlock()
|
||||||
}
|
}
|
||||||
|
this.clusterMu.RUnlock()
|
||||||
close(this.msgChan) //关闭消息处理
|
close(this.msgChan) //关闭消息处理
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -210,12 +218,15 @@ func (this *Client) ClusterBroadcast(ctx context.Context, servicePath string, se
|
|||||||
ServiceMetaKey: this.metadata,
|
ServiceMetaKey: this.metadata,
|
||||||
})
|
})
|
||||||
clients = make([]client.XClient, 0)
|
clients = make([]client.XClient, 0)
|
||||||
|
this.clusterMu.RLock()
|
||||||
for _, v := range this.clusterClients {
|
for _, v := range this.clusterClients {
|
||||||
if _client, ok := v[spath[0]]; ok {
|
v.Mu.RLock()
|
||||||
|
if _client, ok := v.clients[spath[0]]; ok {
|
||||||
clients = append(clients, _client)
|
clients = append(clients, _client)
|
||||||
}
|
}
|
||||||
|
v.Mu.RUnlock()
|
||||||
}
|
}
|
||||||
|
this.clusterMu.RUnlock()
|
||||||
l := len(clients)
|
l := len(clients)
|
||||||
done := make(chan error, l)
|
done := make(chan error, l)
|
||||||
for _, v := range clients {
|
for _, v := range clients {
|
||||||
@ -244,32 +255,55 @@ check:
|
|||||||
//监控服务发现,发现没有连接上的额服务端 就连接上去
|
//监控服务发现,发现没有连接上的额服务端 就连接上去
|
||||||
func (this *Client) UpdateServer(servers map[string]*ServiceNode) {
|
func (this *Client) UpdateServer(servers map[string]*ServiceNode) {
|
||||||
for _, v := range servers {
|
for _, v := range servers {
|
||||||
this.connsMapMu.RLock()
|
this.clusterMu.RLock()
|
||||||
_, ok := this.conns[v.ServiceAddr]
|
cluster, ok := this.clusterClients[v.ServiceTag]
|
||||||
this.connsMapMu.RUnlock()
|
this.clusterMu.RUnlock()
|
||||||
if !ok {
|
if ok {
|
||||||
this.connectMapMu.RLock()
|
cluster.Mu.RLock()
|
||||||
_, ok := this.connecting[v.ServiceAddr]
|
_, ok = cluster.clients[v.ServiceType]
|
||||||
this.connectMapMu.RUnlock()
|
cluster.Mu.RUnlock()
|
||||||
if !ok {
|
if ok {
|
||||||
this.connectMapMu.Lock()
|
continue
|
||||||
this.connecting[v.ServiceAddr] = struct{}{}
|
|
||||||
this.connectMapMu.Unlock()
|
|
||||||
if err := this.Call(context.Background(), fmt.Sprintf("%s/%s", v.ServiceType, v.ServiceId), RpcX_ShakeHands, &ServiceNode{
|
|
||||||
ServiceTag: this.options.ServiceTag,
|
|
||||||
ServiceId: this.options.ServiceId,
|
|
||||||
ServiceType: this.options.ServiceType,
|
|
||||||
ServiceAddr: this.options.ServiceAddr},
|
|
||||||
&ServiceNode{}); err != nil {
|
|
||||||
this.options.Log.Errorf("ShakeHands new node addr:%s err:%v", v.ServiceAddr, err)
|
|
||||||
this.connectMapMu.Lock()
|
|
||||||
delete(this.connecting, v.ServiceAddr)
|
|
||||||
this.connectMapMu.Unlock()
|
|
||||||
} else {
|
|
||||||
this.options.Log.Debugf("UpdateServer addr:%s ", v.ServiceAddr)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//没有建立客户端 主动发起握手
|
||||||
|
if err := this.Call(context.Background(), fmt.Sprintf("%s/%s", v.ServiceType, v.ServiceId), RpcX_ShakeHands, &ServiceNode{
|
||||||
|
ServiceTag: this.options.ServiceTag,
|
||||||
|
ServiceId: this.options.ServiceId,
|
||||||
|
ServiceType: this.options.ServiceType,
|
||||||
|
ServiceAddr: this.options.ServiceAddr},
|
||||||
|
&ServiceNode{}); err != nil {
|
||||||
|
this.options.Log.Errorf("ShakeHands new node addr:%s err:%v", v.ServiceAddr, err)
|
||||||
|
} else {
|
||||||
|
this.options.Log.Debugf("UpdateServer addr:%s ", v.ServiceAddr)
|
||||||
|
}
|
||||||
|
|
||||||
|
// this.connsMapMu.RLock()
|
||||||
|
// _, ok := this.conns[v.ServiceAddr]
|
||||||
|
// this.connsMapMu.RUnlock()
|
||||||
|
// if !ok {
|
||||||
|
// this.connectMapMu.RLock()
|
||||||
|
// _, ok := this.connecting[v.ServiceAddr]
|
||||||
|
// this.connectMapMu.RUnlock()
|
||||||
|
// if !ok {
|
||||||
|
// this.connectMapMu.Lock()
|
||||||
|
// this.connecting[v.ServiceAddr] = struct{}{}
|
||||||
|
// this.connectMapMu.Unlock()
|
||||||
|
// if err := this.Call(context.Background(), fmt.Sprintf("%s/%s", v.ServiceType, v.ServiceId), RpcX_ShakeHands, &ServiceNode{
|
||||||
|
// ServiceTag: this.options.ServiceTag,
|
||||||
|
// ServiceId: this.options.ServiceId,
|
||||||
|
// ServiceType: this.options.ServiceType,
|
||||||
|
// ServiceAddr: this.options.ServiceAddr},
|
||||||
|
// &ServiceNode{}); err != nil {
|
||||||
|
// this.options.Log.Errorf("ShakeHands new node addr:%s err:%v", v.ServiceAddr, err)
|
||||||
|
// this.connectMapMu.Lock()
|
||||||
|
// delete(this.connecting, v.ServiceAddr)
|
||||||
|
// this.connectMapMu.Unlock()
|
||||||
|
// } else {
|
||||||
|
// this.options.Log.Debugf("UpdateServer addr:%s ", v.ServiceAddr)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -301,29 +335,39 @@ func (this *Client) getclient(ctx *context.Context, clusterTag string, servicePa
|
|||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
spath []string
|
spath []string
|
||||||
clients map[string]client.XClient
|
cluster *clusterClients
|
||||||
d *client.ConsulDiscovery
|
d *client.ConsulDiscovery
|
||||||
ok bool
|
ok bool
|
||||||
)
|
)
|
||||||
spath = strings.Split(servicePath, "/")
|
spath = strings.Split(servicePath, "/")
|
||||||
if clients, ok = this.clusterClients[clusterTag]; !ok {
|
this.clusterMu.RLock()
|
||||||
this.clusterClients[clusterTag] = make(map[string]client.XClient)
|
cluster, ok = this.clusterClients[clusterTag]
|
||||||
clients = this.clusterClients[clusterTag]
|
this.clusterMu.RUnlock()
|
||||||
|
if !ok {
|
||||||
|
cluster = &clusterClients{clients: make(map[string]client.XClient)}
|
||||||
|
this.clusterMu.Lock()
|
||||||
|
this.clusterClients[clusterTag] = cluster
|
||||||
|
this.clusterMu.Unlock()
|
||||||
}
|
}
|
||||||
|
cluster.Mu.RLock()
|
||||||
if c, ok = clients[spath[0]]; !ok {
|
c, ok = cluster.clients[spath[0]]
|
||||||
|
cluster.Mu.RUnlock()
|
||||||
|
if !ok {
|
||||||
if d, err = client.NewConsulDiscovery(clusterTag, spath[0], this.options.ConsulServers, nil); err != nil {
|
if d, err = client.NewConsulDiscovery(clusterTag, spath[0], this.options.ConsulServers, nil); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
c = client.NewBidirectionalXClient(spath[0], client.Failfast, client.RandomSelect, d, client.DefaultOption, this.msgChan)
|
c = client.NewBidirectionalXClient(spath[0], client.Failfast, client.RandomSelect, d, client.DefaultOption, this.msgChan)
|
||||||
|
cluster.Mu.Lock()
|
||||||
|
cluster.clients[spath[0]] = c
|
||||||
|
cluster.Mu.Unlock()
|
||||||
c.GetPlugins().Add(this)
|
c.GetPlugins().Add(this)
|
||||||
if this.options.RpcxStartType == RpcxStartByClient && this.options.AutoConnect {
|
if this.options.RpcxStartType == RpcxStartByClient && this.options.AutoConnect {
|
||||||
c.SetSelector(newSelector(this.UpdateServer))
|
c.SetSelector(newSelector(this.options.Log, clusterTag, this.UpdateServer))
|
||||||
} else {
|
} else {
|
||||||
c.SetSelector(newSelector(nil))
|
c.SetSelector(newSelector(this.options.Log, clusterTag, nil))
|
||||||
}
|
}
|
||||||
clients[spath[0]] = c
|
|
||||||
}
|
}
|
||||||
|
|
||||||
*ctx = context.WithValue(*ctx, share.ReqMetaDataKey, map[string]string{
|
*ctx = context.WithValue(*ctx, share.ReqMetaDataKey, map[string]string{
|
||||||
ServiceClusterTag: this.options.ServiceTag,
|
ServiceClusterTag: this.options.ServiceTag,
|
||||||
CallRoutRulesKey: servicePath,
|
CallRoutRulesKey: servicePath,
|
||||||
|
@ -98,7 +98,9 @@ func AcrossClusterCall(ctx context.Context, clusterTag string, servicePath strin
|
|||||||
func AcrossClusterGo(ctx context.Context, clusterTag, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (_call *client.Call, err error) {
|
func AcrossClusterGo(ctx context.Context, clusterTag, servicePath string, serviceMethod string, args interface{}, reply interface{}, done chan *client.Call) (_call *client.Call, err error) {
|
||||||
return defsys.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
return defsys.AcrossClusterGo(ctx, clusterTag, servicePath, serviceMethod, args, reply, done)
|
||||||
}
|
}
|
||||||
|
func AcrossClusterBroadcast(ctx context.Context, clusterTag string, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
|
return defsys.AcrossClusterBroadcast(ctx, clusterTag, servicePath, serviceMethod, args, reply)
|
||||||
|
}
|
||||||
func ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
func ClusterBroadcast(ctx context.Context, servicePath string, serviceMethod string, args interface{}, reply interface{}) (err error) {
|
||||||
return defsys.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
return defsys.ClusterBroadcast(ctx, servicePath, serviceMethod, args, reply)
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ func newOptions(config map[string]interface{}, opts ...Option) (options *Options
|
|||||||
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
|
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil {
|
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 3)); options.Log == nil {
|
||||||
err = errors.New("log is nil")
|
err = errors.New("log is nil")
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ func newOptionsByOption(opts ...Option) (options *Options, err error) {
|
|||||||
if len(options.ServiceTag) == 0 || len(options.ServiceType) == 0 || len(options.ServiceId) == 0 || len(options.ConsulServers) == 0 {
|
if len(options.ServiceTag) == 0 || len(options.ServiceType) == 0 || len(options.ServiceId) == 0 || len(options.ConsulServers) == 0 {
|
||||||
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
|
return options, errors.New("[Sys.RPCX] newOptions err: 启动参数异常")
|
||||||
}
|
}
|
||||||
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 2)); options.Log == nil {
|
if options.Log = log.NewTurnlog(options.Debug, log.Clone("sys.rpc", 3)); options.Log == nil {
|
||||||
err = errors.New("log is nil")
|
err = errors.New("log is nil")
|
||||||
}
|
}
|
||||||
return options, nil
|
return options, nil
|
||||||
|
@ -14,8 +14,10 @@ var rex_nogather = regexp.MustCompile(`\!\[([^)]+)\]`)
|
|||||||
var rex_noid = regexp.MustCompile(`\!([^)]+)`)
|
var rex_noid = regexp.MustCompile(`\!([^)]+)`)
|
||||||
var rex_gather = regexp.MustCompile(`\[([^)]+)\]`)
|
var rex_gather = regexp.MustCompile(`\[([^)]+)\]`)
|
||||||
|
|
||||||
func newSelector(fn func(map[string]*ServiceNode)) *Selector {
|
func newSelector(log log.ILogger, stag string, fn func(map[string]*ServiceNode)) *Selector {
|
||||||
return &Selector{
|
return &Selector{
|
||||||
|
log: log,
|
||||||
|
stag: stag,
|
||||||
updateServerEvent: fn,
|
updateServerEvent: fn,
|
||||||
servers: make(map[string]*ServiceNode),
|
servers: make(map[string]*ServiceNode),
|
||||||
serversType: make(map[string][]*ServiceNode),
|
serversType: make(map[string][]*ServiceNode),
|
||||||
@ -32,6 +34,8 @@ type ServiceNode struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Selector struct {
|
type Selector struct {
|
||||||
|
log log.ILogger
|
||||||
|
stag string
|
||||||
updateServerEvent func(map[string]*ServiceNode)
|
updateServerEvent func(map[string]*ServiceNode)
|
||||||
servers map[string]*ServiceNode
|
servers map[string]*ServiceNode
|
||||||
serversType map[string][]*ServiceNode
|
serversType map[string][]*ServiceNode
|
||||||
@ -56,7 +60,7 @@ func (this *Selector) Select(ctx context.Context, servicePath, serviceMethod str
|
|||||||
} else if leng == 2 {
|
} else if leng == 2 {
|
||||||
result := this.ParseRoutRules(service[1])
|
result := this.ParseRoutRules(service[1])
|
||||||
if len(result) == 0 {
|
if len(result) == 0 {
|
||||||
log.Errorf("Select no found any node servicePath:%v serviceMethod:%v RoutRules:%v \n", servicePath, serviceMethod, routrules)
|
this.log.Error("Select no found any node", log.Field{"stag", this.stag}, log.Field{"servicePath", servicePath}, log.Field{"serviceMethod", serviceMethod}, log.Field{"routrules", routrules})
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
i := fastrand.Uint32n(uint32(len(result)))
|
i := fastrand.Uint32n(uint32(len(result)))
|
||||||
@ -64,7 +68,7 @@ func (this *Selector) Select(ctx context.Context, servicePath, serviceMethod str
|
|||||||
return node.ServiceAddr
|
return node.ServiceAddr
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Errorf("Select no found any node servicePath:%v serviceMethod:%v RoutRules:%v \n", servicePath, serviceMethod, routrules)
|
this.log.Error("Select no found any node", log.Field{"stag", this.stag}, log.Field{"servicePath", servicePath}, log.Field{"serviceMethod", serviceMethod}, log.Field{"routrules", routrules})
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +90,7 @@ func (this *Selector) UpdateServer(servers map[string]string) {
|
|||||||
sst := make(map[string][]*ServiceNode)
|
sst := make(map[string][]*ServiceNode)
|
||||||
for _, v := range servers {
|
for _, v := range servers {
|
||||||
if node, err := smetaToServiceNode(v); err != nil {
|
if node, err := smetaToServiceNode(v); err != nil {
|
||||||
log.Errorf("smetaToServiceNode:%s err:%v", v, err)
|
this.log.Errorf("smetaToServiceNode:%s err:%v", v, err)
|
||||||
continue
|
continue
|
||||||
} else {
|
} else {
|
||||||
ss[node.ServiceId] = node
|
ss[node.ServiceId] = node
|
||||||
|
@ -223,7 +223,7 @@ func (this *Service) PostReadRequest(ctx context.Context, r *protocol.Message, e
|
|||||||
selector, ok = this.selectors[stag]
|
selector, ok = this.selectors[stag]
|
||||||
this.selectormutex.RUnlock()
|
this.selectormutex.RUnlock()
|
||||||
if !ok {
|
if !ok {
|
||||||
selector = newSelector(nil)
|
selector = newSelector(this.options.Log, stag, nil)
|
||||||
this.selectormutex.Lock()
|
this.selectormutex.Lock()
|
||||||
this.selectors[stag] = selector
|
this.selectors[stag] = selector
|
||||||
this.selectormutex.Unlock()
|
this.selectormutex.Unlock()
|
||||||
|
38
lego/utils/codec/json/json_test.go
Normal file
38
lego/utils/codec/json/json_test.go
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package json_test
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"go_dreamfactory/lego/utils/codec/json"
|
||||||
|
"testing"
|
||||||
|
)
|
||||||
|
|
||||||
|
type TestData struct {
|
||||||
|
Name string
|
||||||
|
Age int
|
||||||
|
List []string
|
||||||
|
Map map[string]interface{}
|
||||||
|
}
|
||||||
|
|
||||||
|
//测试api_getlist
|
||||||
|
func Test_Json_Write(t *testing.T) {
|
||||||
|
ret, err := json.MarshalMap(&TestData{
|
||||||
|
Name: "liwei",
|
||||||
|
Age: 10,
|
||||||
|
List: []string{"123", "456", "789"},
|
||||||
|
Map: map[string]interface{}{
|
||||||
|
"aa": 123,
|
||||||
|
"b": "123123",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
fmt.Printf("ret:%v err:%v", ret, err)
|
||||||
|
ret, err = json.MarshalMap(&TestData{
|
||||||
|
Name: "asdasd",
|
||||||
|
Age: 10,
|
||||||
|
List: []string{"12asd3", "45sdaa6", "asdasd"},
|
||||||
|
Map: map[string]interface{}{
|
||||||
|
"asd": 586,
|
||||||
|
"asdasd": "asd1231",
|
||||||
|
},
|
||||||
|
})
|
||||||
|
fmt.Printf("ret:%v err:%v", ret, err)
|
||||||
|
}
|
@ -9,25 +9,28 @@ import (
|
|||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ChatGetListReq) (code pb.ErrorCode) {
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ChatGetListReq) (code pb.ErrorCode) {
|
||||||
|
if req.Channel == pb.ChatChannel_World && req.ChannelId == 0 {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///获取本服聊天消息记录
|
///获取本服聊天消息记录
|
||||||
func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
list []*pb.DBChat
|
result *pb.DBUserExpand
|
||||||
|
list []*pb.DBChat
|
||||||
)
|
)
|
||||||
switch req.Channel {
|
switch req.Channel {
|
||||||
case pb.ChatChannel_World:
|
case pb.ChatChannel_World:
|
||||||
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0, 0); err != nil {
|
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case pb.ChatChannel_Union:
|
case pb.ChatChannel_Union:
|
||||||
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0, 0); err != nil {
|
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -38,6 +41,26 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.ChatGetListReq)
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case pb.ChatChannel_CrossServer:
|
||||||
|
if result, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil {
|
||||||
|
this.module.Errorf("err:%v", err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if req.ChannelId != result.Chatchannel {
|
||||||
|
code = pb.ErrorCode_ReqParameterError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, req.ChannelId); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
break
|
||||||
|
case pb.ChatChannel_System:
|
||||||
|
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
break
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ChatGetListResp{Chats: list})
|
session.SendMsg(string(this.module.GetType()), "getlist", &pb.ChatGetListResp{Chats: list})
|
||||||
return
|
return
|
||||||
|
@ -21,26 +21,22 @@ func (this *apiComp) SendCheck(session comm.IUserSession, req *pb.ChatSendReq) (
|
|||||||
///消息发送请求
|
///消息发送请求
|
||||||
func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
max int32
|
max int32
|
||||||
msg *pb.DBChat
|
msg *pb.DBChat
|
||||||
user *pb.DBUser
|
userexpand *pb.DBUserExpand
|
||||||
max_chat int32
|
max_chat int32
|
||||||
)
|
)
|
||||||
if code = this.SendCheck(session, req); code != pb.ErrorCode_Success {
|
if code = this.SendCheck(session, req); code != pb.ErrorCode_Success {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if user = this.module.ModuleUser.GetUser(session.GetUserId()); user == nil {
|
|
||||||
this.module.Errorf("GetUser is nill")
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg = &pb.DBChat{
|
msg = &pb.DBChat{
|
||||||
Id: primitive.NewObjectID().Hex(),
|
Id: primitive.NewObjectID().Hex(),
|
||||||
Channel: req.Channel,
|
Channel: req.Channel,
|
||||||
Suid: session.GetUserId(),
|
Suid: session.GetUserId(),
|
||||||
Avatar: user.Avatar,
|
Stag: session.GetServiecTag(),
|
||||||
|
Avatar: req.Avatar,
|
||||||
Content: req.Content,
|
Content: req.Content,
|
||||||
Ctime: time.Now().Unix(),
|
Ctime: time.Now().Unix(),
|
||||||
}
|
}
|
||||||
@ -54,7 +50,7 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
|
|||||||
}
|
}
|
||||||
switch msg.Channel {
|
switch msg.Channel {
|
||||||
case pb.ChatChannel_World:
|
case pb.ChatChannel_World:
|
||||||
if err = this.module.modelChat.addChatMsg(worldchatkey, int64(max), msg); err != nil {
|
if err = this.module.modelChat.addChatMsg(fmt.Sprintf("%s-%s", worldchatkey, session.GetServiecTag()), int64(max), msg); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -81,6 +77,18 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
case pb.ChatChannel_CrossServer:
|
||||||
|
if userexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
msg.ChannelId = userexpand.Chatchannel //指定频道
|
||||||
|
if err = this.module.modelChat.addChatMsg(fmt.Sprintf("%s:%d", crosschatkey, userexpand.Chatchannel), int64(max_chat), msg); err != nil {
|
||||||
|
code = pb.ErrorCode_DBError
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.module.PushToUsers(userexpand.Chatchannel, msg)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
session.SendMsg(string(this.module.GetType()), "send", &pb.ChatSendResp{})
|
session.SendMsg(string(this.module.GetType()), "send", &pb.ChatSendResp{})
|
||||||
return
|
return
|
||||||
|
@ -1,52 +0,0 @@
|
|||||||
package chat
|
|
||||||
|
|
||||||
import (
|
|
||||||
"go_dreamfactory/comm"
|
|
||||||
"go_dreamfactory/pb"
|
|
||||||
|
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
)
|
|
||||||
|
|
||||||
//参数校验
|
|
||||||
func (this *apiComp) SpanGetListCheck(session comm.IUserSession, req *pb.ChatSpanGetListReq) (code pb.ErrorCode) {
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
///获取跨服聊天消息记录
|
|
||||||
func (this *apiComp) SpanGetList(session comm.IUserSession, req *pb.ChatSpanGetListReq) (code pb.ErrorCode, data proto.Message) {
|
|
||||||
var (
|
|
||||||
err error
|
|
||||||
result *pb.DBUserExpand
|
|
||||||
list []*pb.DBChat
|
|
||||||
group int32
|
|
||||||
)
|
|
||||||
if result, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil {
|
|
||||||
this.module.Errorf("err:%v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if req.ChannelId != result.Chatchannel {
|
|
||||||
code = pb.ErrorCode_ReqParameterError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if group, err = this.module.configure.GetServiecTagGroup(session.GetServiecTag()); err != nil {
|
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
|
||||||
return
|
|
||||||
}
|
|
||||||
switch req.Channel {
|
|
||||||
case pb.ChatChannel_CrossServer:
|
|
||||||
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, group, req.ChannelId); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
break
|
|
||||||
case pb.ChatChannel_System:
|
|
||||||
if list, err = this.module.modelChat.GetChatQueue(req.Channel, 0, 0, 0); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
break
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.module.GetType()), "spangetlist", &pb.ChatSpanGetListResp{Chats: list})
|
|
||||||
return
|
|
||||||
}
|
|
@ -1,60 +0,0 @@
|
|||||||
package chat
|
|
||||||
|
|
||||||
import (
|
|
||||||
"fmt"
|
|
||||||
"go_dreamfactory/comm"
|
|
||||||
"go_dreamfactory/pb"
|
|
||||||
"time"
|
|
||||||
|
|
||||||
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
||||||
"google.golang.org/protobuf/proto"
|
|
||||||
)
|
|
||||||
|
|
||||||
//参数校验
|
|
||||||
func (this *apiComp) SpanSendCheck(session comm.IUserSession, req *pb.ChatSpanSendReq) (code pb.ErrorCode) {
|
|
||||||
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
///跨越服务消息请求
|
|
||||||
func (this *apiComp) SpanSend(session comm.IUserSession, req *pb.ChatSpanSendReq) (code pb.ErrorCode, data proto.Message) {
|
|
||||||
var (
|
|
||||||
err error
|
|
||||||
msg *pb.DBChat
|
|
||||||
user *pb.DBUser
|
|
||||||
userexpand *pb.DBUserExpand
|
|
||||||
group int32
|
|
||||||
max_chat int32
|
|
||||||
)
|
|
||||||
if userexpand, err = this.module.ModuleUser.GetUserExpand(session.GetUserId()); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
msg = &pb.DBChat{
|
|
||||||
Id: primitive.NewObjectID().Hex(),
|
|
||||||
Channel: req.Channel,
|
|
||||||
Suid: session.GetUserId(),
|
|
||||||
AreaId: userexpand.Chatchannel,
|
|
||||||
Avatar: user.Avatar,
|
|
||||||
Content: req.Content,
|
|
||||||
Ctime: time.Now().Unix(),
|
|
||||||
}
|
|
||||||
if group, err = this.module.configure.GetServiecTagGroup(session.GetServiecTag()); err != nil {
|
|
||||||
code = pb.ErrorCode_ConfigNoFound
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if max_chat, err = this.module.configure.GetChannelRecordMax(); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
switch msg.Channel {
|
|
||||||
case pb.ChatChannel_CrossServer:
|
|
||||||
if err = this.module.modelChat.addChatMsg(fmt.Sprintf("%s:%d--%d", crosschatkey, group, userexpand.Chatchannel), int64(max_chat), msg); err != nil {
|
|
||||||
code = pb.ErrorCode_DBError
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.module.PushToUsers(group, userexpand.Chatchannel, msg)
|
|
||||||
break
|
|
||||||
}
|
|
||||||
session.SendMsg(string(this.module.GetType()), "spansend", &pb.ChatSendResp{})
|
|
||||||
return
|
|
||||||
}
|
|
@ -27,29 +27,8 @@ func (this *configureComp) Init(service core.IService, module core.IModule, comp
|
|||||||
this.module = module.(*Chat)
|
this.module = module.(*Chat)
|
||||||
this.LoadConfigure(game_chatchannel, cfg.NewGame_chatChannel)
|
this.LoadConfigure(game_chatchannel, cfg.NewGame_chatChannel)
|
||||||
this.LoadConfigure(game_chatsystem, cfg.NewGame_chatSystem)
|
this.LoadConfigure(game_chatsystem, cfg.NewGame_chatSystem)
|
||||||
this.LoadConfigure(game_chatservergroup, cfg.NewGame_chatServerGroup)
|
|
||||||
this.LoadConfigure(game_chatchannelcom, cfg.NewGame_chatChannelCom)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取服务区 分组
|
this.LoadConfigure(game_chatchannelcom, cfg.NewGame_chatChannelCom)
|
||||||
func (this *configureComp) GetServiecTagGroup(stag string) (group int32, err error) {
|
|
||||||
var (
|
|
||||||
v interface{}
|
|
||||||
configure *cfg.Game_chatServerGroupData
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
if v, err = this.GetConfigure(game_chatservergroup); err != nil {
|
|
||||||
this.module.Errorf("err:%v", err)
|
|
||||||
return
|
|
||||||
} else {
|
|
||||||
if configure, ok = v.(*cfg.Game_chatServerGroup).GetDataMap()[stag]; !ok {
|
|
||||||
err = fmt.Errorf("cfg.Game_chatServerGroupData on found %v", stag)
|
|
||||||
this.module.Errorf("err:%v", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
group = configure.Group
|
|
||||||
}
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ func (this *modelChatComp) QueryUserMsg(uid string) (result []*pb.DBChat, err er
|
|||||||
}
|
}
|
||||||
|
|
||||||
//查询用户未读消息
|
//查询用户未读消息
|
||||||
func (this *modelChatComp) GetChatQueue(channel pb.ChatChannel, union, group, area int32) (result []*pb.DBChat, err error) {
|
func (this *modelChatComp) GetChatQueue(channel pb.ChatChannel, union, area int32) (result []*pb.DBChat, err error) {
|
||||||
var (
|
var (
|
||||||
key string
|
key string
|
||||||
find bson.M
|
find bson.M
|
||||||
@ -82,8 +82,8 @@ func (this *modelChatComp) GetChatQueue(channel pb.ChatChannel, union, group, ar
|
|||||||
find = bson.M{"channel": channel, "unionId": union}
|
find = bson.M{"channel": channel, "unionId": union}
|
||||||
break
|
break
|
||||||
case pb.ChatChannel_CrossServer:
|
case pb.ChatChannel_CrossServer:
|
||||||
key = fmt.Sprintf("%s:%d--%d", crosschatkey, group, area)
|
key = fmt.Sprintf("%s:%d", crosschatkey, area)
|
||||||
find = bson.M{"channel": channel, "group": group, "areaId": area}
|
find = bson.M{"channel": channel, "areaId": area}
|
||||||
break
|
break
|
||||||
case pb.ChatChannel_System:
|
case pb.ChatChannel_System:
|
||||||
key = systemchatkey
|
key = systemchatkey
|
||||||
@ -131,18 +131,14 @@ func (this *modelChatComp) AddCrossChannelMember(session comm.IUserSession) (cha
|
|||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
count int
|
count int
|
||||||
group int32
|
|
||||||
maxnum int32
|
maxnum int32
|
||||||
)
|
)
|
||||||
channel = 1
|
channel = 1
|
||||||
if group, err = this.module.configure.GetServiecTagGroup(session.GetServiecTag()); err != nil {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if maxnum, err = this.module.configure.GetAutoIntoChannelMax(); err != nil {
|
if maxnum, err = this.module.configure.GetAutoIntoChannelMax(); err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
key := fmt.Sprintf("%s:%d--%d-member", crosschatkey, group, channel)
|
key := fmt.Sprintf("%s:%d-member", crosschatkey, channel)
|
||||||
if count, err = this.Redis.Hlen(key); err != nil {
|
if count, err = this.Redis.Hlen(key); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
@ -169,13 +165,9 @@ func (this *modelChatComp) ChanageChannel(session comm.IUserSession, channel int
|
|||||||
Ip: session.GetIP(),
|
Ip: session.GetIP(),
|
||||||
}
|
}
|
||||||
var (
|
var (
|
||||||
group int32
|
|
||||||
maxnum int32
|
maxnum int32
|
||||||
)
|
)
|
||||||
if group, err = this.module.configure.GetServiecTagGroup(session.GetServiecTag()); err != nil {
|
key := fmt.Sprintf("%s:%d-member", crosschatkey, channel)
|
||||||
return
|
|
||||||
}
|
|
||||||
key := fmt.Sprintf("%s:%d--%d-member", crosschatkey, group, channel)
|
|
||||||
count := 0
|
count := 0
|
||||||
if maxnum, err = this.module.configure.GetChanageChannelMax(); err != nil {
|
if maxnum, err = this.module.configure.GetChanageChannelMax(); err != nil {
|
||||||
return
|
return
|
||||||
@ -195,8 +187,8 @@ func (this *modelChatComp) ChanageChannel(session comm.IUserSession, channel int
|
|||||||
}
|
}
|
||||||
|
|
||||||
//读取跨服聊天频道下成员
|
//读取跨服聊天频道下成员
|
||||||
func (this *modelChatComp) GetCrossChannelMember(group, channel int32) (result []*pb.CacheUser, err error) {
|
func (this *modelChatComp) GetCrossChannelMember(channel int32) (result []*pb.CacheUser, err error) {
|
||||||
key := fmt.Sprintf("%s:%d--%d-member", crosschatkey, group, channel)
|
key := fmt.Sprintf("%s:%d-member", crosschatkey, channel)
|
||||||
result = make([]*pb.CacheUser, 0)
|
result = make([]*pb.CacheUser, 0)
|
||||||
if err = this.Redis.HGetAll(key, &result); err != nil {
|
if err = this.Redis.HGetAll(key, &result); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
@ -214,11 +206,8 @@ func (this *modelChatComp) RemoveCrossChannelMember(session comm.IUserSession) (
|
|||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
var group int32
|
|
||||||
if group, err = this.module.configure.GetServiecTagGroup(session.GetServiecTag()); err != nil {
|
key := fmt.Sprintf("%s:%d-member", crosschatkey, result.Chatchannel)
|
||||||
return
|
|
||||||
}
|
|
||||||
key := fmt.Sprintf("%s:%d--%d-member", crosschatkey, group, result.Chatchannel)
|
|
||||||
if err = this.Redis.HDel(key, session.GetUserId()); err != nil {
|
if err = this.Redis.HDel(key, session.GetUserId()); err != nil {
|
||||||
this.module.Errorf("err:%v", err)
|
this.module.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
|
@ -65,16 +65,12 @@ func (this *Chat) EventUserOffline(session comm.IUserSession) {
|
|||||||
//Push--------------------------------------------------------------------------------------------------------------
|
//Push--------------------------------------------------------------------------------------------------------------
|
||||||
//推送消息到世界
|
//推送消息到世界
|
||||||
func (this *Chat) PushWorld(msg *pb.DBChat) (err error) {
|
func (this *Chat) PushWorld(msg *pb.DBChat) (err error) {
|
||||||
var (
|
|
||||||
reply *pb.RPCMessageReply
|
|
||||||
)
|
|
||||||
reply = &pb.RPCMessageReply{}
|
|
||||||
data, _ := anypb.New(&pb.ChatMessagePush{Chat: msg})
|
data, _ := anypb.New(&pb.ChatMessagePush{Chat: msg})
|
||||||
if err = this.service.RpcBroadcast(context.Background(), comm.Service_Gateway, string(comm.Rpc_GatewaySendRadioMsg), pb.UserMessage{
|
if err = this.service.AcrossClusterBroadcast(context.Background(), msg.Stag, comm.Service_Gateway, string(comm.Rpc_GatewaySendRadioMsg), pb.UserMessage{
|
||||||
MainType: string(this.GetType()),
|
MainType: string(this.GetType()),
|
||||||
SubType: "message",
|
SubType: "message",
|
||||||
Data: data,
|
Data: data,
|
||||||
}, reply); err != nil {
|
}, nil); err != nil {
|
||||||
this.Errorf("err:%v", err)
|
this.Errorf("err:%v", err)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -99,33 +95,29 @@ func (this *Chat) PushUser(msg *pb.DBChat) (err error) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//全集群推送
|
//推送消息到指定用户群
|
||||||
func (this *Chat) PushToUsers(group, channel int32, msg *pb.DBChat) {
|
func (this *Chat) PushToUsers(channel int32, msg *pb.DBChat) (err error) {
|
||||||
var (
|
var (
|
||||||
err error
|
|
||||||
users []*pb.CacheUser
|
users []*pb.CacheUser
|
||||||
)
|
)
|
||||||
if users, err = this.modelChat.GetCrossChannelMember(group, channel); err == nil {
|
if users, err = this.modelChat.GetCrossChannelMember(channel); err == nil {
|
||||||
if err = this.SendMsgToUsers(string(this.GetType()), "message", &pb.ChatMessagePush{Chat: msg}, users...); err != nil {
|
if err = this.SendMsgToUsers(string(this.GetType()), "message", &pb.ChatMessagePush{Chat: msg}, users...); err != nil {
|
||||||
this.Errorf("err:%v", err)
|
this.Errorf("err:%v", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//全集群推送
|
//全集群推送
|
||||||
func (this *Chat) PushAllWorld(msg *pb.DBChat) {
|
func (this *Chat) PushAllWorld(msg *pb.DBChat) (err error) {
|
||||||
var (
|
|
||||||
err error
|
|
||||||
reply *pb.RPCMessageReply
|
|
||||||
)
|
|
||||||
reply = &pb.RPCMessageReply{}
|
|
||||||
data, _ := anypb.New(&pb.ChatMessagePush{Chat: msg})
|
data, _ := anypb.New(&pb.ChatMessagePush{Chat: msg})
|
||||||
if err = this.service.ClusterBroadcast(context.Background(), comm.Service_Gateway, string(comm.Rpc_GatewaySendRadioMsg), pb.UserMessage{
|
if err = this.service.ClusterBroadcast(context.Background(), comm.Service_Gateway, string(comm.Rpc_GatewaySendRadioMsg), pb.UserMessage{
|
||||||
MainType: string(this.GetType()),
|
MainType: string(this.GetType()),
|
||||||
SubType: "message",
|
SubType: "message",
|
||||||
Data: data,
|
Data: data,
|
||||||
}, reply); err != nil {
|
}, nil); err != nil {
|
||||||
this.Errorf("err:%v", err)
|
this.Errorf("err:%v", err)
|
||||||
}
|
}
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ import (
|
|||||||
// 点赞
|
// 点赞
|
||||||
|
|
||||||
func (this *apiComp) ZanCheck(session comm.IUserSession, req *pb.FriendZanReq) (code pb.ErrorCode) {
|
func (this *apiComp) ZanCheck(session comm.IUserSession, req *pb.FriendZanReq) (code pb.ErrorCode) {
|
||||||
if req.FriendId == ""{
|
if req.FriendId == "" {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
@ -23,27 +23,36 @@ func (this *apiComp) Zan(session comm.IUserSession, req *pb.FriendZanReq) (code
|
|||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
self *pb.DBFriend
|
target *pb.DBFriend
|
||||||
err error
|
err error
|
||||||
|
selfId string
|
||||||
)
|
)
|
||||||
|
|
||||||
self = this.moduleFriend.modelFriend.GetFriend(session.GetUserId())
|
selfId = session.GetUserId()
|
||||||
if self == nil {
|
|
||||||
|
target = this.moduleFriend.modelFriend.GetFriend(req.FriendId)
|
||||||
|
if target == nil {
|
||||||
code = pb.ErrorCode_FriendSelfNoData
|
code = pb.ErrorCode_FriendSelfNoData
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 好友是否被点赞
|
// 不能给自己点赞
|
||||||
if _, ok := utils.Find(self.ZanIds, req.FriendId); ok {
|
if req.FriendId == selfId {
|
||||||
|
code = pb.ErrorCode_FriendZanSelf
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 是否已给好友点赞
|
||||||
|
if _, ok := utils.Find(target.ZanIds, selfId); ok {
|
||||||
code = pb.ErrorCode_FriendZaned
|
code = pb.ErrorCode_FriendZaned
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
//设置被点赞玩家
|
//设置被点赞玩家
|
||||||
self.ZanIds = append(self.ZanIds, req.FriendId)
|
target.ZanIds = append(target.ZanIds, selfId)
|
||||||
|
|
||||||
if err = this.moduleFriend.modelFriend.Change(req.FriendId, map[string]interface{}{
|
if err = this.moduleFriend.modelFriend.Change(target.GetUid(), map[string]interface{}{
|
||||||
"zanIds": self.ZanIds,
|
"zanIds": target.ZanIds,
|
||||||
}); err != nil {
|
}); err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
|
@ -43,14 +43,13 @@ func (this *AgentMgrComp) Connect(a IAgent) {
|
|||||||
func (this *AgentMgrComp) DisConnect(a IAgent) {
|
func (this *AgentMgrComp) DisConnect(a IAgent) {
|
||||||
this.agents.Delete(a.SessionId())
|
this.agents.Delete(a.SessionId())
|
||||||
if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关
|
if a.UserId() != "" { //登录用户 通知业务服务处理玩家离线相关
|
||||||
reply := &pb.RPCMessageReply{}
|
|
||||||
if _, err := this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.WorkerId()), string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{
|
if _, err := this.service.RpcGo(context.Background(), fmt.Sprintf("%s/%s", comm.Service_Worker, a.WorkerId()), string(comm.Rpc_GatewayNoticeUserClose), &pb.NoticeUserCloseReq{
|
||||||
Ip: a.IP(),
|
Ip: a.IP(),
|
||||||
ServiceTag: this.service.GetTag(),
|
ServiceTag: this.service.GetTag(),
|
||||||
GatewayServiceId: this.service.GetId(),
|
GatewayServiceId: this.service.GetId(),
|
||||||
UserSessionId: a.SessionId(),
|
UserSessionId: a.SessionId(),
|
||||||
UserId: a.UserId(),
|
UserId: a.UserId(),
|
||||||
}, reply); err != nil {
|
}, nil); err != nil {
|
||||||
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +60,7 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
|
|||||||
GatewayServiceId: this.service.GetId(),
|
GatewayServiceId: this.service.GetId(),
|
||||||
UserSessionId: a.SessionId(),
|
UserSessionId: a.SessionId(),
|
||||||
UserId: a.UserId(),
|
UserId: a.UserId(),
|
||||||
}, reply); err != nil {
|
}, nil); err != nil {
|
||||||
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
||||||
}
|
}
|
||||||
if this.options.SpanServiceTag != "" {
|
if this.options.SpanServiceTag != "" {
|
||||||
@ -72,7 +71,7 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
|
|||||||
GatewayServiceId: this.service.GetId(),
|
GatewayServiceId: this.service.GetId(),
|
||||||
UserSessionId: a.SessionId(),
|
UserSessionId: a.SessionId(),
|
||||||
UserId: a.UserId(),
|
UserId: a.UserId(),
|
||||||
}, reply); err != nil {
|
}, nil); err != nil {
|
||||||
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
log.Errorf("uId:%s Rpc_NoticeUserClose err:%v", a.UserId(), err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -82,7 +81,20 @@ func (this *AgentMgrComp) DisConnect(a IAgent) {
|
|||||||
// Bind 用户绑定Id
|
// Bind 用户绑定Id
|
||||||
func (this *AgentMgrComp) Bind(ctx context.Context, args *pb.AgentBuildReq, reply *pb.RPCMessageReply) error {
|
func (this *AgentMgrComp) Bind(ctx context.Context, args *pb.AgentBuildReq, reply *pb.RPCMessageReply) error {
|
||||||
if a, ok := this.agents.Load(args.UserSessionId); ok {
|
if a, ok := this.agents.Load(args.UserSessionId); ok {
|
||||||
a.(IAgent).Bind(args.UserId, args.WorkerId)
|
agent := a.(IAgent)
|
||||||
|
agent.Bind(args.UserId, args.WorkerId)
|
||||||
|
if this.options.SpanServiceTag != "" { //跨服集群配置存在 推送通知过去
|
||||||
|
//推送跨服集群处理
|
||||||
|
if _, err := this.service.AcrossClusterRpcGo(context.Background(), this.options.SpanServiceTag, comm.Service_Worker, string(comm.Rpc_GatewayNoticeUserLogin), &pb.NoticeUserLoginReq{
|
||||||
|
Ip: agent.IP(),
|
||||||
|
ServiceTag: this.service.GetTag(),
|
||||||
|
GatewayServiceId: this.service.GetId(),
|
||||||
|
UserSessionId: agent.SessionId(),
|
||||||
|
UserId: agent.UserId(),
|
||||||
|
}, nil); err != nil {
|
||||||
|
log.Errorf("uId:%s Rpc_NoticeUserLogin err:%v", agent.UserId(), err)
|
||||||
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
reply.Code = pb.ErrorCode_UserSessionNobeing
|
reply.Code = pb.ErrorCode_UserSessionNobeing
|
||||||
reply.ErrorMessage = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
|
reply.ErrorMessage = pb.GetErrorCodeMsg(pb.ErrorCode_UserSessionNobeing)
|
||||||
|
@ -33,7 +33,7 @@ func (this *Options) LoadConfig(settings map[string]interface{}) (err error) {
|
|||||||
err = mapstructure.Decode(settings, this)
|
err = mapstructure.Decode(settings, this)
|
||||||
}
|
}
|
||||||
|
|
||||||
if this.Log = log.NewTurnlog(this.Debug, log.Clone("", 2)); this.Log == nil {
|
if this.Log = log.NewTurnlog(this.Debug, log.Clone("", 3)); this.Log == nil {
|
||||||
err = errors.New("log is nil")
|
err = errors.New("log is nil")
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
@ -6,10 +6,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
MainlineGetListResp = "getlist"
|
PagodaGetListResp = "getlist"
|
||||||
MainlineChallengeResp = "challenge"
|
PagodaChallengeResp = "challenge"
|
||||||
MainlineGetRewardResp = "getreward"
|
PagodaGetRewardResp = "getreward"
|
||||||
MainlineNewChapterPush = "newchapter"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type apiComp struct {
|
type apiComp struct {
|
||||||
|
@ -8,8 +8,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode) {
|
func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode) {
|
||||||
if req.MainlineId == 0 {
|
if req.LevelID <= 0 {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -17,12 +17,39 @@ func (this *apiComp) ChallengeCheck(session comm.IUserSession, req *pb.MainlineC
|
|||||||
}
|
}
|
||||||
|
|
||||||
///挑战主线关卡
|
///挑战主线关卡
|
||||||
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.MainlineChallengeReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) Challenge(session comm.IUserSession, req *pb.PagodaChallengeReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
code = this.ChallengeCheck(session, req)
|
code = this.ChallengeCheck(session, req)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
}
|
}
|
||||||
|
pagoda, err := this.module.modelPagoda.getPagodaList(session.GetUserId())
|
||||||
|
if err != nil {
|
||||||
|
code = pb.ErrorCode_PagodaNotFound
|
||||||
|
return
|
||||||
|
}
|
||||||
|
cfg := this.module.configure.GetPagodaconfig(req.LevelID)
|
||||||
|
if cfg == nil {
|
||||||
|
code = pb.ErrorCode_PagodaNotFound
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if cfg.PreLevel != pagoda.PagodaId {
|
||||||
|
code = pb.ErrorCode_PagodaLevlErr // 挑战关卡数据不匹配
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//// todo 战斗相关
|
||||||
|
|
||||||
|
pagoda.PagodaId = cfg.LayerNum // 更新层数
|
||||||
|
|
||||||
|
// 通关奖励
|
||||||
|
code = this.module.DispenseRes(session, cfg.Reward, true)
|
||||||
|
if code != pb.ErrorCode_Success {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
mapData := make(map[string]interface{}, 0)
|
||||||
|
mapData["pagodaId"] = cfg.LayerNum
|
||||||
|
code = this.module.ModifyPagodaData(session.GetUserId(), pagoda.Id, mapData)
|
||||||
|
session.SendMsg(string(this.module.GetType()), PagodaChallengeResp, &pb.PagodaChallengeResp{Data: pagoda})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -8,15 +8,15 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode) {
|
func (this *apiComp) GetRewardCheck(session comm.IUserSession, req *pb.PagodaGetRewardReq) (code pb.ErrorCode) {
|
||||||
if req.ChapterObj == "" {
|
if req.Id <= 0 {
|
||||||
code = pb.ErrorCode_ReqParameterError
|
code = pb.ErrorCode_ReqParameterError
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///获取主线关卡信息
|
///获取主线关卡信息
|
||||||
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.MainlineGetRewardReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) GetReward(session comm.IUserSession, req *pb.PagodaGetRewardReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
|
|
||||||
code = this.GetRewardCheck(session, req)
|
code = this.GetRewardCheck(session, req)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
|
@ -9,15 +9,14 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
//参数校验
|
//参数校验
|
||||||
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode) {
|
func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode) {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
///获取主线关卡信息
|
///获取主线关卡信息
|
||||||
func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListReq) (code pb.ErrorCode, data proto.Message) {
|
func (this *apiComp) GetList(session comm.IUserSession, req *pb.PagodaGetListReq) (code pb.ErrorCode, data proto.Message) {
|
||||||
rsp := &pb.MainlineGetListResp{}
|
_data := &pb.DBPagoda{}
|
||||||
|
|
||||||
code = this.GetListCheck(session, req)
|
code = this.GetListCheck(session, req)
|
||||||
if code != pb.ErrorCode_Success {
|
if code != pb.ErrorCode_Success {
|
||||||
return // 参数校验失败直接返回
|
return // 参数校验失败直接返回
|
||||||
@ -28,19 +27,17 @@ func (this *apiComp) GetList(session comm.IUserSession, req *pb.MainlineGetListR
|
|||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(list) == 0 { // 如果数量为0 则默认创建一条数据
|
if list == nil { // redis没有数据
|
||||||
_data := &pb.DBMainline{}
|
|
||||||
_data.Id = primitive.NewObjectID().Hex()
|
_data.Id = primitive.NewObjectID().Hex()
|
||||||
_data.ChapterId = 1 // 默认第一章节
|
|
||||||
_mData := make(map[string]interface{}, 0)
|
_mData := make(map[string]interface{}, 0)
|
||||||
_data.Uid = session.GetUserId()
|
_data.Uid = session.GetUserId()
|
||||||
_mData[_data.Id] = _data
|
_mData[_data.Id] = _data
|
||||||
|
|
||||||
this.module.modelPagoda.addNewPagoda(session.GetUserId(), _mData)
|
this.module.modelPagoda.addNewPagoda(session.GetUserId(), _mData)
|
||||||
list = append(list, _data)
|
|
||||||
}
|
|
||||||
rsp.Data = list
|
|
||||||
|
|
||||||
session.SendMsg(string(this.module.GetType()), MainlineGetListResp, &pb.MainlineGetListResp{Data: rsp.Data})
|
}
|
||||||
|
|
||||||
|
session.SendMsg(string(this.module.GetType()), PagodaGetListResp, &pb.PagodaGetListResp{Data: _data})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ func (this *configureComp) GetPagodaconfig(id int32) (data *cfg.Game_pagodaData)
|
|||||||
ok bool
|
ok bool
|
||||||
)
|
)
|
||||||
if configure, ok = v.(*cfg.Game_pagoda); !ok {
|
if configure, ok = v.(*cfg.Game_pagoda); !ok {
|
||||||
log.Errorf("%T no is *cfg.Game_mainlineEasyData", v)
|
log.Errorf("%T no is *cfg.Game_pagodaData", v)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,32 +1,34 @@
|
|||||||
package pagoda
|
package pagoda
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/lego/core"
|
"go_dreamfactory/lego/core"
|
||||||
|
"go_dreamfactory/lego/sys/redis"
|
||||||
"go_dreamfactory/modules"
|
"go_dreamfactory/modules"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
)
|
)
|
||||||
|
|
||||||
const ( //Redis
|
|
||||||
TablePagoda core.SqlTable = "pagoda"
|
|
||||||
)
|
|
||||||
|
|
||||||
type ModelPagoda struct {
|
type ModelPagoda struct {
|
||||||
modules.MCompModel
|
modules.MCompModel
|
||||||
module *Pagoda
|
module *Pagoda
|
||||||
}
|
}
|
||||||
|
|
||||||
func (this *ModelPagoda) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
func (this *ModelPagoda) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
||||||
|
this.TableName = string(comm.TablePagoda)
|
||||||
err = this.MCompModel.Init(service, module, comp, options)
|
err = this.MCompModel.Init(service, module, comp, options)
|
||||||
this.module = module.(*Pagoda)
|
this.module = module.(*Pagoda)
|
||||||
this.TableName = string(TablePagoda)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取爬塔信息
|
// 获取爬塔信息
|
||||||
func (this *ModelPagoda) getPagodaList(uid string) (storys []*pb.DBMainline, err error) {
|
func (this *ModelPagoda) getPagodaList(uid string) (result *pb.DBPagoda, err error) {
|
||||||
storys = make([]*pb.DBMainline, 0)
|
result = &pb.DBPagoda{}
|
||||||
err = this.GetList(uid, &storys)
|
if err = this.Get(uid, result); err != nil && redis.RedisNil != err {
|
||||||
return
|
return
|
||||||
|
}
|
||||||
|
err = nil
|
||||||
|
return result, err
|
||||||
}
|
}
|
||||||
|
|
||||||
// 修改爬塔数据信息
|
// 修改爬塔数据信息
|
||||||
@ -43,14 +45,3 @@ func (this *ModelPagoda) addNewPagoda(uId string, data map[string]interface{}) (
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// 获取指定塔数据
|
|
||||||
func (this *ModelPagoda) getPagodaByObjId(uid, obj string) *pb.DBMainline {
|
|
||||||
data := &pb.DBMainline{}
|
|
||||||
err := this.GetListObj(uid, obj, data)
|
|
||||||
if err != nil {
|
|
||||||
this.module.Errorf("%v", err)
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return data
|
|
||||||
}
|
|
||||||
|
@ -86,9 +86,7 @@ func (this *apiComp) Login(session comm.IUserSession, req *pb.UserLoginReq) (cod
|
|||||||
"serviceTag": session.GetServiecTag(),
|
"serviceTag": session.GetServiecTag(),
|
||||||
"gatewayServiceId": session.GetGatewayServiceId(),
|
"gatewayServiceId": session.GetGatewayServiceId(),
|
||||||
"ip": session.GetIP(),
|
"ip": session.GetIP(),
|
||||||
},
|
}, db.SetDBMgoLog(false))
|
||||||
db.SetDBExpire(time.Hour*12),
|
|
||||||
db.SetDBMgoLog(false))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
code = pb.ErrorCode_DBError
|
code = pb.ErrorCode_DBError
|
||||||
return
|
return
|
||||||
|
@ -80,17 +80,17 @@ type DBChat struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //主键id
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id"` //主键id
|
||||||
Channel ChatChannel `protobuf:"varint,2,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
Channel ChatChannel `protobuf:"varint,2,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
||||||
Suid string `protobuf:"bytes,3,opt,name=suid,proto3" json:"suid"` //发送用户id
|
Suid string `protobuf:"bytes,3,opt,name=suid,proto3" json:"suid"` //发送用户id
|
||||||
Ruid string `protobuf:"bytes,4,opt,name=ruid,proto3" json:"ruid"` //接收用户id channel == Private 有效
|
Ruid string `protobuf:"bytes,4,opt,name=ruid,proto3" json:"ruid"` //接收用户id channel == Private 有效
|
||||||
Groud int32 `protobuf:"varint,5,opt,name=groud,proto3" json:"groud"` //跨服频道 分组id
|
ChannelId int32 `protobuf:"varint,6,opt,name=channelId,proto3" json:"channelId"` //跨服频道 频道Id
|
||||||
AreaId int32 `protobuf:"varint,6,opt,name=areaId,proto3" json:"areaId"` //跨服频道 频道Id
|
UnionId string `protobuf:"bytes,7,opt,name=unionId,proto3" json:"unionId"` //工会id
|
||||||
UnionId string `protobuf:"bytes,7,opt,name=unionId,proto3" json:"unionId"` //工会id
|
Stag string `protobuf:"bytes,8,opt,name=stag,proto3" json:"stag"` //区服id
|
||||||
Avatar string `protobuf:"bytes,8,opt,name=avatar,proto3" json:"avatar"` //用户头像
|
Avatar string `protobuf:"bytes,9,opt,name=avatar,proto3" json:"avatar"` //用户头像
|
||||||
Uname string `protobuf:"bytes,9,opt,name=uname,proto3" json:"uname"` //用户名
|
Uname string `protobuf:"bytes,10,opt,name=uname,proto3" json:"uname"` //用户名
|
||||||
Content string `protobuf:"bytes,10,opt,name=content,proto3" json:"content"` //内容
|
Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content"` //内容
|
||||||
Ctime int64 `protobuf:"varint,11,opt,name=ctime,proto3" json:"ctime"` //创建时间
|
Ctime int64 `protobuf:"varint,12,opt,name=ctime,proto3" json:"ctime"` //创建时间
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBChat) Reset() {
|
func (x *DBChat) Reset() {
|
||||||
@ -153,16 +153,9 @@ func (x *DBChat) GetRuid() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DBChat) GetGroud() int32 {
|
func (x *DBChat) GetChannelId() int32 {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Groud
|
return x.ChannelId
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *DBChat) GetAreaId() int32 {
|
|
||||||
if x != nil {
|
|
||||||
return x.AreaId
|
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
@ -174,6 +167,13 @@ func (x *DBChat) GetUnionId() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *DBChat) GetStag() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Stag
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
func (x *DBChat) GetAvatar() string {
|
func (x *DBChat) GetAvatar() string {
|
||||||
if x != nil {
|
if x != nil {
|
||||||
return x.Avatar
|
return x.Avatar
|
||||||
@ -206,30 +206,30 @@ var File_chat_chat_db_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_chat_chat_db_proto_rawDesc = []byte{
|
var file_chat_chat_db_proto_rawDesc = []byte{
|
||||||
0x0a, 0x12, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
0x0a, 0x12, 0x63, 0x68, 0x61, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x64, 0x62, 0x2e, 0x70,
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x8e, 0x02, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12,
|
0x72, 0x6f, 0x74, 0x6f, 0x22, 0x92, 0x02, 0x0a, 0x06, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74, 0x12,
|
||||||
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
|
||||||
0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,
|
||||||
0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07,
|
0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07,
|
||||||
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x75, 0x69, 0x64, 0x18,
|
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x75, 0x69, 0x64, 0x18,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72,
|
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x75, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x72,
|
||||||
0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x75, 0x69, 0x64, 0x12,
|
0x75, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x75, 0x69, 0x64, 0x12,
|
||||||
0x14, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
|
0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x18, 0x06, 0x20, 0x01,
|
||||||
0x67, 0x72, 0x6f, 0x75, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x72, 0x65, 0x61, 0x49, 0x64, 0x18,
|
0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
||||||
0x06, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x72, 0x65, 0x61, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
|
||||||
0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
0x07, 0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
||||||
0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61,
|
0x75, 0x6e, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x61, 0x67, 0x18,
|
||||||
0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12,
|
0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x74, 0x61, 0x67, 0x12, 0x16, 0x0a, 0x06, 0x61,
|
||||||
0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61,
|
||||||
0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74,
|
0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x0a, 0x20, 0x01,
|
||||||
0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12,
|
0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05,
|
0x74, 0x65, 0x6e, 0x74, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
0x63, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61,
|
0x65, 0x6e, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x0c, 0x20, 0x01,
|
||||||
0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x10, 0x00, 0x12,
|
0x28, 0x03, 0x52, 0x05, 0x63, 0x74, 0x69, 0x6d, 0x65, 0x2a, 0x4d, 0x0a, 0x0b, 0x43, 0x68, 0x61,
|
||||||
0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x50, 0x72,
|
0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x6f, 0x72, 0x6c,
|
||||||
0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x72, 0x6f, 0x73, 0x73,
|
0x64, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x55, 0x6e, 0x69, 0x6f, 0x6e, 0x10, 0x01, 0x12, 0x0b,
|
||||||
0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x79, 0x73, 0x74,
|
0x0a, 0x07, 0x50, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x43,
|
||||||
0x65, 0x6d, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
0x72, 0x6f, 0x73, 0x73, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06,
|
||||||
0x6f, 0x74, 0x6f, 0x33,
|
0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62,
|
||||||
|
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -265,7 +265,8 @@ type ChatGetListReq struct {
|
|||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Channel ChatChannel `protobuf:"varint,1,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
Channel ChatChannel `protobuf:"varint,1,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
||||||
|
ChannelId int32 `protobuf:"varint,2,opt,name=channelId,proto3" json:"channelId"` //跨服频道id
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ChatGetListReq) Reset() {
|
func (x *ChatGetListReq) Reset() {
|
||||||
@ -307,6 +308,13 @@ func (x *ChatGetListReq) GetChannel() ChatChannel {
|
|||||||
return ChatChannel_World
|
return ChatChannel_World
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (x *ChatGetListReq) GetChannelId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.ChannelId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
//请求聊天消息 回应
|
//请求聊天消息 回应
|
||||||
type ChatGetListResp struct {
|
type ChatGetListResp struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -355,110 +363,6 @@ func (x *ChatGetListResp) GetChats() []*DBChat {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
//请求跨服聊天消息
|
|
||||||
type ChatSpanGetListReq struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Channel ChatChannel `protobuf:"varint,1,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
|
||||||
ChannelId int32 `protobuf:"varint,2,opt,name=channelId,proto3" json:"channelId"` //跨服频道id
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListReq) Reset() {
|
|
||||||
*x = ChatSpanGetListReq{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[7]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListReq) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChatSpanGetListReq) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListReq) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[7]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChatSpanGetListReq.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChatSpanGetListReq) Descriptor() ([]byte, []int) {
|
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{7}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListReq) GetChannel() ChatChannel {
|
|
||||||
if x != nil {
|
|
||||||
return x.Channel
|
|
||||||
}
|
|
||||||
return ChatChannel_World
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListReq) GetChannelId() int32 {
|
|
||||||
if x != nil {
|
|
||||||
return x.ChannelId
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
//请求跨服聊天消息 回应
|
|
||||||
type ChatSpanGetListResp struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Chats []*DBChat `protobuf:"bytes,1,rep,name=chats,proto3" json:"chats"`
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListResp) Reset() {
|
|
||||||
*x = ChatSpanGetListResp{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[8]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListResp) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChatSpanGetListResp) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListResp) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[8]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChatSpanGetListResp.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChatSpanGetListResp) Descriptor() ([]byte, []int) {
|
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{8}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanGetListResp) GetChats() []*DBChat {
|
|
||||||
if x != nil {
|
|
||||||
return x.Chats
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
//消息发送请求
|
//消息发送请求
|
||||||
type ChatSendReq struct {
|
type ChatSendReq struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -475,7 +379,7 @@ type ChatSendReq struct {
|
|||||||
func (x *ChatSendReq) Reset() {
|
func (x *ChatSendReq) Reset() {
|
||||||
*x = ChatSendReq{}
|
*x = ChatSendReq{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[9]
|
mi := &file_chat_chat_msg_proto_msgTypes[7]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -488,7 +392,7 @@ func (x *ChatSendReq) String() string {
|
|||||||
func (*ChatSendReq) ProtoMessage() {}
|
func (*ChatSendReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ChatSendReq) ProtoReflect() protoreflect.Message {
|
func (x *ChatSendReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[9]
|
mi := &file_chat_chat_msg_proto_msgTypes[7]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -501,7 +405,7 @@ func (x *ChatSendReq) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ChatSendReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ChatSendReq.ProtoReflect.Descriptor instead.
|
||||||
func (*ChatSendReq) Descriptor() ([]byte, []int) {
|
func (*ChatSendReq) Descriptor() ([]byte, []int) {
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{9}
|
return file_chat_chat_msg_proto_rawDescGZIP(), []int{7}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *ChatSendReq) GetAvatar() string {
|
func (x *ChatSendReq) GetAvatar() string {
|
||||||
@ -549,7 +453,7 @@ type ChatSendResp struct {
|
|||||||
func (x *ChatSendResp) Reset() {
|
func (x *ChatSendResp) Reset() {
|
||||||
*x = ChatSendResp{}
|
*x = ChatSendResp{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[10]
|
mi := &file_chat_chat_msg_proto_msgTypes[8]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -562,7 +466,7 @@ func (x *ChatSendResp) String() string {
|
|||||||
func (*ChatSendResp) ProtoMessage() {}
|
func (*ChatSendResp) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *ChatSendResp) ProtoReflect() protoreflect.Message {
|
func (x *ChatSendResp) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[10]
|
mi := &file_chat_chat_msg_proto_msgTypes[8]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -575,118 +479,7 @@ func (x *ChatSendResp) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use ChatSendResp.ProtoReflect.Descriptor instead.
|
// Deprecated: Use ChatSendResp.ProtoReflect.Descriptor instead.
|
||||||
func (*ChatSendResp) Descriptor() ([]byte, []int) {
|
func (*ChatSendResp) Descriptor() ([]byte, []int) {
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{10}
|
return file_chat_chat_msg_proto_rawDescGZIP(), []int{8}
|
||||||
}
|
|
||||||
|
|
||||||
//跨服消息发送请求
|
|
||||||
type ChatSpanSendReq struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
|
|
||||||
Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar"` //用户头像
|
|
||||||
Uname string `protobuf:"bytes,2,opt,name=uname,proto3" json:"uname"` //用户名
|
|
||||||
Channel ChatChannel `protobuf:"varint,3,opt,name=channel,proto3,enum=ChatChannel" json:"channel"` //频道
|
|
||||||
Content string `protobuf:"bytes,4,opt,name=content,proto3" json:"content"` //内容
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) Reset() {
|
|
||||||
*x = ChatSpanSendReq{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[11]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChatSpanSendReq) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[11]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChatSpanSendReq.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChatSpanSendReq) Descriptor() ([]byte, []int) {
|
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{11}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) GetAvatar() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Avatar
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) GetUname() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Uname
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) GetChannel() ChatChannel {
|
|
||||||
if x != nil {
|
|
||||||
return x.Channel
|
|
||||||
}
|
|
||||||
return ChatChannel_World
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendReq) GetContent() string {
|
|
||||||
if x != nil {
|
|
||||||
return x.Content
|
|
||||||
}
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
|
|
||||||
//跨服消息发送请求 回应
|
|
||||||
type ChatSpanSendResp struct {
|
|
||||||
state protoimpl.MessageState
|
|
||||||
sizeCache protoimpl.SizeCache
|
|
||||||
unknownFields protoimpl.UnknownFields
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendResp) Reset() {
|
|
||||||
*x = ChatSpanSendResp{}
|
|
||||||
if protoimpl.UnsafeEnabled {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[12]
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendResp) String() string {
|
|
||||||
return protoimpl.X.MessageStringOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
func (*ChatSpanSendResp) ProtoMessage() {}
|
|
||||||
|
|
||||||
func (x *ChatSpanSendResp) ProtoReflect() protoreflect.Message {
|
|
||||||
mi := &file_chat_chat_msg_proto_msgTypes[12]
|
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
||||||
if ms.LoadMessageInfo() == nil {
|
|
||||||
ms.StoreMessageInfo(mi)
|
|
||||||
}
|
|
||||||
return ms
|
|
||||||
}
|
|
||||||
return mi.MessageOf(x)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Deprecated: Use ChatSpanSendResp.ProtoReflect.Descriptor instead.
|
|
||||||
func (*ChatSpanSendResp) Descriptor() ([]byte, []int) {
|
|
||||||
return file_chat_chat_msg_proto_rawDescGZIP(), []int{12}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var File_chat_chat_msg_proto protoreflect.FileDescriptor
|
var File_chat_chat_msg_proto protoreflect.FileDescriptor
|
||||||
@ -710,44 +503,28 @@ var file_chat_chat_msg_proto_rawDesc = []byte{
|
|||||||
0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e,
|
0x6e, 0x65, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e,
|
||||||
0x65, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e,
|
0x65, 0x6c, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e,
|
||||||
0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18,
|
0x6e, 0x65, 0x6c, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x18,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x22, 0x38, 0x0a,
|
0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x06, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x22, 0x56, 0x0a,
|
||||||
0x0e, 0x43, 0x68, 0x61, 0x74, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12,
|
0x0e, 0x43, 0x68, 0x61, 0x74, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12,
|
||||||
0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
||||||
0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07,
|
0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07,
|
||||||
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x22, 0x30, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x47,
|
|
||||||
0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x05, 0x63, 0x68,
|
|
||||||
0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x43, 0x68,
|
|
||||||
0x61, 0x74, 0x52, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x22, 0x5a, 0x0a, 0x12, 0x43, 0x68, 0x61,
|
|
||||||
0x74, 0x53, 0x70, 0x61, 0x6e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12,
|
|
||||||
0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
|
||||||
0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07,
|
|
||||||
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e,
|
0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x63, 0x68, 0x61, 0x6e, 0x6e,
|
||||||
0x65, 0x6c, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e,
|
0x65, 0x6c, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x09, 0x63, 0x68, 0x61, 0x6e,
|
||||||
0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x34, 0x0a, 0x13, 0x43, 0x68, 0x61, 0x74, 0x53, 0x70, 0x61,
|
0x6e, 0x65, 0x6c, 0x49, 0x64, 0x22, 0x30, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74, 0x47, 0x65, 0x74,
|
||||||
0x6e, 0x47, 0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x05,
|
0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x05, 0x63, 0x68, 0x61, 0x74,
|
||||||
0x63, 0x68, 0x61, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42,
|
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x44, 0x42, 0x43, 0x68, 0x61, 0x74,
|
||||||
0x43, 0x68, 0x61, 0x74, 0x52, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0b,
|
0x52, 0x05, 0x63, 0x68, 0x61, 0x74, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x0b, 0x43, 0x68, 0x61, 0x74,
|
||||||
0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61,
|
0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61,
|
||||||
0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61,
|
0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12,
|
||||||
0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
||||||
0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61,
|
0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
|
||||||
0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61,
|
0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61, 0x74, 0x43, 0x68, 0x61,
|
||||||
0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
|
0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x12, 0x1a, 0x0a,
|
||||||
0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20,
|
0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a,
|
0x08, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e,
|
||||||
0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
|
0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74,
|
||||||
0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53,
|
0x65, 0x6e, 0x74, 0x22, 0x0e, 0x0a, 0x0c, 0x43, 0x68, 0x61, 0x74, 0x53, 0x65, 0x6e, 0x64, 0x52,
|
||||||
0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x22, 0x81, 0x01, 0x0a, 0x0f, 0x43, 0x68, 0x61, 0x74,
|
0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
0x53, 0x70, 0x61, 0x6e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x61,
|
0x74, 0x6f, 0x33,
|
||||||
0x76, 0x61, 0x74, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x61, 0x76, 0x61,
|
|
||||||
0x74, 0x61, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01,
|
|
||||||
0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x07, 0x63, 0x68, 0x61,
|
|
||||||
0x6e, 0x6e, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0c, 0x2e, 0x43, 0x68, 0x61,
|
|
||||||
0x74, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x52, 0x07, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65,
|
|
||||||
0x6c, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01,
|
|
||||||
0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x43,
|
|
||||||
0x68, 0x61, 0x74, 0x53, 0x70, 0x61, 0x6e, 0x53, 0x65, 0x6e, 0x64, 0x52, 0x65, 0x73, 0x70, 0x42,
|
|
||||||
0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -762,7 +539,7 @@ func file_chat_chat_msg_proto_rawDescGZIP() []byte {
|
|||||||
return file_chat_chat_msg_proto_rawDescData
|
return file_chat_chat_msg_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
var file_chat_chat_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
var file_chat_chat_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||||
var file_chat_chat_msg_proto_goTypes = []interface{}{
|
var file_chat_chat_msg_proto_goTypes = []interface{}{
|
||||||
(*ChatMessagePush)(nil), // 0: ChatMessagePush
|
(*ChatMessagePush)(nil), // 0: ChatMessagePush
|
||||||
(*ChatCrossChannelReq)(nil), // 1: ChatCrossChannelReq
|
(*ChatCrossChannelReq)(nil), // 1: ChatCrossChannelReq
|
||||||
@ -771,28 +548,21 @@ var file_chat_chat_msg_proto_goTypes = []interface{}{
|
|||||||
(*ChatChanageChannelResp)(nil), // 4: ChatChanageChannelResp
|
(*ChatChanageChannelResp)(nil), // 4: ChatChanageChannelResp
|
||||||
(*ChatGetListReq)(nil), // 5: ChatGetListReq
|
(*ChatGetListReq)(nil), // 5: ChatGetListReq
|
||||||
(*ChatGetListResp)(nil), // 6: ChatGetListResp
|
(*ChatGetListResp)(nil), // 6: ChatGetListResp
|
||||||
(*ChatSpanGetListReq)(nil), // 7: ChatSpanGetListReq
|
(*ChatSendReq)(nil), // 7: ChatSendReq
|
||||||
(*ChatSpanGetListResp)(nil), // 8: ChatSpanGetListResp
|
(*ChatSendResp)(nil), // 8: ChatSendResp
|
||||||
(*ChatSendReq)(nil), // 9: ChatSendReq
|
(*DBChat)(nil), // 9: DBChat
|
||||||
(*ChatSendResp)(nil), // 10: ChatSendResp
|
(ChatChannel)(0), // 10: ChatChannel
|
||||||
(*ChatSpanSendReq)(nil), // 11: ChatSpanSendReq
|
|
||||||
(*ChatSpanSendResp)(nil), // 12: ChatSpanSendResp
|
|
||||||
(*DBChat)(nil), // 13: DBChat
|
|
||||||
(ChatChannel)(0), // 14: ChatChannel
|
|
||||||
}
|
}
|
||||||
var file_chat_chat_msg_proto_depIdxs = []int32{
|
var file_chat_chat_msg_proto_depIdxs = []int32{
|
||||||
13, // 0: ChatMessagePush.chat:type_name -> DBChat
|
9, // 0: ChatMessagePush.chat:type_name -> DBChat
|
||||||
14, // 1: ChatGetListReq.channel:type_name -> ChatChannel
|
10, // 1: ChatGetListReq.channel:type_name -> ChatChannel
|
||||||
13, // 2: ChatGetListResp.chats:type_name -> DBChat
|
9, // 2: ChatGetListResp.chats:type_name -> DBChat
|
||||||
14, // 3: ChatSpanGetListReq.channel:type_name -> ChatChannel
|
10, // 3: ChatSendReq.channel:type_name -> ChatChannel
|
||||||
13, // 4: ChatSpanGetListResp.chats:type_name -> DBChat
|
4, // [4:4] is the sub-list for method output_type
|
||||||
14, // 5: ChatSendReq.channel:type_name -> ChatChannel
|
4, // [4:4] is the sub-list for method input_type
|
||||||
14, // 6: ChatSpanSendReq.channel:type_name -> ChatChannel
|
4, // [4:4] is the sub-list for extension type_name
|
||||||
7, // [7:7] is the sub-list for method output_type
|
4, // [4:4] is the sub-list for extension extendee
|
||||||
7, // [7:7] is the sub-list for method input_type
|
0, // [0:4] is the sub-list for field type_name
|
||||||
7, // [7:7] is the sub-list for extension type_name
|
|
||||||
7, // [7:7] is the sub-list for extension extendee
|
|
||||||
0, // [0:7] is the sub-list for field type_name
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { file_chat_chat_msg_proto_init() }
|
func init() { file_chat_chat_msg_proto_init() }
|
||||||
@ -887,30 +657,6 @@ func file_chat_chat_msg_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_chat_chat_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
file_chat_chat_msg_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ChatSpanGetListReq); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_chat_chat_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*ChatSpanGetListResp); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_chat_chat_msg_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*ChatSendReq); i {
|
switch v := v.(*ChatSendReq); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -922,7 +668,7 @@ func file_chat_chat_msg_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_chat_chat_msg_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_chat_chat_msg_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*ChatSendResp); i {
|
switch v := v.(*ChatSendResp); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -934,30 +680,6 @@ func file_chat_chat_msg_proto_init() {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_chat_chat_msg_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*ChatSpanSendReq); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
file_chat_chat_msg_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
|
||||||
switch v := v.(*ChatSpanSendResp); i {
|
|
||||||
case 0:
|
|
||||||
return &v.state
|
|
||||||
case 1:
|
|
||||||
return &v.sizeCache
|
|
||||||
case 2:
|
|
||||||
return &v.unknownFields
|
|
||||||
default:
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
@ -965,7 +687,7 @@ func file_chat_chat_msg_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_chat_chat_msg_proto_rawDesc,
|
RawDescriptor: file_chat_chat_msg_proto_rawDesc,
|
||||||
NumEnums: 0,
|
NumEnums: 0,
|
||||||
NumMessages: 13,
|
NumMessages: 9,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
182
pb/comm.pb.go
182
pb/comm.pb.go
@ -678,6 +678,86 @@ func (x *AgentCloseeReq) GetUserSessionId() string {
|
|||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//通知用户登录
|
||||||
|
type NoticeUserLoginReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Ip string `protobuf:"bytes,1,opt,name=Ip,proto3" json:"Ip"`
|
||||||
|
UserSessionId string `protobuf:"bytes,2,opt,name=UserSessionId,proto3" json:"UserSessionId"`
|
||||||
|
UserId string `protobuf:"bytes,3,opt,name=UserId,proto3" json:"UserId"`
|
||||||
|
ServiceTag string `protobuf:"bytes,4,opt,name=ServiceTag,proto3" json:"ServiceTag"`
|
||||||
|
GatewayServiceId string `protobuf:"bytes,5,opt,name=GatewayServiceId,proto3" json:"GatewayServiceId"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) Reset() {
|
||||||
|
*x = NoticeUserLoginReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_comm_proto_msgTypes[9]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*NoticeUserLoginReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_comm_proto_msgTypes[9]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use NoticeUserLoginReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*NoticeUserLoginReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_comm_proto_rawDescGZIP(), []int{9}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) GetIp() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Ip
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) GetUserSessionId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserSessionId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) GetUserId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.UserId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) GetServiceTag() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.ServiceTag
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *NoticeUserLoginReq) GetGatewayServiceId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.GatewayServiceId
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
//通知用户离线
|
//通知用户离线
|
||||||
type NoticeUserCloseReq struct {
|
type NoticeUserCloseReq struct {
|
||||||
state protoimpl.MessageState
|
state protoimpl.MessageState
|
||||||
@ -694,7 +774,7 @@ type NoticeUserCloseReq struct {
|
|||||||
func (x *NoticeUserCloseReq) Reset() {
|
func (x *NoticeUserCloseReq) Reset() {
|
||||||
*x = NoticeUserCloseReq{}
|
*x = NoticeUserCloseReq{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_comm_proto_msgTypes[9]
|
mi := &file_comm_proto_msgTypes[10]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -707,7 +787,7 @@ func (x *NoticeUserCloseReq) String() string {
|
|||||||
func (*NoticeUserCloseReq) ProtoMessage() {}
|
func (*NoticeUserCloseReq) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *NoticeUserCloseReq) ProtoReflect() protoreflect.Message {
|
func (x *NoticeUserCloseReq) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_comm_proto_msgTypes[9]
|
mi := &file_comm_proto_msgTypes[10]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -720,7 +800,7 @@ func (x *NoticeUserCloseReq) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use NoticeUserCloseReq.ProtoReflect.Descriptor instead.
|
// Deprecated: Use NoticeUserCloseReq.ProtoReflect.Descriptor instead.
|
||||||
func (*NoticeUserCloseReq) Descriptor() ([]byte, []int) {
|
func (*NoticeUserCloseReq) Descriptor() ([]byte, []int) {
|
||||||
return file_comm_proto_rawDescGZIP(), []int{9}
|
return file_comm_proto_rawDescGZIP(), []int{10}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *NoticeUserCloseReq) GetIp() string {
|
func (x *NoticeUserCloseReq) GetIp() string {
|
||||||
@ -772,7 +852,7 @@ type UserAssets struct {
|
|||||||
func (x *UserAssets) Reset() {
|
func (x *UserAssets) Reset() {
|
||||||
*x = UserAssets{}
|
*x = UserAssets{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_comm_proto_msgTypes[10]
|
mi := &file_comm_proto_msgTypes[11]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -785,7 +865,7 @@ func (x *UserAssets) String() string {
|
|||||||
func (*UserAssets) ProtoMessage() {}
|
func (*UserAssets) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *UserAssets) ProtoReflect() protoreflect.Message {
|
func (x *UserAssets) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_comm_proto_msgTypes[10]
|
mi := &file_comm_proto_msgTypes[11]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -798,7 +878,7 @@ func (x *UserAssets) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use UserAssets.ProtoReflect.Descriptor instead.
|
// Deprecated: Use UserAssets.ProtoReflect.Descriptor instead.
|
||||||
func (*UserAssets) Descriptor() ([]byte, []int) {
|
func (*UserAssets) Descriptor() ([]byte, []int) {
|
||||||
return file_comm_proto_rawDescGZIP(), []int{10}
|
return file_comm_proto_rawDescGZIP(), []int{11}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UserAssets) GetA() string {
|
func (x *UserAssets) GetA() string {
|
||||||
@ -834,7 +914,7 @@ type TaskParam struct {
|
|||||||
func (x *TaskParam) Reset() {
|
func (x *TaskParam) Reset() {
|
||||||
*x = TaskParam{}
|
*x = TaskParam{}
|
||||||
if protoimpl.UnsafeEnabled {
|
if protoimpl.UnsafeEnabled {
|
||||||
mi := &file_comm_proto_msgTypes[11]
|
mi := &file_comm_proto_msgTypes[12]
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
ms.StoreMessageInfo(mi)
|
ms.StoreMessageInfo(mi)
|
||||||
}
|
}
|
||||||
@ -847,7 +927,7 @@ func (x *TaskParam) String() string {
|
|||||||
func (*TaskParam) ProtoMessage() {}
|
func (*TaskParam) ProtoMessage() {}
|
||||||
|
|
||||||
func (x *TaskParam) ProtoReflect() protoreflect.Message {
|
func (x *TaskParam) ProtoReflect() protoreflect.Message {
|
||||||
mi := &file_comm_proto_msgTypes[11]
|
mi := &file_comm_proto_msgTypes[12]
|
||||||
if protoimpl.UnsafeEnabled && x != nil {
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
if ms.LoadMessageInfo() == nil {
|
if ms.LoadMessageInfo() == nil {
|
||||||
@ -860,7 +940,7 @@ func (x *TaskParam) ProtoReflect() protoreflect.Message {
|
|||||||
|
|
||||||
// Deprecated: Use TaskParam.ProtoReflect.Descriptor instead.
|
// Deprecated: Use TaskParam.ProtoReflect.Descriptor instead.
|
||||||
func (*TaskParam) Descriptor() ([]byte, []int) {
|
func (*TaskParam) Descriptor() ([]byte, []int) {
|
||||||
return file_comm_proto_rawDescGZIP(), []int{11}
|
return file_comm_proto_rawDescGZIP(), []int{12}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *TaskParam) GetFirst() int32 {
|
func (x *TaskParam) GetFirst() int32 {
|
||||||
@ -957,7 +1037,7 @@ var file_comm_proto_rawDesc = []byte{
|
|||||||
0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73,
|
0x65, 0x52, 0x65, 0x71, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73,
|
||||||
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65,
|
0x69, 0x6f, 0x6e, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65,
|
||||||
0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x4e,
|
0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x12, 0x4e,
|
||||||
0x6f, 0x74, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x52, 0x65,
|
0x6f, 0x74, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65,
|
||||||
0x71, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49,
|
0x71, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x49,
|
||||||
0x70, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
0x70, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e,
|
||||||
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
|
0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65,
|
||||||
@ -967,20 +1047,31 @@ var file_comm_proto_rawDesc = []byte{
|
|||||||
0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x67, 0x12,
|
0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x67, 0x12,
|
||||||
0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
|
||||||
0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77,
|
0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77,
|
||||||
0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x0a, 0x55,
|
0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0xae, 0x01, 0x0a, 0x12,
|
||||||
0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x41, 0x18, 0x01,
|
0x4e, 0x6f, 0x74, 0x69, 0x63, 0x65, 0x55, 0x73, 0x65, 0x72, 0x43, 0x6c, 0x6f, 0x73, 0x65, 0x52,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x41, 0x12, 0x0c, 0x0a, 0x01, 0x54, 0x18, 0x02, 0x20, 0x01,
|
0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x49, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
||||||
0x28, 0x09, 0x52, 0x01, 0x54, 0x12, 0x0c, 0x0a, 0x01, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05,
|
0x49, 0x70, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x73, 0x73, 0x69, 0x6f,
|
||||||
0x52, 0x01, 0x4e, 0x22, 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61, 0x6d,
|
0x6e, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x53,
|
||||||
0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
|
0x65, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x55, 0x73, 0x65, 0x72,
|
||||||
0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64,
|
0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x55, 0x73, 0x65, 0x72, 0x49, 0x64,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2a, 0x43,
|
0x12, 0x1e, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x67, 0x18, 0x04,
|
||||||
0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x73,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x61, 0x67,
|
||||||
0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03,
|
0x12, 0x2a, 0x0a, 0x10, 0x47, 0x61, 0x74, 0x65, 0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69,
|
||||||
0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12, 0x09,
|
0x63, 0x65, 0x49, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x47, 0x61, 0x74, 0x65,
|
||||||
0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72, 0x69,
|
0x77, 0x61, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x64, 0x22, 0x36, 0x0a, 0x0a,
|
||||||
0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
0x55, 0x73, 0x65, 0x72, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x0c, 0x0a, 0x01, 0x41, 0x18,
|
||||||
0x74, 0x6f, 0x33,
|
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x41, 0x12, 0x0c, 0x0a, 0x01, 0x54, 0x18, 0x02, 0x20,
|
||||||
|
0x01, 0x28, 0x09, 0x52, 0x01, 0x54, 0x12, 0x0c, 0x0a, 0x01, 0x4e, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
|
0x05, 0x52, 0x01, 0x4e, 0x22, 0x39, 0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x50, 0x61, 0x72, 0x61,
|
||||||
|
0x6d, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
|
||||||
|
0x52, 0x05, 0x66, 0x69, 0x72, 0x73, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e,
|
||||||
|
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x65, 0x63, 0x6f, 0x6e, 0x64, 0x2a,
|
||||||
|
0x43, 0x0a, 0x12, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65,
|
||||||
|
0x73, 0x54, 0x79, 0x70, 0x65, 0x12, 0x06, 0x0a, 0x02, 0x48, 0x70, 0x10, 0x00, 0x12, 0x07, 0x0a,
|
||||||
|
0x03, 0x41, 0x74, 0x6b, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x44, 0x65, 0x66, 0x10, 0x02, 0x12,
|
||||||
|
0x09, 0x0a, 0x05, 0x53, 0x70, 0x65, 0x65, 0x64, 0x10, 0x03, 0x12, 0x08, 0x0a, 0x04, 0x43, 0x72,
|
||||||
|
0x69, 0x74, 0x10, 0x04, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
@ -996,7 +1087,7 @@ func file_comm_proto_rawDescGZIP() []byte {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var file_comm_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
var file_comm_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||||
var file_comm_proto_msgTypes = make([]protoimpl.MessageInfo, 12)
|
var file_comm_proto_msgTypes = make([]protoimpl.MessageInfo, 13)
|
||||||
var file_comm_proto_goTypes = []interface{}{
|
var file_comm_proto_goTypes = []interface{}{
|
||||||
(HeroAttributesType)(0), // 0: HeroAttributesType
|
(HeroAttributesType)(0), // 0: HeroAttributesType
|
||||||
(*UserMessage)(nil), // 1: UserMessage
|
(*UserMessage)(nil), // 1: UserMessage
|
||||||
@ -1008,21 +1099,22 @@ var file_comm_proto_goTypes = []interface{}{
|
|||||||
(*BatchMessageReq)(nil), // 7: BatchMessageReq
|
(*BatchMessageReq)(nil), // 7: BatchMessageReq
|
||||||
(*BroadCastMessageReq)(nil), // 8: BroadCastMessageReq
|
(*BroadCastMessageReq)(nil), // 8: BroadCastMessageReq
|
||||||
(*AgentCloseeReq)(nil), // 9: AgentCloseeReq
|
(*AgentCloseeReq)(nil), // 9: AgentCloseeReq
|
||||||
(*NoticeUserCloseReq)(nil), // 10: NoticeUserCloseReq
|
(*NoticeUserLoginReq)(nil), // 10: NoticeUserLoginReq
|
||||||
(*UserAssets)(nil), // 11: UserAssets
|
(*NoticeUserCloseReq)(nil), // 11: NoticeUserCloseReq
|
||||||
(*TaskParam)(nil), // 12: TaskParam
|
(*UserAssets)(nil), // 12: UserAssets
|
||||||
(*anypb.Any)(nil), // 13: google.protobuf.Any
|
(*TaskParam)(nil), // 13: TaskParam
|
||||||
(ErrorCode)(0), // 14: ErrorCode
|
(*anypb.Any)(nil), // 14: google.protobuf.Any
|
||||||
|
(ErrorCode)(0), // 15: ErrorCode
|
||||||
}
|
}
|
||||||
var file_comm_proto_depIdxs = []int32{
|
var file_comm_proto_depIdxs = []int32{
|
||||||
13, // 0: UserMessage.data:type_name -> google.protobuf.Any
|
14, // 0: UserMessage.data:type_name -> google.protobuf.Any
|
||||||
13, // 1: AgentMessage.Message:type_name -> google.protobuf.Any
|
14, // 1: AgentMessage.Message:type_name -> google.protobuf.Any
|
||||||
14, // 2: RPCMessageReply.Code:type_name -> ErrorCode
|
15, // 2: RPCMessageReply.Code:type_name -> ErrorCode
|
||||||
13, // 3: RPCMessageReply.ErrorData:type_name -> google.protobuf.Any
|
14, // 3: RPCMessageReply.ErrorData:type_name -> google.protobuf.Any
|
||||||
1, // 4: RPCMessageReply.Reply:type_name -> UserMessage
|
1, // 4: RPCMessageReply.Reply:type_name -> UserMessage
|
||||||
1, // 5: AgentSendMessageReq.Reply:type_name -> UserMessage
|
1, // 5: AgentSendMessageReq.Reply:type_name -> UserMessage
|
||||||
13, // 6: BatchMessageReq.Data:type_name -> google.protobuf.Any
|
14, // 6: BatchMessageReq.Data:type_name -> google.protobuf.Any
|
||||||
13, // 7: BroadCastMessageReq.Data:type_name -> google.protobuf.Any
|
14, // 7: BroadCastMessageReq.Data:type_name -> google.protobuf.Any
|
||||||
8, // [8:8] is the sub-list for method output_type
|
8, // [8:8] is the sub-list for method output_type
|
||||||
8, // [8:8] is the sub-list for method input_type
|
8, // [8:8] is the sub-list for method input_type
|
||||||
8, // [8:8] is the sub-list for extension type_name
|
8, // [8:8] is the sub-list for extension type_name
|
||||||
@ -1146,7 +1238,7 @@ func file_comm_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_comm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
file_comm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*NoticeUserCloseReq); i {
|
switch v := v.(*NoticeUserLoginReq); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -1158,7 +1250,7 @@ func file_comm_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_comm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
file_comm_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*UserAssets); i {
|
switch v := v.(*NoticeUserCloseReq); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
case 1:
|
case 1:
|
||||||
@ -1170,6 +1262,18 @@ func file_comm_proto_init() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
file_comm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
file_comm_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*UserAssets); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_comm_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} {
|
||||||
switch v := v.(*TaskParam); i {
|
switch v := v.(*TaskParam); i {
|
||||||
case 0:
|
case 0:
|
||||||
return &v.state
|
return &v.state
|
||||||
@ -1188,7 +1292,7 @@ func file_comm_proto_init() {
|
|||||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
RawDescriptor: file_comm_proto_rawDesc,
|
RawDescriptor: file_comm_proto_rawDesc,
|
||||||
NumEnums: 1,
|
NumEnums: 1,
|
||||||
NumMessages: 12,
|
NumMessages: 13,
|
||||||
NumExtensions: 0,
|
NumExtensions: 0,
|
||||||
NumServices: 0,
|
NumServices: 0,
|
||||||
},
|
},
|
||||||
|
@ -75,6 +75,7 @@ const (
|
|||||||
ErrorCode_FriendSearchNameEmpty ErrorCode = 1111 //查询昵称为空
|
ErrorCode_FriendSearchNameEmpty ErrorCode = 1111 //查询昵称为空
|
||||||
ErrorCode_FriendZaned ErrorCode = 1112 //已点赞
|
ErrorCode_FriendZaned ErrorCode = 1112 //已点赞
|
||||||
ErrorCode_FriendZanreceived ErrorCode = 1113 //已领取点赞
|
ErrorCode_FriendZanreceived ErrorCode = 1113 //已领取点赞
|
||||||
|
ErrorCode_FriendZanSelf ErrorCode = 1114 //不能给自己点赞
|
||||||
// item
|
// item
|
||||||
ErrorCode_ItemsNoEnough ErrorCode = 1200 //背包物品不足
|
ErrorCode_ItemsNoEnough ErrorCode = 1200 //背包物品不足
|
||||||
ErrorCode_ItemsNoFoundGird ErrorCode = 1201 //背包未找到物品格子
|
ErrorCode_ItemsNoFoundGird ErrorCode = 1201 //背包未找到物品格子
|
||||||
@ -135,114 +136,120 @@ const (
|
|||||||
ErrorCode_ShopNoSurplusRefreshNum ErrorCode = 1701 //剩余刷新次数已用完
|
ErrorCode_ShopNoSurplusRefreshNum ErrorCode = 1701 //剩余刷新次数已用完
|
||||||
// mail
|
// mail
|
||||||
ErrorCode_MailErr ErrorCode = 1800 // 邮件不存在
|
ErrorCode_MailErr ErrorCode = 1800 // 邮件不存在
|
||||||
|
// pagoda
|
||||||
|
ErrorCode_PagodaNotFound ErrorCode = 1900 // 找不到塔数据
|
||||||
|
ErrorCode_PagodaLevlErr ErrorCode = 19001 // 挑战关卡数据不匹配
|
||||||
)
|
)
|
||||||
|
|
||||||
// Enum value maps for ErrorCode.
|
// Enum value maps for ErrorCode.
|
||||||
var (
|
var (
|
||||||
ErrorCode_name = map[int32]string{
|
ErrorCode_name = map[int32]string{
|
||||||
0: "Success",
|
0: "Success",
|
||||||
10: "NoFindService",
|
10: "NoFindService",
|
||||||
11: "NoFindServiceHandleFunc",
|
11: "NoFindServiceHandleFunc",
|
||||||
12: "RpcFuncExecutionError",
|
12: "RpcFuncExecutionError",
|
||||||
13: "CacheReadError",
|
13: "CacheReadError",
|
||||||
14: "SqlExecutionError",
|
14: "SqlExecutionError",
|
||||||
15: "ReqParameterError",
|
15: "ReqParameterError",
|
||||||
16: "SignError",
|
16: "SignError",
|
||||||
17: "InsufficientPermissions",
|
17: "InsufficientPermissions",
|
||||||
18: "NoLogin",
|
18: "NoLogin",
|
||||||
19: "UserSessionNobeing",
|
19: "UserSessionNobeing",
|
||||||
20: "StateInvalid",
|
20: "StateInvalid",
|
||||||
21: "DBError",
|
21: "DBError",
|
||||||
22: "SystemError",
|
22: "SystemError",
|
||||||
23: "DecodeError",
|
23: "DecodeError",
|
||||||
24: "TimestampTimeout",
|
24: "TimestampTimeout",
|
||||||
25: "PbError",
|
25: "PbError",
|
||||||
26: "AgentUidEmpty",
|
26: "AgentUidEmpty",
|
||||||
100: "Exception",
|
100: "Exception",
|
||||||
101: "Unknown",
|
101: "Unknown",
|
||||||
102: "ResNoEnough",
|
102: "ResNoEnough",
|
||||||
103: "ConfigurationException",
|
103: "ConfigurationException",
|
||||||
104: "ConfigNoFound",
|
104: "ConfigNoFound",
|
||||||
1000: "SecKeyInvalid",
|
1000: "SecKeyInvalid",
|
||||||
1001: "SecKey",
|
1001: "SecKey",
|
||||||
1002: "BindUser",
|
1002: "BindUser",
|
||||||
1003: "GoldNoEnough",
|
1003: "GoldNoEnough",
|
||||||
1004: "DiamondNoEnough",
|
1004: "DiamondNoEnough",
|
||||||
1005: "RoleCreated",
|
1005: "RoleCreated",
|
||||||
1006: "UserNickNameExist",
|
1006: "UserNickNameExist",
|
||||||
1007: "VeriCodeNoValid",
|
1007: "VeriCodeNoValid",
|
||||||
1008: "VeriCodeExpired",
|
1008: "VeriCodeExpired",
|
||||||
1009: "UserResetData",
|
1009: "UserResetData",
|
||||||
1010: "UserModiNameCount",
|
1010: "UserModiNameCount",
|
||||||
1011: "UserNickNameEmpty",
|
1011: "UserNickNameEmpty",
|
||||||
1012: "UserExpandNull",
|
1012: "UserExpandNull",
|
||||||
1100: "FriendNotSelf",
|
1100: "FriendNotSelf",
|
||||||
1101: "FriendSelfMax",
|
1101: "FriendSelfMax",
|
||||||
1102: "FriendTargetMax",
|
1102: "FriendTargetMax",
|
||||||
1103: "FriendSelfNoData",
|
1103: "FriendSelfNoData",
|
||||||
1104: "FriendTargetNoData",
|
1104: "FriendTargetNoData",
|
||||||
1105: "FriendYet",
|
1105: "FriendYet",
|
||||||
1106: "FriendApplyYet",
|
1106: "FriendApplyYet",
|
||||||
1107: "FriendSelfBlackYet",
|
1107: "FriendSelfBlackYet",
|
||||||
1108: "FriendTargetBlackYet",
|
1108: "FriendTargetBlackYet",
|
||||||
1109: "FriendApplyError",
|
1109: "FriendApplyError",
|
||||||
1110: "FriendBlackMax",
|
1110: "FriendBlackMax",
|
||||||
1111: "FriendSearchNameEmpty",
|
1111: "FriendSearchNameEmpty",
|
||||||
1112: "FriendZaned",
|
1112: "FriendZaned",
|
||||||
1113: "FriendZanreceived",
|
1113: "FriendZanreceived",
|
||||||
1200: "ItemsNoEnough",
|
1114: "FriendZanSelf",
|
||||||
1201: "ItemsNoFoundGird",
|
1200: "ItemsNoEnough",
|
||||||
1202: "ItemsGridNumUpper",
|
1201: "ItemsNoFoundGird",
|
||||||
1203: "ItemsGirdAmountUpper",
|
1202: "ItemsGridNumUpper",
|
||||||
1204: "ItemsUseNotSupported",
|
1203: "ItemsGirdAmountUpper",
|
||||||
1300: "HeroNoExist",
|
1204: "ItemsUseNotSupported",
|
||||||
1301: "HeroNoEnough",
|
1300: "HeroNoExist",
|
||||||
1302: "HeroMaxLv",
|
1301: "HeroNoEnough",
|
||||||
1303: "HeroInitCreat",
|
1302: "HeroMaxLv",
|
||||||
1304: "HeroColorErr",
|
1303: "HeroInitCreat",
|
||||||
1305: "HeroSkillUpErr",
|
1304: "HeroColorErr",
|
||||||
1306: "HeroMaxResonate",
|
1305: "HeroSkillUpErr",
|
||||||
1307: "HeroNoResonate",
|
1306: "HeroMaxResonate",
|
||||||
1308: "HeroNotNeedResonate",
|
1307: "HeroNoResonate",
|
||||||
1309: "HeroNoEnergy",
|
1308: "HeroNotNeedResonate",
|
||||||
1310: "HeroCreate",
|
1309: "HeroNoEnergy",
|
||||||
1311: "HeroEquipUpdate",
|
1310: "HeroCreate",
|
||||||
1312: "HeroMaxAwaken",
|
1311: "HeroEquipUpdate",
|
||||||
1313: "HeroIsLock",
|
1312: "HeroMaxAwaken",
|
||||||
1314: "HeroMaxCount",
|
1313: "HeroIsLock",
|
||||||
1315: "HeroCostTypeErr",
|
1314: "HeroMaxCount",
|
||||||
1316: "HeroStarErr",
|
1315: "HeroCostTypeErr",
|
||||||
1317: "HeroTypeErr",
|
1316: "HeroStarErr",
|
||||||
1318: "HeroExpTypeErr",
|
1317: "HeroTypeErr",
|
||||||
1319: "HeroAddMaxExp",
|
1318: "HeroExpTypeErr",
|
||||||
1320: "HeroStarLvErr",
|
1319: "HeroAddMaxExp",
|
||||||
1321: "HeroMaxStarLv",
|
1320: "HeroStarLvErr",
|
||||||
1322: "DrawCardTypeNotFound",
|
1321: "HeroMaxStarLv",
|
||||||
1323: "HeroMaxSkillLv",
|
1322: "DrawCardTypeNotFound",
|
||||||
1400: "EquipmentOnFoundEquipment",
|
1323: "HeroMaxSkillLv",
|
||||||
1401: "EquipmentLvlimitReached",
|
1400: "EquipmentOnFoundEquipment",
|
||||||
1402: "EquipmentIsWorn",
|
1401: "EquipmentLvlimitReached",
|
||||||
1500: "MainlineNotFindChapter",
|
1402: "EquipmentIsWorn",
|
||||||
1501: "MainlineIDFailed",
|
1500: "MainlineNotFindChapter",
|
||||||
1502: "MainlineNotFound",
|
1501: "MainlineIDFailed",
|
||||||
1503: "MainlinePreNotFound",
|
1502: "MainlineNotFound",
|
||||||
1504: "MainlineRepeatReward",
|
1503: "MainlinePreNotFound",
|
||||||
1505: "MainlineCompleteReward",
|
1504: "MainlineRepeatReward",
|
||||||
1600: "TaskInit",
|
1505: "MainlineCompleteReward",
|
||||||
1601: "TaskReset",
|
1600: "TaskInit",
|
||||||
1602: "TaskHandle",
|
1601: "TaskReset",
|
||||||
1603: "TaskReceived",
|
1602: "TaskHandle",
|
||||||
1604: "TaskActiveInit",
|
1603: "TaskReceived",
|
||||||
1605: "TaskActiveNofound",
|
1604: "TaskActiveInit",
|
||||||
1606: "TaskActiveNoenough",
|
1605: "TaskActiveNofound",
|
||||||
1607: "TaskNoFinished",
|
1606: "TaskActiveNoenough",
|
||||||
1608: "TaskFinished",
|
1607: "TaskNoFinished",
|
||||||
1609: "TaskTagEmpty",
|
1608: "TaskFinished",
|
||||||
1610: "TaskIdEmpty",
|
1609: "TaskTagEmpty",
|
||||||
1611: "TaskNotFound",
|
1610: "TaskIdEmpty",
|
||||||
1700: "ShopGoodsIsSoldOut",
|
1611: "TaskNotFound",
|
||||||
1701: "ShopNoSurplusRefreshNum",
|
1700: "ShopGoodsIsSoldOut",
|
||||||
1800: "MailErr",
|
1701: "ShopNoSurplusRefreshNum",
|
||||||
|
1800: "MailErr",
|
||||||
|
1900: "PagodaNotFound",
|
||||||
|
19001: "PagodaLevlErr",
|
||||||
}
|
}
|
||||||
ErrorCode_value = map[string]int32{
|
ErrorCode_value = map[string]int32{
|
||||||
"Success": 0,
|
"Success": 0,
|
||||||
@ -295,6 +302,7 @@ var (
|
|||||||
"FriendSearchNameEmpty": 1111,
|
"FriendSearchNameEmpty": 1111,
|
||||||
"FriendZaned": 1112,
|
"FriendZaned": 1112,
|
||||||
"FriendZanreceived": 1113,
|
"FriendZanreceived": 1113,
|
||||||
|
"FriendZanSelf": 1114,
|
||||||
"ItemsNoEnough": 1200,
|
"ItemsNoEnough": 1200,
|
||||||
"ItemsNoFoundGird": 1201,
|
"ItemsNoFoundGird": 1201,
|
||||||
"ItemsGridNumUpper": 1202,
|
"ItemsGridNumUpper": 1202,
|
||||||
@ -348,6 +356,8 @@ var (
|
|||||||
"ShopGoodsIsSoldOut": 1700,
|
"ShopGoodsIsSoldOut": 1700,
|
||||||
"ShopNoSurplusRefreshNum": 1701,
|
"ShopNoSurplusRefreshNum": 1701,
|
||||||
"MailErr": 1800,
|
"MailErr": 1800,
|
||||||
|
"PagodaNotFound": 1900,
|
||||||
|
"PagodaLevlErr": 19001,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -382,7 +392,7 @@ var File_errorcode_proto protoreflect.FileDescriptor
|
|||||||
|
|
||||||
var file_errorcode_proto_rawDesc = []byte{
|
var file_errorcode_proto_rawDesc = []byte{
|
||||||
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
0x0a, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x63, 0x6f, 0x64, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x6f, 0x2a, 0x85, 0x11, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
0x6f, 0x2a, 0xc3, 0x11, 0x0a, 0x09, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x43, 0x6f, 0x64, 0x65, 0x12,
|
||||||
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
0x0b, 0x0a, 0x07, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x10, 0x00, 0x12, 0x11, 0x0a, 0x0d,
|
||||||
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x10, 0x0a, 0x12,
|
||||||
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
0x1b, 0x0a, 0x17, 0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x64, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
@ -447,79 +457,83 @@ var file_errorcode_proto_rawDesc = []byte{
|
|||||||
0x79, 0x10, 0xd7, 0x08, 0x12, 0x10, 0x0a, 0x0b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61,
|
0x79, 0x10, 0xd7, 0x08, 0x12, 0x10, 0x0a, 0x0b, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61,
|
||||||
0x6e, 0x65, 0x64, 0x10, 0xd8, 0x08, 0x12, 0x16, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64,
|
0x6e, 0x65, 0x64, 0x10, 0xd8, 0x08, 0x12, 0x16, 0x0a, 0x11, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64,
|
||||||
0x5a, 0x61, 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xd9, 0x08, 0x12, 0x12,
|
0x5a, 0x61, 0x6e, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xd9, 0x08, 0x12, 0x12,
|
||||||
0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10,
|
0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x53, 0x65, 0x6c, 0x66, 0x10,
|
||||||
0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x46, 0x6f, 0x75,
|
0xda, 0x08, 0x12, 0x12, 0x0a, 0x0d, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e, 0x6f, 0x45, 0x6e, 0x6f,
|
||||||
0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a, 0x11, 0x49, 0x74, 0x65,
|
0x75, 0x67, 0x68, 0x10, 0xb0, 0x09, 0x12, 0x15, 0x0a, 0x10, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x4e,
|
||||||
0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb2,
|
0x6f, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x47, 0x69, 0x72, 0x64, 0x10, 0xb1, 0x09, 0x12, 0x16, 0x0a,
|
||||||
0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69, 0x72, 0x64, 0x41, 0x6d,
|
0x11, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x72, 0x69, 0x64, 0x4e, 0x75, 0x6d, 0x55, 0x70, 0x70,
|
||||||
0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09, 0x12, 0x19, 0x0a, 0x14,
|
0x65, 0x72, 0x10, 0xb2, 0x09, 0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x47, 0x69,
|
||||||
0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53, 0x75, 0x70, 0x70, 0x6f,
|
0x72, 0x64, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x55, 0x70, 0x70, 0x65, 0x72, 0x10, 0xb3, 0x09,
|
||||||
0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x4e,
|
0x12, 0x19, 0x0a, 0x14, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x55, 0x73, 0x65, 0x4e, 0x6f, 0x74, 0x53,
|
||||||
0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72,
|
0x75, 0x70, 0x70, 0x6f, 0x72, 0x74, 0x65, 0x64, 0x10, 0xb4, 0x09, 0x12, 0x10, 0x0a, 0x0b, 0x48,
|
||||||
0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a, 0x12, 0x0e, 0x0a, 0x09,
|
0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x78, 0x69, 0x73, 0x74, 0x10, 0x94, 0x0a, 0x12, 0x11, 0x0a,
|
||||||
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a, 0x12, 0x12, 0x0a, 0x0d,
|
0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0x95, 0x0a,
|
||||||
0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x10, 0x97, 0x0a,
|
0x12, 0x0e, 0x0a, 0x09, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x4c, 0x76, 0x10, 0x96, 0x0a,
|
||||||
0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x45, 0x72, 0x72,
|
0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x6e, 0x69, 0x74, 0x43, 0x72, 0x65, 0x61,
|
||||||
0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x6b, 0x69, 0x6c, 0x6c,
|
0x74, 0x10, 0x97, 0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x6c, 0x6f,
|
||||||
0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f,
|
0x72, 0x45, 0x72, 0x72, 0x10, 0x98, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x53,
|
||||||
0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9a, 0x0a, 0x12, 0x13,
|
0x6b, 0x69, 0x6c, 0x6c, 0x55, 0x70, 0x45, 0x72, 0x72, 0x10, 0x99, 0x0a, 0x12, 0x14, 0x0a, 0x0f,
|
||||||
0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65,
|
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10,
|
||||||
0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x74, 0x4e, 0x65,
|
0x9a, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x52, 0x65, 0x73, 0x6f,
|
||||||
0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c, 0x0a, 0x12, 0x11, 0x0a,
|
0x6e, 0x61, 0x74, 0x65, 0x10, 0x9b, 0x0a, 0x12, 0x18, 0x0a, 0x13, 0x48, 0x65, 0x72, 0x6f, 0x4e,
|
||||||
0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67, 0x79, 0x10, 0x9d, 0x0a,
|
0x6f, 0x74, 0x4e, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x6f, 0x6e, 0x61, 0x74, 0x65, 0x10, 0x9c,
|
||||||
0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x10, 0x9e,
|
0x0a, 0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4e, 0x6f, 0x45, 0x6e, 0x65, 0x72, 0x67,
|
||||||
0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75, 0x69, 0x70, 0x55, 0x70,
|
0x79, 0x10, 0x9d, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x72, 0x65, 0x61,
|
||||||
0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d,
|
0x74, 0x65, 0x10, 0x9e, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x71, 0x75,
|
||||||
0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12, 0x0f, 0x0a, 0x0a, 0x48,
|
0x69, 0x70, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x10, 0x9f, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48,
|
||||||
0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a, 0x12, 0x11, 0x0a, 0x0c,
|
0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x41, 0x77, 0x61, 0x6b, 0x65, 0x6e, 0x10, 0xa0, 0x0a, 0x12,
|
||||||
0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x10, 0xa2, 0x0a, 0x12,
|
0x0f, 0x0a, 0x0a, 0x48, 0x65, 0x72, 0x6f, 0x49, 0x73, 0x4c, 0x6f, 0x63, 0x6b, 0x10, 0xa1, 0x0a,
|
||||||
0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x73, 0x74, 0x54, 0x79, 0x70, 0x65, 0x45,
|
0x12, 0x11, 0x0a, 0x0c, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78, 0x43, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61,
|
0x10, 0xa2, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x48, 0x65, 0x72, 0x6f, 0x43, 0x6f, 0x73, 0x74, 0x54,
|
||||||
0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72, 0x6f, 0x54,
|
0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa3, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48, 0x65, 0x72,
|
||||||
0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72,
|
0x6f, 0x53, 0x74, 0x61, 0x72, 0x45, 0x72, 0x72, 0x10, 0xa4, 0x0a, 0x12, 0x10, 0x0a, 0x0b, 0x48,
|
||||||
0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa6, 0x0a, 0x12, 0x12,
|
0x65, 0x72, 0x6f, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10, 0xa5, 0x0a, 0x12, 0x13, 0x0a,
|
||||||
0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78, 0x45, 0x78, 0x70, 0x10,
|
0x0e, 0x48, 0x65, 0x72, 0x6f, 0x45, 0x78, 0x70, 0x54, 0x79, 0x70, 0x65, 0x45, 0x72, 0x72, 0x10,
|
||||||
0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76,
|
0xa6, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x41, 0x64, 0x64, 0x4d, 0x61, 0x78,
|
||||||
0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61,
|
0x45, 0x78, 0x70, 0x10, 0xa7, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65, 0x72, 0x6f, 0x53, 0x74,
|
||||||
0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19, 0x0a, 0x14, 0x44, 0x72,
|
0x61, 0x72, 0x4c, 0x76, 0x45, 0x72, 0x72, 0x10, 0xa8, 0x0a, 0x12, 0x12, 0x0a, 0x0d, 0x48, 0x65,
|
||||||
0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75,
|
0x72, 0x6f, 0x4d, 0x61, 0x78, 0x53, 0x74, 0x61, 0x72, 0x4c, 0x76, 0x10, 0xa9, 0x0a, 0x12, 0x19,
|
||||||
0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72, 0x6f, 0x4d, 0x61, 0x78,
|
0x0a, 0x14, 0x44, 0x72, 0x61, 0x77, 0x43, 0x61, 0x72, 0x64, 0x54, 0x79, 0x70, 0x65, 0x4e, 0x6f,
|
||||||
0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e, 0x0a, 0x19, 0x45, 0x71,
|
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xaa, 0x0a, 0x12, 0x13, 0x0a, 0x0e, 0x48, 0x65, 0x72,
|
||||||
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x45, 0x71,
|
0x6f, 0x4d, 0x61, 0x78, 0x53, 0x6b, 0x69, 0x6c, 0x6c, 0x4c, 0x76, 0x10, 0xab, 0x0a, 0x12, 0x1e,
|
||||||
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c, 0x0a, 0x17, 0x45, 0x71,
|
0x0a, 0x19, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4f, 0x6e, 0x46, 0x6f, 0x75,
|
||||||
0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x52, 0x65,
|
0x6e, 0x64, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x10, 0xf8, 0x0a, 0x12, 0x1c,
|
||||||
0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f, 0x45, 0x71, 0x75, 0x69,
|
0x0a, 0x17, 0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4c, 0x76, 0x6c, 0x69, 0x6d,
|
||||||
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10, 0xfa, 0x0a, 0x12, 0x1b,
|
0x69, 0x74, 0x52, 0x65, 0x61, 0x63, 0x68, 0x65, 0x64, 0x10, 0xf9, 0x0a, 0x12, 0x14, 0x0a, 0x0f,
|
||||||
0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x69, 0x6e,
|
0x45, 0x71, 0x75, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x73, 0x57, 0x6f, 0x72, 0x6e, 0x10,
|
||||||
0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d,
|
0xfa, 0x0a, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f,
|
||||||
0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69, 0x6c, 0x65, 0x64, 0x10,
|
0x74, 0x46, 0x69, 0x6e, 0x64, 0x43, 0x68, 0x61, 0x70, 0x74, 0x65, 0x72, 0x10, 0xdc, 0x0b, 0x12,
|
||||||
0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x4e, 0x6f,
|
0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x49, 0x44, 0x46, 0x61, 0x69,
|
||||||
0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a, 0x13, 0x4d, 0x61, 0x69,
|
0x6c, 0x65, 0x64, 0x10, 0xdd, 0x0b, 0x12, 0x15, 0x0a, 0x10, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69,
|
||||||
0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64,
|
0x6e, 0x65, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xde, 0x0b, 0x12, 0x18, 0x0a,
|
||||||
0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x52,
|
0x13, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x50, 0x72, 0x65, 0x4e, 0x6f, 0x74, 0x46,
|
||||||
0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe0, 0x0b, 0x12, 0x1b,
|
0x6f, 0x75, 0x6e, 0x64, 0x10, 0xdf, 0x0b, 0x12, 0x19, 0x0a, 0x14, 0x4d, 0x61, 0x69, 0x6e, 0x6c,
|
||||||
0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65,
|
0x69, 0x6e, 0x65, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10,
|
||||||
0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12, 0x0d, 0x0a, 0x08, 0x54,
|
0xe0, 0x0b, 0x12, 0x1b, 0x0a, 0x16, 0x4d, 0x61, 0x69, 0x6e, 0x6c, 0x69, 0x6e, 0x65, 0x43, 0x6f,
|
||||||
0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e, 0x0a, 0x09, 0x54, 0x61,
|
0x6d, 0x70, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x10, 0xe1, 0x0b, 0x12,
|
||||||
0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f, 0x0a, 0x0a, 0x54, 0x61,
|
0x0d, 0x0a, 0x08, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x6e, 0x69, 0x74, 0x10, 0xc0, 0x0c, 0x12, 0x0e,
|
||||||
0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54,
|
0x0a, 0x09, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x74, 0x10, 0xc1, 0x0c, 0x12, 0x0f,
|
||||||
0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10, 0xc3, 0x0c, 0x12, 0x13,
|
0x0a, 0x0a, 0x54, 0x61, 0x73, 0x6b, 0x48, 0x61, 0x6e, 0x64, 0x6c, 0x65, 0x10, 0xc2, 0x0c, 0x12,
|
||||||
0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x49, 0x6e, 0x69, 0x74,
|
0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x52, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, 0x10,
|
||||||
0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76,
|
0xc3, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65,
|
||||||
0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x54,
|
0x49, 0x6e, 0x69, 0x74, 0x10, 0xc4, 0x0c, 0x12, 0x16, 0x0a, 0x11, 0x54, 0x61, 0x73, 0x6b, 0x41,
|
||||||
0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65, 0x6e, 0x6f, 0x75, 0x67,
|
0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x66, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xc5, 0x0c, 0x12,
|
||||||
0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x46, 0x69,
|
0x17, 0x0a, 0x12, 0x54, 0x61, 0x73, 0x6b, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x4e, 0x6f, 0x65,
|
||||||
0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73,
|
0x6e, 0x6f, 0x75, 0x67, 0x68, 0x10, 0xc6, 0x0c, 0x12, 0x13, 0x0a, 0x0e, 0x54, 0x61, 0x73, 0x6b,
|
||||||
0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c, 0x12, 0x11, 0x0a, 0x0c,
|
0x4e, 0x6f, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc7, 0x0c, 0x12, 0x11, 0x0a,
|
||||||
0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xc9, 0x0c, 0x12,
|
0x0c, 0x54, 0x61, 0x73, 0x6b, 0x46, 0x69, 0x6e, 0x69, 0x73, 0x68, 0x65, 0x64, 0x10, 0xc8, 0x0c,
|
||||||
0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x10, 0xca,
|
0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x54, 0x61, 0x67, 0x45, 0x6d, 0x70, 0x74, 0x79,
|
||||||
0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e,
|
0x10, 0xc9, 0x0c, 0x12, 0x10, 0x0a, 0x0b, 0x54, 0x61, 0x73, 0x6b, 0x49, 0x64, 0x45, 0x6d, 0x70,
|
||||||
0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70, 0x47, 0x6f, 0x6f, 0x64,
|
0x74, 0x79, 0x10, 0xca, 0x0c, 0x12, 0x11, 0x0a, 0x0c, 0x54, 0x61, 0x73, 0x6b, 0x4e, 0x6f, 0x74,
|
||||||
0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4, 0x0d, 0x12, 0x1c, 0x0a,
|
0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10, 0xcb, 0x0c, 0x12, 0x17, 0x0a, 0x12, 0x53, 0x68, 0x6f, 0x70,
|
||||||
0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c, 0x75, 0x73, 0x52, 0x65,
|
0x47, 0x6f, 0x6f, 0x64, 0x73, 0x49, 0x73, 0x53, 0x6f, 0x6c, 0x64, 0x4f, 0x75, 0x74, 0x10, 0xa4,
|
||||||
0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12, 0x0c, 0x0a, 0x07, 0x4d,
|
0x0d, 0x12, 0x1c, 0x0a, 0x17, 0x53, 0x68, 0x6f, 0x70, 0x4e, 0x6f, 0x53, 0x75, 0x72, 0x70, 0x6c,
|
||||||
0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70,
|
0x75, 0x73, 0x52, 0x65, 0x66, 0x72, 0x65, 0x73, 0x68, 0x4e, 0x75, 0x6d, 0x10, 0xa5, 0x0d, 0x12,
|
||||||
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x0c, 0x0a, 0x07, 0x4d, 0x61, 0x69, 0x6c, 0x45, 0x72, 0x72, 0x10, 0x88, 0x0e, 0x12, 0x13, 0x0a,
|
||||||
|
0x0e, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4e, 0x6f, 0x74, 0x46, 0x6f, 0x75, 0x6e, 0x64, 0x10,
|
||||||
|
0xec, 0x0e, 0x12, 0x13, 0x0a, 0x0d, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x4c, 0x65, 0x76, 0x6c,
|
||||||
|
0x45, 0x72, 0x72, 0x10, 0xb9, 0x94, 0x01, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62,
|
||||||
|
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
176
pb/pagoda_db.pb.go
Normal file
176
pb/pagoda_db.pb.go
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.0
|
||||||
|
// protoc v3.20.0
|
||||||
|
// source: pagoda/pagoda_db.proto
|
||||||
|
|
||||||
|
package pb
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
type DBPagoda struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id" bson:"_id"` //ID
|
||||||
|
Uid string `protobuf:"bytes,2,opt,name=uid,proto3" json:"uid" bson:"uid"` //用户ID
|
||||||
|
PagodaId int32 `protobuf:"varint,3,opt,name=pagodaId,proto3" json:"pagodaId" bson:"pagodaId"` //塔层
|
||||||
|
Reward map[int32]bool `protobuf:"bytes,4,rep,name=reward,proto3" json:"reward" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // 是否领奖
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) Reset() {
|
||||||
|
*x = DBPagoda{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_db_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*DBPagoda) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *DBPagoda) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_db_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use DBPagoda.ProtoReflect.Descriptor instead.
|
||||||
|
func (*DBPagoda) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_db_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) GetId() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) GetUid() string {
|
||||||
|
if x != nil {
|
||||||
|
return x.Uid
|
||||||
|
}
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) GetPagodaId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.PagodaId
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *DBPagoda) GetReward() map[int32]bool {
|
||||||
|
if x != nil {
|
||||||
|
return x.Reward
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_pagoda_pagoda_db_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_pagoda_pagoda_db_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f,
|
||||||
|
0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb2, 0x01, 0x0a, 0x08, 0x44, 0x42, 0x50,
|
||||||
|
0x61, 0x67, 0x6f, 0x64, 0x61, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||||
|
0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
|
||||||
|
0x61, 0x49, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x6f, 0x64,
|
||||||
|
0x61, 0x49, 0x64, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x77, 0x61, 0x72, 0x64, 0x18, 0x04, 0x20,
|
||||||
|
0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2e, 0x52,
|
||||||
|
0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x06, 0x72, 0x65, 0x77, 0x61,
|
||||||
|
0x72, 0x64, 0x1a, 0x39, 0x0a, 0x0b, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x45, 0x6e, 0x74, 0x72,
|
||||||
|
0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03,
|
||||||
|
0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
0x28, 0x08, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x06, 0x5a,
|
||||||
|
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_pagoda_pagoda_db_proto_rawDescOnce sync.Once
|
||||||
|
file_pagoda_pagoda_db_proto_rawDescData = file_pagoda_pagoda_db_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_pagoda_pagoda_db_proto_rawDescGZIP() []byte {
|
||||||
|
file_pagoda_pagoda_db_proto_rawDescOnce.Do(func() {
|
||||||
|
file_pagoda_pagoda_db_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagoda_pagoda_db_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_pagoda_pagoda_db_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_pagoda_pagoda_db_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_pagoda_pagoda_db_proto_goTypes = []interface{}{
|
||||||
|
(*DBPagoda)(nil), // 0: DBPagoda
|
||||||
|
nil, // 1: DBPagoda.RewardEntry
|
||||||
|
}
|
||||||
|
var file_pagoda_pagoda_db_proto_depIdxs = []int32{
|
||||||
|
1, // 0: DBPagoda.reward:type_name -> DBPagoda.RewardEntry
|
||||||
|
1, // [1:1] is the sub-list for method output_type
|
||||||
|
1, // [1:1] is the sub-list for method input_type
|
||||||
|
1, // [1:1] is the sub-list for extension type_name
|
||||||
|
1, // [1:1] is the sub-list for extension extendee
|
||||||
|
0, // [0:1] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_pagoda_pagoda_db_proto_init() }
|
||||||
|
func file_pagoda_pagoda_db_proto_init() {
|
||||||
|
if File_pagoda_pagoda_db_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_pagoda_pagoda_db_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*DBPagoda); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_pagoda_pagoda_db_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_pagoda_pagoda_db_proto_goTypes,
|
||||||
|
DependencyIndexes: file_pagoda_pagoda_db_proto_depIdxs,
|
||||||
|
MessageInfos: file_pagoda_pagoda_db_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_pagoda_pagoda_db_proto = out.File
|
||||||
|
file_pagoda_pagoda_db_proto_rawDesc = nil
|
||||||
|
file_pagoda_pagoda_db_proto_goTypes = nil
|
||||||
|
file_pagoda_pagoda_db_proto_depIdxs = nil
|
||||||
|
}
|
457
pb/pagoda_msg.pb.go
Normal file
457
pb/pagoda_msg.pb.go
Normal file
@ -0,0 +1,457 @@
|
|||||||
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.28.0
|
||||||
|
// protoc v3.20.0
|
||||||
|
// source: pagoda/pagoda_msg.proto
|
||||||
|
|
||||||
|
package pb
|
||||||
|
|
||||||
|
import (
|
||||||
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
|
// 查询塔进度
|
||||||
|
type PagodaGetListReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetListReq) Reset() {
|
||||||
|
*x = PagodaGetListReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetListReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaGetListReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaGetListReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaGetListReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaGetListReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{0}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 返回进度信息
|
||||||
|
type PagodaGetListResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetListResp) Reset() {
|
||||||
|
*x = PagodaGetListResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetListResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaGetListResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaGetListResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaGetListResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaGetListResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{1}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetListResp) GetData() *DBPagoda {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 领取关卡宝箱
|
||||||
|
type PagodaGetRewardReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id"` // 对应 task_reward 表中的id
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardReq) Reset() {
|
||||||
|
*x = PagodaGetRewardReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[2]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaGetRewardReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[2]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaGetRewardReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaGetRewardReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{2}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardReq) GetId() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.Id
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type PagodaGetRewardResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardResp) Reset() {
|
||||||
|
*x = PagodaGetRewardResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[3]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaGetRewardResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[3]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaGetRewardResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaGetRewardResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{3}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaGetRewardResp) GetData() *DBPagoda {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
// 挑战
|
||||||
|
type PagodaChallengeReq struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
LevelID int32 `protobuf:"varint,1,opt,name=levelID,proto3" json:"levelID"` // 挑战的关卡ID
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeReq) Reset() {
|
||||||
|
*x = PagodaChallengeReq{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[4]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeReq) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaChallengeReq) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeReq) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[4]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaChallengeReq.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaChallengeReq) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{4}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeReq) GetLevelID() int32 {
|
||||||
|
if x != nil {
|
||||||
|
return x.LevelID
|
||||||
|
}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
type PagodaChallengeResp struct {
|
||||||
|
state protoimpl.MessageState
|
||||||
|
sizeCache protoimpl.SizeCache
|
||||||
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
|
Data *DBPagoda `protobuf:"bytes,1,opt,name=data,proto3" json:"data"`
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeResp) Reset() {
|
||||||
|
*x = PagodaChallengeResp{}
|
||||||
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[5]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeResp) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*PagodaChallengeResp) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeResp) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_pagoda_pagoda_msg_proto_msgTypes[5]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use PagodaChallengeResp.ProtoReflect.Descriptor instead.
|
||||||
|
func (*PagodaChallengeResp) Descriptor() ([]byte, []int) {
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescGZIP(), []int{5}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *PagodaChallengeResp) GetData() *DBPagoda {
|
||||||
|
if x != nil {
|
||||||
|
return x.Data
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
var File_pagoda_pagoda_msg_proto protoreflect.FileDescriptor
|
||||||
|
|
||||||
|
var file_pagoda_pagoda_msg_proto_rawDesc = []byte{
|
||||||
|
0x0a, 0x17, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f,
|
||||||
|
0x6d, 0x73, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x16, 0x70, 0x61, 0x67, 0x6f, 0x64,
|
||||||
|
0x61, 0x2f, 0x70, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
|
0x6f, 0x22, 0x12, 0x0a, 0x10, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x4c, 0x69,
|
||||||
|
0x73, 0x74, 0x52, 0x65, 0x71, 0x22, 0x32, 0x0a, 0x11, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47,
|
||||||
|
0x65, 0x74, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61,
|
||||||
|
0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67,
|
||||||
|
0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x24, 0x0a, 0x12, 0x50, 0x61, 0x67,
|
||||||
|
0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12,
|
||||||
|
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x69, 0x64, 0x22,
|
||||||
|
0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x47, 0x65, 0x74, 0x52, 0x65, 0x77, 0x61,
|
||||||
|
0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x52,
|
||||||
|
0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x2e, 0x0a, 0x12, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43,
|
||||||
|
0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x71, 0x12, 0x18, 0x0a, 0x07, 0x6c,
|
||||||
|
0x65, 0x76, 0x65, 0x6c, 0x49, 0x44, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x6c, 0x65,
|
||||||
|
0x76, 0x65, 0x6c, 0x49, 0x44, 0x22, 0x34, 0x0a, 0x13, 0x50, 0x61, 0x67, 0x6f, 0x64, 0x61, 0x43,
|
||||||
|
0x68, 0x61, 0x6c, 0x6c, 0x65, 0x6e, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1d, 0x0a, 0x04,
|
||||||
|
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x09, 0x2e, 0x44, 0x42, 0x50,
|
||||||
|
0x61, 0x67, 0x6f, 0x64, 0x61, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x42, 0x06, 0x5a, 0x04, 0x2e,
|
||||||
|
0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
|
}
|
||||||
|
|
||||||
|
var (
|
||||||
|
file_pagoda_pagoda_msg_proto_rawDescOnce sync.Once
|
||||||
|
file_pagoda_pagoda_msg_proto_rawDescData = file_pagoda_pagoda_msg_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
|
func file_pagoda_pagoda_msg_proto_rawDescGZIP() []byte {
|
||||||
|
file_pagoda_pagoda_msg_proto_rawDescOnce.Do(func() {
|
||||||
|
file_pagoda_pagoda_msg_proto_rawDescData = protoimpl.X.CompressGZIP(file_pagoda_pagoda_msg_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_pagoda_pagoda_msg_proto_rawDescData
|
||||||
|
}
|
||||||
|
|
||||||
|
var file_pagoda_pagoda_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
|
||||||
|
var file_pagoda_pagoda_msg_proto_goTypes = []interface{}{
|
||||||
|
(*PagodaGetListReq)(nil), // 0: PagodaGetListReq
|
||||||
|
(*PagodaGetListResp)(nil), // 1: PagodaGetListResp
|
||||||
|
(*PagodaGetRewardReq)(nil), // 2: PagodaGetRewardReq
|
||||||
|
(*PagodaGetRewardResp)(nil), // 3: PagodaGetRewardResp
|
||||||
|
(*PagodaChallengeReq)(nil), // 4: PagodaChallengeReq
|
||||||
|
(*PagodaChallengeResp)(nil), // 5: PagodaChallengeResp
|
||||||
|
(*DBPagoda)(nil), // 6: DBPagoda
|
||||||
|
}
|
||||||
|
var file_pagoda_pagoda_msg_proto_depIdxs = []int32{
|
||||||
|
6, // 0: PagodaGetListResp.data:type_name -> DBPagoda
|
||||||
|
6, // 1: PagodaGetRewardResp.data:type_name -> DBPagoda
|
||||||
|
6, // 2: PagodaChallengeResp.data:type_name -> DBPagoda
|
||||||
|
3, // [3:3] is the sub-list for method output_type
|
||||||
|
3, // [3:3] is the sub-list for method input_type
|
||||||
|
3, // [3:3] is the sub-list for extension type_name
|
||||||
|
3, // [3:3] is the sub-list for extension extendee
|
||||||
|
0, // [0:3] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
|
func init() { file_pagoda_pagoda_msg_proto_init() }
|
||||||
|
func file_pagoda_pagoda_msg_proto_init() {
|
||||||
|
if File_pagoda_pagoda_msg_proto != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_db_proto_init()
|
||||||
|
if !protoimpl.UnsafeEnabled {
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaGetListReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaGetListResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaGetRewardReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaGetRewardResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaChallengeReq); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_pagoda_pagoda_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*PagodaChallengeResp); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_pagoda_pagoda_msg_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 6,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 0,
|
||||||
|
},
|
||||||
|
GoTypes: file_pagoda_pagoda_msg_proto_goTypes,
|
||||||
|
DependencyIndexes: file_pagoda_pagoda_msg_proto_depIdxs,
|
||||||
|
MessageInfos: file_pagoda_pagoda_msg_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_pagoda_pagoda_msg_proto = out.File
|
||||||
|
file_pagoda_pagoda_msg_proto_rawDesc = nil
|
||||||
|
file_pagoda_pagoda_msg_proto_goTypes = nil
|
||||||
|
file_pagoda_pagoda_msg_proto_depIdxs = nil
|
||||||
|
}
|
@ -5,6 +5,7 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"go_dreamfactory/comm"
|
"go_dreamfactory/comm"
|
||||||
"go_dreamfactory/pb"
|
"go_dreamfactory/pb"
|
||||||
|
"go_dreamfactory/sys/db"
|
||||||
"reflect"
|
"reflect"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
@ -85,6 +86,7 @@ func (this *SCompGateRoute) Init(service core.IService, comp core.IServiceComp,
|
|||||||
//组件启动时注册rpc服务监听
|
//组件启动时注册rpc服务监听
|
||||||
func (this *SCompGateRoute) Start() (err error) {
|
func (this *SCompGateRoute) Start() (err error) {
|
||||||
this.service.RegisterFunctionName(string(comm.Rpc_GatewayRoute), this.ReceiveMsg) //注册网关路由接收接口
|
this.service.RegisterFunctionName(string(comm.Rpc_GatewayRoute), this.ReceiveMsg) //注册网关路由接收接口
|
||||||
|
this.service.RegisterFunctionName(string(comm.Rpc_GatewayNoticeUserLogin), this.NoticeUserLogin) //注册用户登录通知
|
||||||
this.service.RegisterFunctionName(string(comm.Rpc_GatewayNoticeUserClose), this.NoticeUserClose) //注册用户离线通知
|
this.service.RegisterFunctionName(string(comm.Rpc_GatewayNoticeUserClose), this.NoticeUserClose) //注册用户离线通知
|
||||||
err = this.ServiceCompBase.Start()
|
err = this.ServiceCompBase.Start()
|
||||||
return
|
return
|
||||||
@ -181,6 +183,19 @@ func (this *SCompGateRoute) ReceiveMsg(ctx context.Context, args *pb.AgentMessag
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//RPC_NoticeUserClose 接收用户登录通知
|
||||||
|
func (this *SCompGateRoute) NoticeUserLogin(ctx context.Context, args *pb.NoticeUserLoginReq, reply *pb.RPCMessageReply) error {
|
||||||
|
model := db.NewDBModel(comm.TableSession, db.Local())
|
||||||
|
model.Change(args.UserId, map[string]interface{}{
|
||||||
|
"uid": args.UserId,
|
||||||
|
"sessionId": args.UserSessionId,
|
||||||
|
"serviceTag": args.ServiceTag,
|
||||||
|
"gatewayServiceId": args.GatewayServiceId,
|
||||||
|
"ip": args.Ip,
|
||||||
|
})
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
//RPC_NoticeUserClose 接收用户离线通知
|
//RPC_NoticeUserClose 接收用户离线通知
|
||||||
func (this *SCompGateRoute) NoticeUserClose(ctx context.Context, args *pb.NoticeUserCloseReq, reply *pb.RPCMessageReply) error {
|
func (this *SCompGateRoute) NoticeUserClose(ctx context.Context, args *pb.NoticeUserCloseReq, reply *pb.RPCMessageReply) error {
|
||||||
session := this.pools.Get().(comm.IUserSession)
|
session := this.pools.Get().(comm.IUserSession)
|
||||||
|
@ -190,7 +190,7 @@ func (this *DBModel) AddLists(uid string, data interface{}, opt ...DBOption) (er
|
|||||||
}
|
}
|
||||||
listskeys := make(map[string]string)
|
listskeys := make(map[string]string)
|
||||||
keys := vof.MapKeys()
|
keys := vof.MapKeys()
|
||||||
lists := make([]interface{}, len(keys))
|
lists := make([]interface{}, 0, len(keys))
|
||||||
pipe := this.Redis.RedisPipe(context.TODO())
|
pipe := this.Redis.RedisPipe(context.TODO())
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
value := vof.MapIndex(k)
|
value := vof.MapIndex(k)
|
||||||
@ -199,6 +199,7 @@ func (this *DBModel) AddLists(uid string, data interface{}, opt ...DBOption) (er
|
|||||||
key := this.ukeylist(uid, keydata)
|
key := this.ukeylist(uid, keydata)
|
||||||
pipe.HMSet(key, valuedata)
|
pipe.HMSet(key, valuedata)
|
||||||
listskeys[keydata] = key
|
listskeys[keydata] = key
|
||||||
|
lists = append(lists, valuedata)
|
||||||
}
|
}
|
||||||
pipe.HMSetForMap(this.ukey(uid), listskeys)
|
pipe.HMSetForMap(this.ukey(uid), listskeys)
|
||||||
if _, err = pipe.Exec(); err != nil {
|
if _, err = pipe.Exec(); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user