优化rpcx系统握手连接机制,避免重复连接情况,优化日志系统,错误日志自动输出错误文件以及行号

This commit is contained in:
liwei1dao 2022-08-10 18:42:06 +08:00
parent 3132135e6f
commit 0712c670fe
29 changed files with 659 additions and 703 deletions

View File

@ -50,10 +50,17 @@
"text": "故事发生在很久以前的古代中国,而且要从一只喜欢滚来滚去、滚来滚去的大熊猫身上说起。" "text": "故事发生在很久以前的古代中国,而且要从一只喜欢滚来滚去、滚来滚去的大熊猫身上说起。"
}, },
"stroyid": [ "stroyid": [
3,
3,
3,
-1,
3 3
], ],
"condition": [ "condition": [
0 0,
1,
2,
4
] ]
}, },
{ {

View File

@ -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": "聊天消息发送"
} }
] ]

View File

@ -100,6 +100,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" //发布聊天系统消息

View File

@ -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)
} }

View File

@ -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) {

View File

@ -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
} }

View File

@ -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 {

View File

@ -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

View 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
} }
@ -103,7 +103,7 @@ func newOptions(config map[string]interface{}, opts ...Option) (options *Options
Compress: false, Compress: false,
Encoder: TextEncoder, Encoder: TextEncoder,
CallerSkip: 0, CallerSkip: 0,
ReportCaller: false, ReportCaller: ErrorLevel,
IsDebug: true, IsDebug: true,
} }
if config != nil { if config != nil {
@ -129,7 +129,7 @@ func newOptionsByOption(opts ...Option) (options *Options, err error) {
Compress: false, Compress: false,
Encoder: TextEncoder, Encoder: TextEncoder,
CallerSkip: 0, CallerSkip: 0,
ReportCaller: false, ReportCaller: ErrorLevel,
IsDebug: true, IsDebug: true,
} }
for _, o := range opts { for _, o := range opts {

View File

@ -22,26 +22,30 @@ 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推送消息
@ -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,17 +255,18 @@ 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{ if err := this.Call(context.Background(), fmt.Sprintf("%s/%s", v.ServiceType, v.ServiceId), RpcX_ShakeHands, &ServiceNode{
ServiceTag: this.options.ServiceTag, ServiceTag: this.options.ServiceTag,
ServiceId: this.options.ServiceId, ServiceId: this.options.ServiceId,
@ -262,14 +274,36 @@ func (this *Client) UpdateServer(servers map[string]*ServiceNode) {
ServiceAddr: this.options.ServiceAddr}, ServiceAddr: this.options.ServiceAddr},
&ServiceNode{}); err != nil { &ServiceNode{}); err != nil {
this.options.Log.Errorf("ShakeHands new node addr:%s err:%v", v.ServiceAddr, err) 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 { } else {
this.options.Log.Debugf("UpdateServer addr:%s ", v.ServiceAddr) 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,

View File

@ -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)
} }

View File

@ -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

View File

@ -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

View File

@ -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()

View File

@ -9,7 +9,9 @@ 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
} }
@ -17,17 +19,18 @@ func (this *apiComp) GetListCheck(session comm.IUserSession, req *pb.ChatGetList
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
result *pb.DBUserExpand
list []*pb.DBChat 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

View File

@ -24,23 +24,19 @@ func (this *apiComp) Send(session comm.IUserSession, req *pb.ChatSendReq) (code
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

View File

@ -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
}

View File

@ -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
}

View File

@ -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
} }

View File

@ -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

View File

@ -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
} }

View File

@ -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)

View File

@ -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

View File

@ -84,13 +84,13 @@ type DBChat struct {
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
Avatar string `protobuf:"bytes,8,opt,name=avatar,proto3" json:"avatar"` //用户头像 Stag string `protobuf:"bytes,8,opt,name=stag,proto3" json:"stag"` //区服id
Uname string `protobuf:"bytes,9,opt,name=uname,proto3" json:"uname"` //用户名 Avatar string `protobuf:"bytes,9,opt,name=avatar,proto3" json:"avatar"` //用户头像
Content string `protobuf:"bytes,10,opt,name=content,proto3" json:"content"` //内容 Uname string `protobuf:"bytes,10,opt,name=uname,proto3" json:"uname"` //用户名
Ctime int64 `protobuf:"varint,11,opt,name=ctime,proto3" json:"ctime"` //创建时间 Content string `protobuf:"bytes,11,opt,name=content,proto3" json:"content"` //内容
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 (

View File

@ -266,6 +266,7 @@ type ChatGetListReq struct {
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,
}, },

View File

@ -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,
}, },

View File

@ -1379,6 +1379,101 @@ func (x *FriendTotalResp) GetTotal() int32 {
return 0 return 0
} }
// 点赞
type FriendZanReq struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FriendId string `protobuf:"bytes,1,opt,name=friendId,proto3" json:"friendId"`
}
func (x *FriendZanReq) Reset() {
*x = FriendZanReq{}
if protoimpl.UnsafeEnabled {
mi := &file_friend_friend_msg_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FriendZanReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FriendZanReq) ProtoMessage() {}
func (x *FriendZanReq) ProtoReflect() protoreflect.Message {
mi := &file_friend_friend_msg_proto_msgTypes[27]
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 FriendZanReq.ProtoReflect.Descriptor instead.
func (*FriendZanReq) Descriptor() ([]byte, []int) {
return file_friend_friend_msg_proto_rawDescGZIP(), []int{27}
}
func (x *FriendZanReq) GetFriendId() string {
if x != nil {
return x.FriendId
}
return ""
}
type FriendZanResp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Flag bool `protobuf:"varint,1,opt,name=flag,proto3" json:"flag"`
}
func (x *FriendZanResp) Reset() {
*x = FriendZanResp{}
if protoimpl.UnsafeEnabled {
mi := &file_friend_friend_msg_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *FriendZanResp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*FriendZanResp) ProtoMessage() {}
func (x *FriendZanResp) ProtoReflect() protoreflect.Message {
mi := &file_friend_friend_msg_proto_msgTypes[28]
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 FriendZanResp.ProtoReflect.Descriptor instead.
func (*FriendZanResp) Descriptor() ([]byte, []int) {
return file_friend_friend_msg_proto_rawDescGZIP(), []int{28}
}
func (x *FriendZanResp) GetFlag() bool {
if x != nil {
return x.Flag
}
return false
}
var File_friend_friend_msg_proto protoreflect.FileDescriptor var File_friend_friend_msg_proto protoreflect.FileDescriptor
var file_friend_friend_msg_proto_rawDesc = []byte{ var file_friend_friend_msg_proto_rawDesc = []byte{
@ -1479,8 +1574,13 @@ var file_friend_friend_msg_proto_rawDesc = []byte{
0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x74, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69, 0x65, 0x6e,
0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x64, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01,
0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x28, 0x05, 0x52, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0x2a, 0x0a, 0x0c, 0x46, 0x72, 0x69,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x65, 0x6e, 0x64, 0x5a, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x66, 0x72, 0x69,
0x65, 0x6e, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x66, 0x72, 0x69,
0x65, 0x6e, 0x64, 0x49, 0x64, 0x22, 0x23, 0x0a, 0x0d, 0x46, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x5a,
0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x18, 0x01,
0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x6c, 0x61, 0x67, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b,
0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -1495,7 +1595,7 @@ func file_friend_friend_msg_proto_rawDescGZIP() []byte {
return file_friend_friend_msg_proto_rawDescData return file_friend_friend_msg_proto_rawDescData
} }
var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 27) var file_friend_friend_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 29)
var file_friend_friend_msg_proto_goTypes = []interface{}{ var file_friend_friend_msg_proto_goTypes = []interface{}{
(*FriendBase)(nil), // 0: FriendBase (*FriendBase)(nil), // 0: FriendBase
(*FriendListReq)(nil), // 1: FriendListReq (*FriendListReq)(nil), // 1: FriendListReq
@ -1524,6 +1624,8 @@ var file_friend_friend_msg_proto_goTypes = []interface{}{
(*FriendGiveResp)(nil), // 24: FriendGiveResp (*FriendGiveResp)(nil), // 24: FriendGiveResp
(*FriendTotalReq)(nil), // 25: FriendTotalReq (*FriendTotalReq)(nil), // 25: FriendTotalReq
(*FriendTotalResp)(nil), // 26: FriendTotalResp (*FriendTotalResp)(nil), // 26: FriendTotalResp
(*FriendZanReq)(nil), // 27: FriendZanReq
(*FriendZanResp)(nil), // 28: FriendZanResp
} }
var file_friend_friend_msg_proto_depIdxs = []int32{ var file_friend_friend_msg_proto_depIdxs = []int32{
0, // 0: FriendListResp.list:type_name -> FriendBase 0, // 0: FriendListResp.list:type_name -> FriendBase
@ -1867,6 +1969,30 @@ func file_friend_friend_msg_proto_init() {
return nil return nil
} }
} }
file_friend_friend_msg_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FriendZanReq); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_friend_friend_msg_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*FriendZanResp); 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{
@ -1874,7 +2000,7 @@ func file_friend_friend_msg_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(), GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_friend_friend_msg_proto_rawDesc, RawDescriptor: file_friend_friend_msg_proto_rawDesc,
NumEnums: 0, NumEnums: 0,
NumMessages: 27, NumMessages: 29,
NumExtensions: 0, NumExtensions: 0,
NumServices: 0, NumServices: 0,
}, },

View File

@ -1061,6 +1061,7 @@ type UserModifynameResp struct {
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"` Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid"`
Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` //剩余修改次数 Count uint32 `protobuf:"varint,2,opt,name=count,proto3" json:"count"` //剩余修改次数
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name"`
} }
func (x *UserModifynameResp) Reset() { func (x *UserModifynameResp) Reset() {
@ -1109,6 +1110,13 @@ func (x *UserModifynameResp) GetCount() uint32 {
return 0 return 0
} }
func (x *UserModifynameResp) GetName() string {
if x != nil {
return x.Name
}
return ""
}
// 图鉴 // 图鉴
type UserGetTujianReq struct { type UserGetTujianReq struct {
state protoimpl.MessageState state protoimpl.MessageState
@ -1587,46 +1595,47 @@ var file_user_user_msg_proto_rawDesc = []byte{
0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x03, 0x75, 0x69, 0x64, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69,
0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x3c, 0x0a, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a,
0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x6e, 0x61, 0x6d, 0x65, 0x52,
0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x12, 0x0a, 0x10, 0x55, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e,
0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x71, 0x22, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,
0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e, 0x12, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75, 0x6a, 0x69, 0x61, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x18, 0x52, 0x65, 0x71, 0x22, 0x2d, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x47, 0x65, 0x74, 0x54, 0x75,
0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69, 0x64, 0x73, 0x22, 0x45, 0x6a, 0x69, 0x61, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x68, 0x65, 0x72, 0x6f,
0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x64, 0x50, 0x75, 0x73, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x68, 0x65, 0x72, 0x6f, 0x69,
0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x64, 0x73, 0x22, 0x45, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x64, 0x50, 0x75, 0x73, 0x68, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18, 0x03, 0x20, 0x01, 0x28, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x65, 0x78, 0x70, 0x18, 0x02,
0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x65, 0x78, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x6c, 0x76, 0x18,
0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x02, 0x6c, 0x76, 0x22, 0xe3, 0x01, 0x0a, 0x0d, 0x55, 0x73,
0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x72, 0x65, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x71, 0x12, 0x1e, 0x0a, 0x0a, 0x70,
0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x0a, 0x70, 0x72, 0x65, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6c, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x61,
0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74,
0x48, 0x61, 0x69, 0x72, 0x52, 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19, 0x0a, 0x04, 0x65, 0x79, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x04, 0x68, 0x61, 0x69, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28,
0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45, 0x79, 0x65, 0x73, 0x52, 0x0b, 0x32, 0x05, 0x2e, 0x48, 0x61, 0x69, 0x72, 0x52, 0x04, 0x68, 0x61, 0x69, 0x72, 0x12, 0x19,
0x04, 0x65, 0x79, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x18, 0x05, 0x0a, 0x04, 0x65, 0x79, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x45,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68, 0x52, 0x05, 0x6d, 0x6f, 0x79, 0x65, 0x73, 0x52, 0x04, 0x65, 0x79, 0x65, 0x73, 0x12, 0x1c, 0x0a, 0x05, 0x6d, 0x6f, 0x75,
0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x74, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x4d, 0x6f, 0x75, 0x74, 0x68,
0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x2b, 0x52, 0x05, 0x6d, 0x6f, 0x75, 0x74, 0x68, 0x12, 0x19, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18,
0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x42, 0x6f, 0x64, 0x79, 0x52, 0x04, 0x62, 0x6f,
0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x52, 0x64, 0x79, 0x12, 0x2b, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e,
0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22, 0x5b, 0x0a, 0x0e, 0x55, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x43, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78,
0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x6c, 0x65, 0x78, 0x69, 0x6f, 0x6e, 0x22,
0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x5b, 0x0a, 0x0e, 0x55, 0x73, 0x65, 0x72, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x52, 0x65, 0x73,
0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x75, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69, 0x67, 0x75, 0x72, 0x65, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x06, 0x66,
0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11, 0x55, 0x73, 0x65, 0x72, 0x69, 0x67, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x07, 0x2e, 0x46, 0x69,
0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x67, 0x75, 0x72, 0x65, 0x52, 0x06, 0x66, 0x69, 0x67, 0x75, 0x72, 0x65, 0x22, 0x27, 0x0a, 0x11,
0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x73, 0x69, 0x67, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65,
0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x73, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, 0x01, 0x04, 0x73, 0x69, 0x67, 0x6e, 0x22, 0x26, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x6f, 0x64,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x69, 0x66, 0x79, 0x73, 0x69, 0x67, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x75,
0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x69, 0x64, 0x42, 0x06, 0x5a,
0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

View File

@ -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)