From e85463c4a144a1bbcc0a88a1ef4f00b8e326edb1 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 20 Sep 2022 23:31:28 +0800 Subject: [PATCH 01/15] update proto --- go.mod | 1 - go.sum | 2 -- pkg/proto/admin_cms/admin_cms.proto | 2 +- pkg/proto/auth/auth.proto | 2 +- pkg/proto/auto_proto.sh | 6 +++--- pkg/proto/cache/cache.proto | 2 +- pkg/proto/friend/friend.proto | 2 +- pkg/proto/group/group.proto | 4 ++-- pkg/proto/msg/msg.proto | 2 +- pkg/proto/office/office.proto | 2 +- pkg/proto/organization/organization.proto | 2 +- pkg/proto/proto_dir.cfg | 6 +++++- pkg/proto/push/push.proto | 2 +- pkg/proto/relay/relay.proto | 2 +- pkg/proto/sdk_ws/ws.proto | 2 +- pkg/proto/user/user.proto | 4 ++-- 16 files changed, 22 insertions(+), 21 deletions(-) diff --git a/go.mod b/go.mod index 6a51cfc08..200c0dcf3 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,6 @@ require ( github.com/go-playground/validator/v10 v10.11.0 github.com/go-redis/redis/v8 v8.11.5 github.com/gogo/protobuf v1.3.2 - github.com/golang-jwt/jwt/v4 v4.1.0 github.com/golang/protobuf v1.5.2 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 diff --git a/go.sum b/go.sum index e1f5a8e7f..59f0cdfb4 100644 --- a/go.sum +++ b/go.sum @@ -249,8 +249,6 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.1.0 h1:XUgk2Ex5veyVFVeLm0xhusUTQybEbexJXrvPNOKkSY0= -github.com/golang-jwt/jwt/v4 v4.1.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff --git a/pkg/proto/admin_cms/admin_cms.proto b/pkg/proto/admin_cms/admin_cms.proto index 4f11aab01..bf1de9f53 100644 --- a/pkg/proto/admin_cms/admin_cms.proto +++ b/pkg/proto/admin_cms/admin_cms.proto @@ -1,6 +1,6 @@ syntax = "proto3"; option go_package = "./admin_cms;admin_cms"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; package admin_cms; diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index 675aa1a02..bc4eaecf9 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; package pbAuth; option go_package = "./auth;pbAuth"; diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 7ecece08e..3f0d03061 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -6,12 +6,12 @@ for ((i = 0; i < ${#all_proto[*]}; i++)); do proto=${all_proto[$i]} protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto - s=`echo $proto | sed 's/ //g'` - v=${s//proto/pb.go} - protoc-go-inject-tag -input=./$v echo "protoc --go_out=plugins=grpc:." $proto done echo "proto file generate success..." find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' + + + diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto index 7e1eeabdf..f8bf74524 100644 --- a/pkg/proto/cache/cache.proto +++ b/pkg/proto/cache/cache.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./cache;cache"; package cache; diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 8f7827edc..10314d92a 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./friend;friend"; package friend; diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index 852dbba5b..93a96eaff 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; -import "Open_IM/pkg/proto/sdk_ws/wrappers.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto"; option go_package = "./group;group"; package group; diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index a15a4f3c8..837df4754 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./msg;msg"; package msg; diff --git a/pkg/proto/office/office.proto b/pkg/proto/office/office.proto index 78e1e3517..65e9a7847 100644 --- a/pkg/proto/office/office.proto +++ b/pkg/proto/office/office.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./office;office"; package office; diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto index ef7aedbf7..8de98c820 100644 --- a/pkg/proto/organization/organization.proto +++ b/pkg/proto/organization/organization.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./organization;organization"; package organization; diff --git a/pkg/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg index 99b94de97..854938208 100644 --- a/pkg/proto/proto_dir.cfg +++ b/pkg/proto/proto_dir.cfg @@ -8,9 +8,13 @@ all_proto=( group/group.proto user/user.proto rtc/rtc.proto - chat/chat.proto + msg/msg.proto push/push.proto relay/relay.proto sdk_ws/ws.proto conversation/conversation.proto + office/office.proto + cache/cache.proto + organization/organization.proto + ) diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index 5d91083b3..0954e8bc5 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./push;pbPush"; package push; diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 556cd9686..7d7dd932d 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./relay;pbRelay"; package relay; diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 5ade79c60..6c0500c09 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/wrappers.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto"; option go_package = "./sdk_ws;server_api_params"; package server_api_params; diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index 39fff9f27..a32b6a594 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -1,6 +1,6 @@ syntax = "proto3"; -import "Open_IM/pkg/proto/sdk_ws/ws.proto"; -import "Open_IM/pkg/proto/conversation/conversation.proto"; +import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; +import "Open-IM-Server/pkg/proto/conversation/conversation.proto"; option go_package = "./user;user"; package user; From 0a8347001914b68dedac7c18ccdb89bad0bc22cd Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Tue, 20 Sep 2022 23:33:46 +0800 Subject: [PATCH 02/15] update proto --- pkg/common/token_verify/jwt_token.go | 15 +-------------- pkg/proto/cache/cache.proto | 1 - 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index 20942faf2..ae5fdaceb 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -6,10 +6,10 @@ import ( commonDB "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/utils" + "golang.org/x/oauth2/jwt" "time" go_redis "github.com/go-redis/redis/v8" - "github.com/golang-jwt/jwt/v4" ) //var ( @@ -179,19 +179,6 @@ func ParseTokenGetUserID(token string, operationID string) (error, string) { func ParseToken(tokensString, operationID string) (claims *Claims, err error) { claims, err = GetClaimFromToken(tokensString) if err != nil { - //if errors.Is(err, constant.ErrTokenUnknown) { - // errMsg := "GetClaimFromToken failed ErrTokenUnknown " + err.Error() - // log.Error(operationID, errMsg) - //} - //info := err.(constant.ErrInfo) - //log.Error(operationID, "detail info , ", info.ErrCode, info.ErrMsg) - // - //e := errors.Unwrap(err) - //if errors.Is(e, constant.ErrTokenUnknown) { - // errMsg := "ParseToken failed ErrTokenUnknown " + e.Error() - // log.Error(operationID, errMsg) - //} - return nil, utils.Wrap(err, "") } diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto index f8bf74524..f6c3c081a 100644 --- a/pkg/proto/cache/cache.proto +++ b/pkg/proto/cache/cache.proto @@ -1,5 +1,4 @@ syntax = "proto3"; -import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; option go_package = "./cache;cache"; package cache; From 5e9f1ac00f684e0dbee1cb6e9dfc38df048930b2 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 08:36:33 +0800 Subject: [PATCH 03/15] update proto --- go.mod | 1 + pkg/proto/admin_cms/admin_cms.proto | 2 +- pkg/proto/auth/auth.proto | 2 +- pkg/proto/cache/cache.proto | 2 +- pkg/proto/conversation/conversation.proto | 2 +- pkg/proto/friend/friend.proto | 2 +- pkg/proto/group/group.proto | 2 +- pkg/proto/msg/msg.proto | 2 +- pkg/proto/office/office.proto | 2 +- pkg/proto/organization/organization.proto | 2 +- pkg/proto/push/push.proto | 2 +- pkg/proto/relay/relay.proto | 2 +- pkg/proto/rtc/rtc.proto | 2 +- pkg/proto/sdk_ws/ws.proto | 2 +- pkg/proto/user/user.proto | 2 +- 15 files changed, 15 insertions(+), 14 deletions(-) diff --git a/go.mod b/go.mod index 200c0dcf3..6d98b054e 100644 --- a/go.mod +++ b/go.mod @@ -58,6 +58,7 @@ require ( golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/image v0.0.0-20211028202545-6944b10bf410 golang.org/x/net v0.0.0-20220622184535-263ec571b305 + golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect golang.org/x/tools v0.1.11 // indirect google.golang.org/api v0.59.0 diff --git a/pkg/proto/admin_cms/admin_cms.proto b/pkg/proto/admin_cms/admin_cms.proto index bf1de9f53..d0b59a716 100644 --- a/pkg/proto/admin_cms/admin_cms.proto +++ b/pkg/proto/admin_cms/admin_cms.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "./admin_cms;admin_cms"; +option go_package = "Open_IM/pkg/proto/admin_cms;admin_cms"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; package admin_cms; diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index bc4eaecf9..0b4595cba 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -1,7 +1,7 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; package pbAuth; -option go_package = "./auth;pbAuth"; +option go_package = "Open_IM/pkg/proto/auth;pbAuth"; message CommonResp{ int32 errCode = 1; diff --git a/pkg/proto/cache/cache.proto b/pkg/proto/cache/cache.proto index f6c3c081a..970a77a58 100644 --- a/pkg/proto/cache/cache.proto +++ b/pkg/proto/cache/cache.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "./cache;cache"; +option go_package = "Open_IM/pkg/proto/cache;cache"; package cache; message CommonResp{ diff --git a/pkg/proto/conversation/conversation.proto b/pkg/proto/conversation/conversation.proto index 48973fdc1..e8447f1b0 100644 --- a/pkg/proto/conversation/conversation.proto +++ b/pkg/proto/conversation/conversation.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "./conversation;conversation"; +option go_package = "Open_IM/pkg/proto/conversation;conversation"; package conversation; message CommonResp{ diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 10314d92a..00d07f17a 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./friend;friend"; +option go_package = "Open_IM/pkg/proto/friend;friend"; package friend; message CommonResp{ diff --git a/pkg/proto/group/group.proto b/pkg/proto/group/group.proto index 93a96eaff..412f6c73b 100644 --- a/pkg/proto/group/group.proto +++ b/pkg/proto/group/group.proto @@ -1,7 +1,7 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto"; -option go_package = "./group;group"; +option go_package = "Open_IM/pkg/proto/group;group"; package group; message CommonResp{ diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index 837df4754..e52422dd8 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./msg;msg"; +option go_package = "Open_IM/pkg/proto/msg;msg"; package msg; message MsgDataToMQ{ diff --git a/pkg/proto/office/office.proto b/pkg/proto/office/office.proto index 65e9a7847..23b422bad 100644 --- a/pkg/proto/office/office.proto +++ b/pkg/proto/office/office.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./office;office"; +option go_package = "Open_IM/pkg/proto/office;office"; package office; message CommonResp{ diff --git a/pkg/proto/organization/organization.proto b/pkg/proto/organization/organization.proto index 309abc881..3dfa9f3bc 100644 --- a/pkg/proto/organization/organization.proto +++ b/pkg/proto/organization/organization.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./organization;organization"; +option go_package = "Open_IM/pkg/proto/organization;organization"; package organization; diff --git a/pkg/proto/push/push.proto b/pkg/proto/push/push.proto index 0954e8bc5..ce46692df 100644 --- a/pkg/proto/push/push.proto +++ b/pkg/proto/push/push.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./push;pbPush"; +option go_package = "Open_IM/pkg/proto/push;pbPush"; package push; message PushMsgReq { diff --git a/pkg/proto/relay/relay.proto b/pkg/proto/relay/relay.proto index 7d7dd932d..878d65ac4 100644 --- a/pkg/proto/relay/relay.proto +++ b/pkg/proto/relay/relay.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; -option go_package = "./relay;pbRelay"; +option go_package = "Open_IM/pkg/proto/relay;pbRelay"; package relay; message OnlinePushMsgReq { diff --git a/pkg/proto/rtc/rtc.proto b/pkg/proto/rtc/rtc.proto index aafc9345f..bb5c54c19 100644 --- a/pkg/proto/rtc/rtc.proto +++ b/pkg/proto/rtc/rtc.proto @@ -1,5 +1,5 @@ syntax = "proto3"; -option go_package = "./rtc;rtc"; +option go_package = "Open_IM/pkg/proto/rtc;rtc"; package proto; message CommonResp{ diff --git a/pkg/proto/sdk_ws/ws.proto b/pkg/proto/sdk_ws/ws.proto index 6c0500c09..61ba73c65 100644 --- a/pkg/proto/sdk_ws/ws.proto +++ b/pkg/proto/sdk_ws/ws.proto @@ -1,6 +1,6 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/wrappers.proto"; -option go_package = "./sdk_ws;server_api_params"; +option go_package = "Open_IM/pkg/proto/sdk_ws;server_api_params"; package server_api_params; diff --git a/pkg/proto/user/user.proto b/pkg/proto/user/user.proto index a32b6a594..685d9e150 100644 --- a/pkg/proto/user/user.proto +++ b/pkg/proto/user/user.proto @@ -1,7 +1,7 @@ syntax = "proto3"; import "Open-IM-Server/pkg/proto/sdk_ws/ws.proto"; import "Open-IM-Server/pkg/proto/conversation/conversation.proto"; -option go_package = "./user;user"; +option go_package = "Open_IM/pkg/proto/user;user"; package user; message CommonResp{ From c6aefa984d0da0bd15d435039dc7808b1f63cc31 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 08:37:15 +0800 Subject: [PATCH 04/15] update proto --- pkg/proto/proto_dir.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/pkg/proto/proto_dir.cfg b/pkg/proto/proto_dir.cfg index 854938208..24654c38f 100644 --- a/pkg/proto/proto_dir.cfg +++ b/pkg/proto/proto_dir.cfg @@ -16,5 +16,4 @@ all_proto=( office/office.proto cache/cache.proto organization/organization.proto - ) From 2a97801aae91d525be9c8bd23251cbde2b09e18e Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 08:39:15 +0800 Subject: [PATCH 05/15] update proto --- pkg/proto/auto_proto.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 3f0d03061..5275412f1 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -8,7 +8,7 @@ for ((i = 0; i < ${#all_proto[*]}; i++)); do protoc -I ../../../ -I ./ --go_out=plugins=grpc:. $proto echo "protoc --go_out=plugins=grpc:." $proto done -echo "proto file generate success..." +echo "proto file generate success" find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' From aed95ed4fc09df0165c3ed4ce8b25ed60a830333 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 08:40:31 +0800 Subject: [PATCH 06/15] update proto --- pkg/proto/auto_proto.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index 5275412f1..cfed6246a 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -10,7 +10,7 @@ for ((i = 0; i < ${#all_proto[*]}; i++)); do done echo "proto file generate success" -find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' +#find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' From 1c5aae2301f127714913c00e1a0d6d0a50d854bb Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 09:09:00 +0800 Subject: [PATCH 07/15] update proto --- pkg/proto/auto_proto.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pkg/proto/auto_proto.sh b/pkg/proto/auto_proto.sh index cfed6246a..179cca6bb 100644 --- a/pkg/proto/auto_proto.sh +++ b/pkg/proto/auto_proto.sh @@ -10,6 +10,19 @@ for ((i = 0; i < ${#all_proto[*]}; i++)); do done echo "proto file generate success" + +j=0 +for file in $(find ./Open_IM -name "*.go"); do # Not recommended, will break on whitespace + filelist[j]=$file + j=`expr $j + 1` +done + + +for ((i = 0; i < ${#filelist[*]}; i++)); do + proto=${filelist[$i]} + cp $proto ${proto#*./Open_IM/pkg/proto/} +done +rm Open_IM -rf #find ./ -type f -path "*.pb.go"|xargs sed -i 's/\".\/sdk_ws\"/\"Open_IM\/pkg\/proto\/sdk_ws\"/g' From 6ad50e4e048497eb4c25b231c8b954e96089f0a7 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 09:13:58 +0800 Subject: [PATCH 08/15] jwt import update --- go.mod | 2 +- go.sum | 2 ++ pkg/common/token_verify/jwt_token.go | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 6d98b054e..3c231e7ff 100644 --- a/go.mod +++ b/go.mod @@ -24,6 +24,7 @@ require ( github.com/go-playground/validator/v10 v10.11.0 github.com/go-redis/redis/v8 v8.11.5 github.com/gogo/protobuf v1.3.2 + github.com/golang-jwt/jwt/v4 v4.4.2 github.com/golang/protobuf v1.5.2 github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 @@ -58,7 +59,6 @@ require ( golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e // indirect golang.org/x/image v0.0.0-20211028202545-6944b10bf410 golang.org/x/net v0.0.0-20220622184535-263ec571b305 - golang.org/x/oauth2 v0.0.0-20220223155221-ee480838109b golang.org/x/sys v0.0.0-20220622161953-175b2fd9d664 // indirect golang.org/x/tools v0.1.11 // indirect google.golang.org/api v0.59.0 diff --git a/go.sum b/go.sum index 59f0cdfb4..d2621af33 100644 --- a/go.sum +++ b/go.sum @@ -249,6 +249,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt/v4 v4.4.2 h1:rcc4lwaZgFMCZ5jxF9ABolDcIHdBytAFgqFPbSJQAYs= +github.com/golang-jwt/jwt/v4 v4.4.2/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe h1:lXe2qZdvpiX5WZkZR4hgp4KJVfY3nMkvmwbVkpv1rVY= github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff --git a/pkg/common/token_verify/jwt_token.go b/pkg/common/token_verify/jwt_token.go index ae5fdaceb..5c3c1e07a 100644 --- a/pkg/common/token_verify/jwt_token.go +++ b/pkg/common/token_verify/jwt_token.go @@ -6,10 +6,10 @@ import ( commonDB "Open_IM/pkg/common/db" "Open_IM/pkg/common/log" "Open_IM/pkg/utils" - "golang.org/x/oauth2/jwt" "time" go_redis "github.com/go-redis/redis/v8" + "github.com/golang-jwt/jwt/v4" ) //var ( From 2bf50bb8c20c4b1b122e15e7fcf2889ce6fd237a Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 09:23:10 +0800 Subject: [PATCH 09/15] update proto --- pkg/proto/friend/friend.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/proto/friend/friend.proto b/pkg/proto/friend/friend.proto index 00d07f17a..8245ba68f 100644 --- a/pkg/proto/friend/friend.proto +++ b/pkg/proto/friend/friend.proto @@ -167,6 +167,6 @@ service friend{ rpc setFriendRemark(SetFriendRemarkReq) returns(SetFriendRemarkResp); rpc importFriend(ImportFriendReq) returns(ImportFriendResp); - rpc CheckFriendFromCache(IsFriendReq) returns(IsFriendResp); - rpc CheckBlockFromCache(IsInBlackListReq) returns(IsFriendResp); + // rpc CheckFriendFromCache(IsFriendReq) returns(IsFriendResp); + // rpc CheckBlockFromCache(IsInBlackListReq) returns(IsFriendResp); } \ No newline at end of file From cad23f167220529adc041ca41091bc8bc8aae072 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 21 Sep 2022 16:09:02 +0800 Subject: [PATCH 10/15] online push info callback update --- internal/push/logic/callback.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index f9722f3c2..746b9e122 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -96,6 +96,11 @@ func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.M return callbackResp } } + if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow { + if resp.OfflinePushInfo != nil { + msg.OfflinePushInfo = resp.OfflinePushInfo + } + } return callbackResp } @@ -133,8 +138,13 @@ func callbackBeforeSuperGroupOnlinePush(operationID string, groupID string, msg return callbackResp } } - if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow && len(resp.UserIDList) != 0 { - *pushToUserList = resp.UserIDList + if resp.ErrCode == constant.CallbackHandleSuccess && resp.ActionCode == constant.ActionAllow { + if len(resp.UserIDList) != 0 { + *pushToUserList = resp.UserIDList + } + if resp.OfflinePushInfo != nil { + msg.OfflinePushInfo = resp.OfflinePushInfo + } } log.NewDebug(operationID, utils.GetSelfFuncName(), pushToUserList, resp.UserIDList) return callbackResp From 3714873b7b718b4d0e36553a34e7c6950d9cf82c Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 21 Sep 2022 16:14:57 +0800 Subject: [PATCH 11/15] online push info callback update --- pkg/call_back_struct/push.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/call_back_struct/push.go b/pkg/call_back_struct/push.go index 3225d703d..1fa0fbff6 100644 --- a/pkg/call_back_struct/push.go +++ b/pkg/call_back_struct/push.go @@ -34,5 +34,6 @@ type CallbackBeforeSuperGroupOnlinePushReq struct { type CallbackBeforeSuperGroupOnlinePushResp struct { *CommonCallbackResp - UserIDList []string `json:"userIDList"` + UserIDList []string `json:"userIDList"` + OfflinePushInfo *commonPb.OfflinePushInfo `json:"offlinePushInfo"` } From 6d82c9c3db74cf9596c1e11149c9a6f119da4279 Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 18:44:21 +0800 Subject: [PATCH 12/15] add ParseToken rpc --- internal/api/msg/send_msg.go | 2 +- internal/rpc/msg/send_msg.go | 1 + pkg/proto/auth/auth.proto | 15 +++++++++++++++ pkg/proto/msg/msg.proto | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/internal/api/msg/send_msg.go b/internal/api/msg/send_msg.go index 93502fe33..5b4654fce 100644 --- a/internal/api/msg/send_msg.go +++ b/internal/api/msg/send_msg.go @@ -80,7 +80,7 @@ func SendMsg(c *gin.Context) { } client := pbChat.NewMsgClient(etcdConn) - log.Info("", "", "api SendMsg call, api call rpc...") + log.Info(params.OperationID, "", "api SendMsg call, api call rpc...") reply, err := client.SendMsg(context.Background(), pbData) if err != nil { diff --git a/internal/rpc/msg/send_msg.go b/internal/rpc/msg/send_msg.go index 80938dc40..bf553714f 100644 --- a/internal/rpc/msg/send_msg.go +++ b/internal/rpc/msg/send_msg.go @@ -933,6 +933,7 @@ func Notification(n *NotificationMsg) { log.NewError(req.OperationID, "SendMsg rpc failed, ", req.String(), reply.ErrCode, reply.ErrMsg) } } + func getOnlineAndOfflineUserIDList(memberList []string, m map[string][]string, operationID string) { var onllUserIDList, offlUserIDList []string var wsResult []*pbRelay.GetUsersOnlineStatusResp_SuccessResult diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index 0b4595cba..ee970268d 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -42,6 +42,18 @@ message ForceLogoutResp { CommonResp CommonResp = 1; } +message ParseTokenReq{ + string token = 1; + string operationID = 2; +} + + +message ParseTokenResp{ + string userID = 1; + string operationID = 2; + CommonResp commonResp = 3; + uint32 expireTimeSeconds = 4; +} @@ -50,4 +62,7 @@ service Auth { rpc UserRegister(UserRegisterReq) returns(UserRegisterResp); rpc UserToken(UserTokenReq) returns(UserTokenResp); rpc ForceLogout(ForceLogoutReq) returns(ForceLogoutResp); + rpc ParseToken(ParseTokenReq)returns(ParseTokenResp); } + + diff --git a/pkg/proto/msg/msg.proto b/pkg/proto/msg/msg.proto index e52422dd8..c2118c756 100644 --- a/pkg/proto/msg/msg.proto +++ b/pkg/proto/msg/msg.proto @@ -131,6 +131,9 @@ message DelSuperGroupMsgResp{ int32 errCode = 1; string errMsg = 2; } + + + service msg { rpc GetMaxAndMinSeq(server_api_params.GetMaxAndMinSeqReq) returns(server_api_params.GetMaxAndMinSeqResp); rpc PullMessageBySeqList(server_api_params.PullMessageBySeqListReq) returns(server_api_params.PullMessageBySeqListResp); @@ -141,4 +144,5 @@ service msg { rpc SetMsgMinSeq(SetMsgMinSeqReq) returns(SetMsgMinSeqResp); rpc SetSendMsgStatus(SetSendMsgStatusReq) returns(SetSendMsgStatusResp); rpc GetSendMsgStatus(GetSendMsgStatusReq) returns(GetSendMsgStatusResp); + } From 0a28bcfbe9b4f3543caab83fcf84deb0ad57c49f Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Wed, 21 Sep 2022 18:58:15 +0800 Subject: [PATCH 13/15] mongo index modify --- pkg/common/db/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/common/db/model.go b/pkg/common/db/model.go index a750ac285..a524b7d88 100644 --- a/pkg/common/db/model.go +++ b/pkg/common/db/model.go @@ -98,7 +98,7 @@ func init() { fmt.Println("send_id", "-send_time", "index create failed", err.Error()) panic(err.Error()) } - if err := createMongoIndex(mongoClient, cChat, true, "uid"); err != nil { + if err := createMongoIndex(mongoClient, cChat, false, "uid"); err != nil { fmt.Println("uid", " index create failed", err.Error()) panic(err.Error()) } From c1811463cb07e833f4d1df56cd0aa93cea7fb29c Mon Sep 17 00:00:00 2001 From: skiffer-git <44203734@qq.com> Date: Wed, 21 Sep 2022 20:20:26 +0800 Subject: [PATCH 14/15] add ParseToken rpc --- internal/rpc/auth/auth.go | 13 + internal/rpc/auth/callback.go | 1 - pkg/proto/auth/auth.pb.go | 985 +++++++++++++++------------------- pkg/proto/auth/auth.proto | 2 +- 4 files changed, 453 insertions(+), 548 deletions(-) delete mode 100644 internal/rpc/auth/callback.go diff --git a/internal/rpc/auth/auth.go b/internal/rpc/auth/auth.go index 8a720e3e5..dfa7f47cc 100644 --- a/internal/rpc/auth/auth.go +++ b/internal/rpc/auth/auth.go @@ -56,6 +56,19 @@ func (rpc *rpcAuth) UserToken(_ context.Context, req *pbAuth.UserTokenReq) (*pbA return &pbAuth.UserTokenResp{CommonResp: &pbAuth.CommonResp{}, Token: tokens, ExpiredTime: expTime}, nil } +func (rpc *rpcAuth) ParseToken(_ context.Context, req *pbAuth.ParseTokenReq) (*pbAuth.ParseTokenResp, error) { + log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) + claims, err := token_verify.ParseToken(req.Token, req.OperationID) + if err != nil { + errMsg := "ParseToken failed " + err.Error() + req.OperationID + " token " + req.Token + log.Error(req.OperationID, errMsg, "token:", req.Token) + return &pbAuth.ParseTokenResp{CommonResp: &pbAuth.CommonResp{ErrCode: 4001, ErrMsg: errMsg}}, nil + } + resp := pbAuth.ParseTokenResp{CommonResp: &pbAuth.CommonResp{}, UserID: claims.UID, Platform: claims.Platform, ExpireTimeSeconds: uint32(claims.ExpiresAt.Unix())} + log.Info(req.OperationID, utils.GetSelfFuncName(), " rpc return ", resp.String()) + return &resp, nil +} + func (rpc *rpcAuth) ForceLogout(_ context.Context, req *pbAuth.ForceLogoutReq) (*pbAuth.ForceLogoutResp, error) { log.NewInfo(req.OperationID, utils.GetSelfFuncName(), " rpc args ", req.String()) if !token_verify.IsManagerUserID(req.OpUserID) { diff --git a/internal/rpc/auth/callback.go b/internal/rpc/auth/callback.go deleted file mode 100644 index 8832b06d1..000000000 --- a/internal/rpc/auth/callback.go +++ /dev/null @@ -1 +0,0 @@ -package auth diff --git a/pkg/proto/auth/auth.pb.go b/pkg/proto/auth/auth.pb.go index 7035233c0..8449a6ad9 100644 --- a/pkg/proto/auth/auth.pb.go +++ b/pkg/proto/auth/auth.pb.go @@ -1,697 +1,531 @@ // Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.15.5 // source: auth/auth.proto -package pbAuth +package pbAuth // import "Open_IM/pkg/proto/auth" + +import proto "github.com/golang/protobuf/proto" +import fmt "fmt" +import math "math" +import sdk_ws "Open_IM/pkg/proto/sdk_ws" import ( - sdk_ws "Open_IM/pkg/proto/sdk_ws" - context "context" + context "golang.org/x/net/context" grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" ) -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf -type CommonResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.ProtoPackageIsVersion2 // please upgrade the proto package - ErrCode int32 `protobuf:"varint,1,opt,name=errCode,proto3" json:"errCode,omitempty"` - ErrMsg string `protobuf:"bytes,2,opt,name=errMsg,proto3" json:"errMsg,omitempty"` +type CommonResp struct { + ErrCode int32 `protobuf:"varint,1,opt,name=errCode" json:"errCode,omitempty"` + ErrMsg string `protobuf:"bytes,2,opt,name=errMsg" json:"errMsg,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *CommonResp) Reset() { - *x = CommonResp{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *CommonResp) Reset() { *m = CommonResp{} } +func (m *CommonResp) String() string { return proto.CompactTextString(m) } +func (*CommonResp) ProtoMessage() {} +func (*CommonResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{0} } - -func (x *CommonResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *CommonResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_CommonResp.Unmarshal(m, b) } - -func (*CommonResp) ProtoMessage() {} - -func (x *CommonResp) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *CommonResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_CommonResp.Marshal(b, m, deterministic) } - -// Deprecated: Use CommonResp.ProtoReflect.Descriptor instead. -func (*CommonResp) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{0} +func (dst *CommonResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_CommonResp.Merge(dst, src) +} +func (m *CommonResp) XXX_Size() int { + return xxx_messageInfo_CommonResp.Size(m) } +func (m *CommonResp) XXX_DiscardUnknown() { + xxx_messageInfo_CommonResp.DiscardUnknown(m) +} + +var xxx_messageInfo_CommonResp proto.InternalMessageInfo -func (x *CommonResp) GetErrCode() int32 { - if x != nil { - return x.ErrCode +func (m *CommonResp) GetErrCode() int32 { + if m != nil { + return m.ErrCode } return 0 } -func (x *CommonResp) GetErrMsg() string { - if x != nil { - return x.ErrMsg +func (m *CommonResp) GetErrMsg() string { + if m != nil { + return m.ErrMsg } return "" } type UserRegisterReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo,proto3" json:"UserInfo,omitempty"` - OperationID string `protobuf:"bytes,2,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + UserInfo *sdk_ws.UserInfo `protobuf:"bytes,1,opt,name=UserInfo" json:"UserInfo,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *UserRegisterReq) Reset() { - *x = UserRegisterReq{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *UserRegisterReq) Reset() { *m = UserRegisterReq{} } +func (m *UserRegisterReq) String() string { return proto.CompactTextString(m) } +func (*UserRegisterReq) ProtoMessage() {} +func (*UserRegisterReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{1} } - -func (x *UserRegisterReq) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *UserRegisterReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserRegisterReq.Unmarshal(m, b) } - -func (*UserRegisterReq) ProtoMessage() {} - -func (x *UserRegisterReq) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *UserRegisterReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserRegisterReq.Marshal(b, m, deterministic) } - -// Deprecated: Use UserRegisterReq.ProtoReflect.Descriptor instead. -func (*UserRegisterReq) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{1} +func (dst *UserRegisterReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterReq.Merge(dst, src) +} +func (m *UserRegisterReq) XXX_Size() int { + return xxx_messageInfo_UserRegisterReq.Size(m) } +func (m *UserRegisterReq) XXX_DiscardUnknown() { + xxx_messageInfo_UserRegisterReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UserRegisterReq proto.InternalMessageInfo -func (x *UserRegisterReq) GetUserInfo() *sdk_ws.UserInfo { - if x != nil { - return x.UserInfo +func (m *UserRegisterReq) GetUserInfo() *sdk_ws.UserInfo { + if m != nil { + return m.UserInfo } return nil } -func (x *UserRegisterReq) GetOperationID() string { - if x != nil { - return x.OperationID +func (m *UserRegisterReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } type UserRegisterResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *UserRegisterResp) Reset() { - *x = UserRegisterResp{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *UserRegisterResp) Reset() { *m = UserRegisterResp{} } +func (m *UserRegisterResp) String() string { return proto.CompactTextString(m) } +func (*UserRegisterResp) ProtoMessage() {} +func (*UserRegisterResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{2} } - -func (x *UserRegisterResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *UserRegisterResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserRegisterResp.Unmarshal(m, b) } - -func (*UserRegisterResp) ProtoMessage() {} - -func (x *UserRegisterResp) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *UserRegisterResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserRegisterResp.Marshal(b, m, deterministic) } - -// Deprecated: Use UserRegisterResp.ProtoReflect.Descriptor instead. -func (*UserRegisterResp) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{2} +func (dst *UserRegisterResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserRegisterResp.Merge(dst, src) } +func (m *UserRegisterResp) XXX_Size() int { + return xxx_messageInfo_UserRegisterResp.Size(m) +} +func (m *UserRegisterResp) XXX_DiscardUnknown() { + xxx_messageInfo_UserRegisterResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UserRegisterResp proto.InternalMessageInfo -func (x *UserRegisterResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp +func (m *UserRegisterResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } return nil } type UserTokenReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform int32 `protobuf:"varint,1,opt,name=Platform,proto3" json:"Platform,omitempty"` - FromUserID string `protobuf:"bytes,2,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` - LoginIp string `protobuf:"bytes,5,opt,name=LoginIp,proto3" json:"LoginIp,omitempty"` + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` + FromUserID string `protobuf:"bytes,2,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + LoginIp string `protobuf:"bytes,5,opt,name=LoginIp" json:"LoginIp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *UserTokenReq) Reset() { *m = UserTokenReq{} } +func (m *UserTokenReq) String() string { return proto.CompactTextString(m) } +func (*UserTokenReq) ProtoMessage() {} +func (*UserTokenReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{3} } - -func (x *UserTokenReq) Reset() { - *x = UserTokenReq{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *UserTokenReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserTokenReq.Unmarshal(m, b) } - -func (x *UserTokenReq) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *UserTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserTokenReq.Marshal(b, m, deterministic) } - -func (*UserTokenReq) ProtoMessage() {} - -func (x *UserTokenReq) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (dst *UserTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenReq.Merge(dst, src) } - -// Deprecated: Use UserTokenReq.ProtoReflect.Descriptor instead. -func (*UserTokenReq) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{3} +func (m *UserTokenReq) XXX_Size() int { + return xxx_messageInfo_UserTokenReq.Size(m) } +func (m *UserTokenReq) XXX_DiscardUnknown() { + xxx_messageInfo_UserTokenReq.DiscardUnknown(m) +} + +var xxx_messageInfo_UserTokenReq proto.InternalMessageInfo -func (x *UserTokenReq) GetPlatform() int32 { - if x != nil { - return x.Platform +func (m *UserTokenReq) GetPlatform() int32 { + if m != nil { + return m.Platform } return 0 } -func (x *UserTokenReq) GetFromUserID() string { - if x != nil { - return x.FromUserID +func (m *UserTokenReq) GetFromUserID() string { + if m != nil { + return m.FromUserID } return "" } -func (x *UserTokenReq) GetOpUserID() string { - if x != nil { - return x.OpUserID +func (m *UserTokenReq) GetOpUserID() string { + if m != nil { + return m.OpUserID } return "" } -func (x *UserTokenReq) GetOperationID() string { - if x != nil { - return x.OperationID +func (m *UserTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } -func (x *UserTokenReq) GetLoginIp() string { - if x != nil { - return x.LoginIp +func (m *UserTokenReq) GetLoginIp() string { + if m != nil { + return m.LoginIp } return "" } type UserTokenResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` - Token string `protobuf:"bytes,2,opt,name=Token,proto3" json:"Token,omitempty"` - ExpiredTime int64 `protobuf:"varint,3,opt,name=ExpiredTime,proto3" json:"ExpiredTime,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + Token string `protobuf:"bytes,2,opt,name=Token" json:"Token,omitempty"` + ExpiredTime int64 `protobuf:"varint,3,opt,name=ExpiredTime" json:"ExpiredTime,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (x *UserTokenResp) Reset() { - *x = UserTokenResp{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *UserTokenResp) Reset() { *m = UserTokenResp{} } +func (m *UserTokenResp) String() string { return proto.CompactTextString(m) } +func (*UserTokenResp) ProtoMessage() {} +func (*UserTokenResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{4} } - -func (x *UserTokenResp) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *UserTokenResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_UserTokenResp.Unmarshal(m, b) } - -func (*UserTokenResp) ProtoMessage() {} - -func (x *UserTokenResp) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (m *UserTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_UserTokenResp.Marshal(b, m, deterministic) } - -// Deprecated: Use UserTokenResp.ProtoReflect.Descriptor instead. -func (*UserTokenResp) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{4} +func (dst *UserTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_UserTokenResp.Merge(dst, src) } +func (m *UserTokenResp) XXX_Size() int { + return xxx_messageInfo_UserTokenResp.Size(m) +} +func (m *UserTokenResp) XXX_DiscardUnknown() { + xxx_messageInfo_UserTokenResp.DiscardUnknown(m) +} + +var xxx_messageInfo_UserTokenResp proto.InternalMessageInfo -func (x *UserTokenResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp +func (m *UserTokenResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } return nil } -func (x *UserTokenResp) GetToken() string { - if x != nil { - return x.Token +func (m *UserTokenResp) GetToken() string { + if m != nil { + return m.Token } return "" } -func (x *UserTokenResp) GetExpiredTime() int64 { - if x != nil { - return x.ExpiredTime +func (m *UserTokenResp) GetExpiredTime() int64 { + if m != nil { + return m.ExpiredTime } return 0 } type ForceLogoutReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform int32 `protobuf:"varint,1,opt,name=Platform,proto3" json:"Platform,omitempty"` - FromUserID string `protobuf:"bytes,2,opt,name=FromUserID,proto3" json:"FromUserID,omitempty"` - OpUserID string `protobuf:"bytes,3,opt,name=OpUserID,proto3" json:"OpUserID,omitempty"` - OperationID string `protobuf:"bytes,4,opt,name=OperationID,proto3" json:"OperationID,omitempty"` + Platform int32 `protobuf:"varint,1,opt,name=Platform" json:"Platform,omitempty"` + FromUserID string `protobuf:"bytes,2,opt,name=FromUserID" json:"FromUserID,omitempty"` + OpUserID string `protobuf:"bytes,3,opt,name=OpUserID" json:"OpUserID,omitempty"` + OperationID string `protobuf:"bytes,4,opt,name=OperationID" json:"OperationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ForceLogoutReq) Reset() { *m = ForceLogoutReq{} } +func (m *ForceLogoutReq) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutReq) ProtoMessage() {} +func (*ForceLogoutReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{5} } - -func (x *ForceLogoutReq) Reset() { - *x = ForceLogoutReq{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +func (m *ForceLogoutReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutReq.Unmarshal(m, b) } - -func (x *ForceLogoutReq) String() string { - return protoimpl.X.MessageStringOf(x) +func (m *ForceLogoutReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutReq.Marshal(b, m, deterministic) } - -func (*ForceLogoutReq) ProtoMessage() {} - -func (x *ForceLogoutReq) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) +func (dst *ForceLogoutReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutReq.Merge(dst, src) } - -// Deprecated: Use ForceLogoutReq.ProtoReflect.Descriptor instead. -func (*ForceLogoutReq) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{5} +func (m *ForceLogoutReq) XXX_Size() int { + return xxx_messageInfo_ForceLogoutReq.Size(m) +} +func (m *ForceLogoutReq) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutReq.DiscardUnknown(m) } -func (x *ForceLogoutReq) GetPlatform() int32 { - if x != nil { - return x.Platform +var xxx_messageInfo_ForceLogoutReq proto.InternalMessageInfo + +func (m *ForceLogoutReq) GetPlatform() int32 { + if m != nil { + return m.Platform } return 0 } -func (x *ForceLogoutReq) GetFromUserID() string { - if x != nil { - return x.FromUserID +func (m *ForceLogoutReq) GetFromUserID() string { + if m != nil { + return m.FromUserID } return "" } -func (x *ForceLogoutReq) GetOpUserID() string { - if x != nil { - return x.OpUserID +func (m *ForceLogoutReq) GetOpUserID() string { + if m != nil { + return m.OpUserID } return "" } -func (x *ForceLogoutReq) GetOperationID() string { - if x != nil { - return x.OperationID +func (m *ForceLogoutReq) GetOperationID() string { + if m != nil { + return m.OperationID } return "" } type ForceLogoutResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields + CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp" json:"CommonResp,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} - CommonResp *CommonResp `protobuf:"bytes,1,opt,name=CommonResp,proto3" json:"CommonResp,omitempty"` +func (m *ForceLogoutResp) Reset() { *m = ForceLogoutResp{} } +func (m *ForceLogoutResp) String() string { return proto.CompactTextString(m) } +func (*ForceLogoutResp) ProtoMessage() {} +func (*ForceLogoutResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{6} +} +func (m *ForceLogoutResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ForceLogoutResp.Unmarshal(m, b) +} +func (m *ForceLogoutResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ForceLogoutResp.Marshal(b, m, deterministic) +} +func (dst *ForceLogoutResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ForceLogoutResp.Merge(dst, src) +} +func (m *ForceLogoutResp) XXX_Size() int { + return xxx_messageInfo_ForceLogoutResp.Size(m) +} +func (m *ForceLogoutResp) XXX_DiscardUnknown() { + xxx_messageInfo_ForceLogoutResp.DiscardUnknown(m) } -func (x *ForceLogoutResp) Reset() { - *x = ForceLogoutResp{} - if protoimpl.UnsafeEnabled { - mi := &file_auth_auth_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +var xxx_messageInfo_ForceLogoutResp proto.InternalMessageInfo + +func (m *ForceLogoutResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } + return nil } -func (x *ForceLogoutResp) String() string { - return protoimpl.X.MessageStringOf(x) +type ParseTokenReq struct { + Token string `protobuf:"bytes,1,opt,name=token" json:"token,omitempty"` + OperationID string `protobuf:"bytes,2,opt,name=operationID" json:"operationID,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` } -func (*ForceLogoutResp) ProtoMessage() {} +func (m *ParseTokenReq) Reset() { *m = ParseTokenReq{} } +func (m *ParseTokenReq) String() string { return proto.CompactTextString(m) } +func (*ParseTokenReq) ProtoMessage() {} +func (*ParseTokenReq) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{7} +} +func (m *ParseTokenReq) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ParseTokenReq.Unmarshal(m, b) +} +func (m *ParseTokenReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ParseTokenReq.Marshal(b, m, deterministic) +} +func (dst *ParseTokenReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParseTokenReq.Merge(dst, src) +} +func (m *ParseTokenReq) XXX_Size() int { + return xxx_messageInfo_ParseTokenReq.Size(m) +} +func (m *ParseTokenReq) XXX_DiscardUnknown() { + xxx_messageInfo_ParseTokenReq.DiscardUnknown(m) +} + +var xxx_messageInfo_ParseTokenReq proto.InternalMessageInfo -func (x *ForceLogoutResp) ProtoReflect() protoreflect.Message { - mi := &file_auth_auth_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms +func (m *ParseTokenReq) GetToken() string { + if m != nil { + return m.Token } - return mi.MessageOf(x) + return "" } -// Deprecated: Use ForceLogoutResp.ProtoReflect.Descriptor instead. -func (*ForceLogoutResp) Descriptor() ([]byte, []int) { - return file_auth_auth_proto_rawDescGZIP(), []int{6} +func (m *ParseTokenReq) GetOperationID() string { + if m != nil { + return m.OperationID + } + return "" } -func (x *ForceLogoutResp) GetCommonResp() *CommonResp { - if x != nil { - return x.CommonResp +type ParseTokenResp struct { + UserID string `protobuf:"bytes,1,opt,name=userID" json:"userID,omitempty"` + Platform string `protobuf:"bytes,2,opt,name=platform" json:"platform,omitempty"` + CommonResp *CommonResp `protobuf:"bytes,3,opt,name=commonResp" json:"commonResp,omitempty"` + ExpireTimeSeconds uint32 `protobuf:"varint,4,opt,name=expireTimeSeconds" json:"expireTimeSeconds,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *ParseTokenResp) Reset() { *m = ParseTokenResp{} } +func (m *ParseTokenResp) String() string { return proto.CompactTextString(m) } +func (*ParseTokenResp) ProtoMessage() {} +func (*ParseTokenResp) Descriptor() ([]byte, []int) { + return fileDescriptor_auth_71755bb03ef9bfd4, []int{8} +} +func (m *ParseTokenResp) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_ParseTokenResp.Unmarshal(m, b) +} +func (m *ParseTokenResp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_ParseTokenResp.Marshal(b, m, deterministic) +} +func (dst *ParseTokenResp) XXX_Merge(src proto.Message) { + xxx_messageInfo_ParseTokenResp.Merge(dst, src) +} +func (m *ParseTokenResp) XXX_Size() int { + return xxx_messageInfo_ParseTokenResp.Size(m) +} +func (m *ParseTokenResp) XXX_DiscardUnknown() { + xxx_messageInfo_ParseTokenResp.DiscardUnknown(m) +} + +var xxx_messageInfo_ParseTokenResp proto.InternalMessageInfo + +func (m *ParseTokenResp) GetUserID() string { + if m != nil { + return m.UserID + } + return "" +} + +func (m *ParseTokenResp) GetPlatform() string { + if m != nil { + return m.Platform + } + return "" +} + +func (m *ParseTokenResp) GetCommonResp() *CommonResp { + if m != nil { + return m.CommonResp } return nil } -var File_auth_auth_proto protoreflect.FileDescriptor - -var file_auth_auth_proto_rawDesc = []byte{ - 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x06, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x1a, 0x21, 0x4f, 0x70, 0x65, 0x6e, 0x5f, - 0x49, 0x4d, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x64, 0x6b, - 0x5f, 0x77, 0x73, 0x2f, 0x77, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3e, 0x0a, 0x0a, - 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x72, - 0x72, 0x43, 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x65, 0x72, 0x72, - 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x65, 0x72, 0x72, 0x4d, 0x73, 0x67, 0x22, 0x6c, 0x0a, 0x0f, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, - 0x37, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x70, 0x69, 0x5f, 0x70, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, - 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x22, 0x46, 0x0a, 0x10, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, - 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, - 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, - 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, - 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x4f, - 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x12, 0x18, 0x0a, - 0x07, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x22, 0x7b, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, - 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, - 0x52, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x14, 0x0a, 0x05, - 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x54, 0x6f, 0x6b, - 0x65, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, 0x54, 0x69, 0x6d, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x45, 0x78, 0x70, 0x69, 0x72, 0x65, 0x64, - 0x54, 0x69, 0x6d, 0x65, 0x22, 0x8a, 0x01, 0x0a, 0x0e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4c, 0x6f, - 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, - 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x49, - 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x46, 0x72, 0x6f, 0x6d, 0x55, 0x73, 0x65, - 0x72, 0x49, 0x44, 0x12, 0x1a, 0x0a, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x4f, 0x70, 0x55, 0x73, 0x65, 0x72, 0x49, 0x44, 0x12, - 0x20, 0x0a, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x44, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x44, 0x22, 0x45, 0x0a, 0x0f, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x32, 0x0a, 0x0a, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, - 0x73, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, - 0x68, 0x2e, 0x43, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x52, 0x0a, 0x43, 0x6f, - 0x6d, 0x6d, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, 0xc3, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, - 0x68, 0x12, 0x41, 0x0a, 0x0c, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, - 0x72, 0x12, 0x17, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x18, 0x2e, 0x70, 0x62, 0x41, - 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, - 0x6e, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, - 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x15, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, - 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3e, - 0x0a, 0x0b, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x16, 0x2e, - 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x6f, - 0x75, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x2e, 0x46, - 0x6f, 0x72, 0x63, 0x65, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x73, 0x70, 0x42, 0x0f, - 0x5a, 0x0d, 0x2e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x3b, 0x70, 0x62, 0x41, 0x75, 0x74, 0x68, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_auth_auth_proto_rawDescOnce sync.Once - file_auth_auth_proto_rawDescData = file_auth_auth_proto_rawDesc -) +func (m *ParseTokenResp) GetExpireTimeSeconds() uint32 { + if m != nil { + return m.ExpireTimeSeconds + } + return 0 +} -func file_auth_auth_proto_rawDescGZIP() []byte { - file_auth_auth_proto_rawDescOnce.Do(func() { - file_auth_auth_proto_rawDescData = protoimpl.X.CompressGZIP(file_auth_auth_proto_rawDescData) - }) - return file_auth_auth_proto_rawDescData -} - -var file_auth_auth_proto_msgTypes = make([]protoimpl.MessageInfo, 7) -var file_auth_auth_proto_goTypes = []interface{}{ - (*CommonResp)(nil), // 0: pbAuth.CommonResp - (*UserRegisterReq)(nil), // 1: pbAuth.UserRegisterReq - (*UserRegisterResp)(nil), // 2: pbAuth.UserRegisterResp - (*UserTokenReq)(nil), // 3: pbAuth.UserTokenReq - (*UserTokenResp)(nil), // 4: pbAuth.UserTokenResp - (*ForceLogoutReq)(nil), // 5: pbAuth.ForceLogoutReq - (*ForceLogoutResp)(nil), // 6: pbAuth.ForceLogoutResp - (*sdk_ws.UserInfo)(nil), // 7: server_api_params.UserInfo -} -var file_auth_auth_proto_depIdxs = []int32{ - 7, // 0: pbAuth.UserRegisterReq.UserInfo:type_name -> server_api_params.UserInfo - 0, // 1: pbAuth.UserRegisterResp.CommonResp:type_name -> pbAuth.CommonResp - 0, // 2: pbAuth.UserTokenResp.CommonResp:type_name -> pbAuth.CommonResp - 0, // 3: pbAuth.ForceLogoutResp.CommonResp:type_name -> pbAuth.CommonResp - 1, // 4: pbAuth.Auth.UserRegister:input_type -> pbAuth.UserRegisterReq - 3, // 5: pbAuth.Auth.UserToken:input_type -> pbAuth.UserTokenReq - 5, // 6: pbAuth.Auth.ForceLogout:input_type -> pbAuth.ForceLogoutReq - 2, // 7: pbAuth.Auth.UserRegister:output_type -> pbAuth.UserRegisterResp - 4, // 8: pbAuth.Auth.UserToken:output_type -> pbAuth.UserTokenResp - 6, // 9: pbAuth.Auth.ForceLogout:output_type -> pbAuth.ForceLogoutResp - 7, // [7:10] is the sub-list for method output_type - 4, // [4:7] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_auth_auth_proto_init() } -func file_auth_auth_proto_init() { - if File_auth_auth_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_auth_auth_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CommonResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserRegisterReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserRegisterResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserTokenReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserTokenResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForceLogoutReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_auth_auth_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ForceLogoutResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_auth_auth_proto_rawDesc, - NumEnums: 0, - NumMessages: 7, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_auth_auth_proto_goTypes, - DependencyIndexes: file_auth_auth_proto_depIdxs, - MessageInfos: file_auth_auth_proto_msgTypes, - }.Build() - File_auth_auth_proto = out.File - file_auth_auth_proto_rawDesc = nil - file_auth_auth_proto_goTypes = nil - file_auth_auth_proto_depIdxs = nil +func init() { + proto.RegisterType((*CommonResp)(nil), "pbAuth.CommonResp") + proto.RegisterType((*UserRegisterReq)(nil), "pbAuth.UserRegisterReq") + proto.RegisterType((*UserRegisterResp)(nil), "pbAuth.UserRegisterResp") + proto.RegisterType((*UserTokenReq)(nil), "pbAuth.UserTokenReq") + proto.RegisterType((*UserTokenResp)(nil), "pbAuth.UserTokenResp") + proto.RegisterType((*ForceLogoutReq)(nil), "pbAuth.ForceLogoutReq") + proto.RegisterType((*ForceLogoutResp)(nil), "pbAuth.ForceLogoutResp") + proto.RegisterType((*ParseTokenReq)(nil), "pbAuth.ParseTokenReq") + proto.RegisterType((*ParseTokenResp)(nil), "pbAuth.ParseTokenResp") } // Reference imports to suppress errors if they are not otherwise used. var _ context.Context -var _ grpc.ClientConnInterface +var _ grpc.ClientConn // This is a compile-time assertion to ensure that this generated file // is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion6 +const _ = grpc.SupportPackageIsVersion4 + +// Client API for Auth service -// AuthClient is the client API for Auth service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type AuthClient interface { UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) + ParseToken(ctx context.Context, in *ParseTokenReq, opts ...grpc.CallOption) (*ParseTokenResp, error) } type authClient struct { - cc grpc.ClientConnInterface + cc *grpc.ClientConn } -func NewAuthClient(cc grpc.ClientConnInterface) AuthClient { +func NewAuthClient(cc *grpc.ClientConn) AuthClient { return &authClient{cc} } func (c *authClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts ...grpc.CallOption) (*UserRegisterResp, error) { out := new(UserRegisterResp) - err := c.cc.Invoke(ctx, "/pbAuth.Auth/UserRegister", in, out, opts...) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserRegister", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -700,7 +534,7 @@ func (c *authClient) UserRegister(ctx context.Context, in *UserRegisterReq, opts func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...grpc.CallOption) (*UserTokenResp, error) { out := new(UserTokenResp) - err := c.cc.Invoke(ctx, "/pbAuth.Auth/UserToken", in, out, opts...) + err := grpc.Invoke(ctx, "/pbAuth.Auth/UserToken", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -709,32 +543,29 @@ func (c *authClient) UserToken(ctx context.Context, in *UserTokenReq, opts ...gr func (c *authClient) ForceLogout(ctx context.Context, in *ForceLogoutReq, opts ...grpc.CallOption) (*ForceLogoutResp, error) { out := new(ForceLogoutResp) - err := c.cc.Invoke(ctx, "/pbAuth.Auth/ForceLogout", in, out, opts...) + err := grpc.Invoke(ctx, "/pbAuth.Auth/ForceLogout", in, out, c.cc, opts...) if err != nil { return nil, err } return out, nil } -// AuthServer is the server API for Auth service. +func (c *authClient) ParseToken(ctx context.Context, in *ParseTokenReq, opts ...grpc.CallOption) (*ParseTokenResp, error) { + out := new(ParseTokenResp) + err := grpc.Invoke(ctx, "/pbAuth.Auth/ParseToken", in, out, c.cc, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Server API for Auth service + type AuthServer interface { UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error) -} - -// UnimplementedAuthServer can be embedded to have forward compatible implementations. -type UnimplementedAuthServer struct { -} - -func (*UnimplementedAuthServer) UserRegister(context.Context, *UserRegisterReq) (*UserRegisterResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserRegister not implemented") -} -func (*UnimplementedAuthServer) UserToken(context.Context, *UserTokenReq) (*UserTokenResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserToken not implemented") -} -func (*UnimplementedAuthServer) ForceLogout(context.Context, *ForceLogoutReq) (*ForceLogoutResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ForceLogout not implemented") + ParseToken(context.Context, *ParseTokenReq) (*ParseTokenResp, error) } func RegisterAuthServer(s *grpc.Server, srv AuthServer) { @@ -795,6 +626,24 @@ func _Auth_ForceLogout_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Auth_ParseToken_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(ParseTokenReq) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AuthServer).ParseToken(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pbAuth.Auth/ParseToken", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AuthServer).ParseToken(ctx, req.(*ParseTokenReq)) + } + return interceptor(ctx, in, info, handler) +} + var _Auth_serviceDesc = grpc.ServiceDesc{ ServiceName: "pbAuth.Auth", HandlerType: (*AuthServer)(nil), @@ -811,7 +660,51 @@ var _Auth_serviceDesc = grpc.ServiceDesc{ MethodName: "ForceLogout", Handler: _Auth_ForceLogout_Handler, }, + { + MethodName: "ParseToken", + Handler: _Auth_ParseToken_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "auth/auth.proto", } + +func init() { proto.RegisterFile("auth/auth.proto", fileDescriptor_auth_71755bb03ef9bfd4) } + +var fileDescriptor_auth_71755bb03ef9bfd4 = []byte{ + // 537 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x54, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0x95, 0x9b, 0x26, 0xb4, 0x13, 0xd2, 0xc0, 0x2a, 0xa4, 0x96, 0x11, 0x10, 0xf9, 0x94, 0x03, + 0xb5, 0xa5, 0x70, 0x00, 0xa9, 0x52, 0xa5, 0x52, 0x1a, 0x64, 0xa9, 0x51, 0x2a, 0xb7, 0x5c, 0xb8, + 0x44, 0x6e, 0xb2, 0x75, 0xad, 0xd4, 0xde, 0x61, 0xd7, 0xa1, 0x48, 0x5c, 0x38, 0xf3, 0x19, 0x1c, + 0xf8, 0x4e, 0xb4, 0x6b, 0xaf, 0xb3, 0x69, 0xc2, 0xa5, 0x97, 0x5e, 0x12, 0xcd, 0x9b, 0xf1, 0xcc, + 0x7b, 0x6f, 0x76, 0x17, 0xda, 0xd1, 0x22, 0xbf, 0xf1, 0xe5, 0x8f, 0x87, 0x9c, 0xe5, 0x8c, 0x34, + 0xf0, 0xea, 0x78, 0x91, 0xdf, 0x38, 0xfd, 0x31, 0xd2, 0xec, 0x20, 0x18, 0x1d, 0x5c, 0x50, 0xfe, + 0x9d, 0x72, 0x1f, 0xe7, 0xb1, 0xaf, 0x2a, 0x7c, 0x31, 0x9b, 0x4f, 0xee, 0x84, 0x7f, 0x27, 0x8a, + 0x2f, 0xdc, 0x23, 0x80, 0x13, 0x96, 0xa6, 0x2c, 0x0b, 0xa9, 0x40, 0x62, 0xc3, 0x13, 0xca, 0xf9, + 0x09, 0x9b, 0x51, 0xdb, 0xea, 0x59, 0xfd, 0x7a, 0xa8, 0x43, 0xd2, 0x85, 0x06, 0xe5, 0x7c, 0x24, + 0x62, 0x7b, 0xab, 0x67, 0xf5, 0x77, 0xc3, 0x32, 0x72, 0x6f, 0xa1, 0xfd, 0x45, 0x50, 0x1e, 0xd2, + 0x38, 0x11, 0xb9, 0xfc, 0xff, 0x46, 0xde, 0xc3, 0x8e, 0x84, 0x82, 0xec, 0x9a, 0xa9, 0x2e, 0xcd, + 0xc1, 0x4b, 0x4f, 0x28, 0x1e, 0x93, 0x08, 0x93, 0x09, 0x46, 0x3c, 0x4a, 0x85, 0xa7, 0x4b, 0xc2, + 0xaa, 0x98, 0xf4, 0xa0, 0x39, 0x46, 0xca, 0xa3, 0x3c, 0x61, 0x59, 0xf0, 0xa9, 0x1c, 0x64, 0x42, + 0xee, 0x10, 0x9e, 0xad, 0x4e, 0x13, 0x48, 0x06, 0xa6, 0x82, 0x72, 0x20, 0xf1, 0x0a, 0x23, 0xbc, + 0x65, 0x26, 0x34, 0xaa, 0xdc, 0x3f, 0x16, 0x3c, 0x95, 0x8d, 0x2e, 0xd9, 0x9c, 0x66, 0x92, 0xb3, + 0x03, 0x3b, 0xe7, 0xb7, 0x51, 0x7e, 0xcd, 0x78, 0x5a, 0x2a, 0xaf, 0x62, 0xf2, 0x1a, 0x60, 0xc8, + 0x59, 0xaa, 0x68, 0x6a, 0x56, 0x06, 0x22, 0xbf, 0x1d, 0x63, 0x99, 0xad, 0xa9, 0x6c, 0x15, 0xdf, + 0x97, 0xb4, 0xbd, 0x26, 0x49, 0x5a, 0x7e, 0xc6, 0xe2, 0x24, 0x0b, 0xd0, 0xae, 0xab, 0xac, 0x0e, + 0xdd, 0x9f, 0xd0, 0x32, 0x38, 0x3e, 0x4c, 0x29, 0xe9, 0x40, 0x5d, 0x35, 0x28, 0x79, 0x17, 0x81, + 0xa4, 0x75, 0xfa, 0x03, 0x13, 0x4e, 0x67, 0x97, 0x49, 0x4a, 0x15, 0xeb, 0x5a, 0x68, 0x42, 0xee, + 0x6f, 0x0b, 0xf6, 0x86, 0x8c, 0x4f, 0xe9, 0x19, 0x8b, 0xd9, 0x22, 0x7f, 0x54, 0x8f, 0xdc, 0x53, + 0x68, 0xaf, 0x70, 0x79, 0xe0, 0xd6, 0x3f, 0x43, 0xeb, 0x3c, 0xe2, 0x82, 0x56, 0x5b, 0xef, 0x40, + 0x3d, 0x57, 0xe6, 0x58, 0x85, 0x39, 0xb9, 0x36, 0x87, 0xad, 0x1f, 0x43, 0x03, 0x72, 0xff, 0x5a, + 0xb0, 0x67, 0x76, 0x12, 0x28, 0xef, 0xc7, 0xa2, 0x90, 0x57, 0xf4, 0x2a, 0x23, 0x29, 0x1c, 0xb5, + 0x69, 0x45, 0xa7, 0x2a, 0x96, 0x1a, 0xa6, 0x4b, 0x0d, 0xb5, 0xff, 0x6b, 0x58, 0x56, 0x91, 0xb7, + 0xf0, 0x9c, 0xaa, 0x35, 0xc9, 0x2d, 0x5d, 0xd0, 0x29, 0xcb, 0x66, 0x42, 0x59, 0xd6, 0x0a, 0xd7, + 0x13, 0x83, 0x5f, 0x5b, 0xb0, 0x2d, 0xbb, 0x91, 0xe3, 0xe2, 0xbc, 0xeb, 0x8b, 0x43, 0xf6, 0xf5, + 0x98, 0x7b, 0x97, 0xd7, 0xb1, 0x37, 0x27, 0x04, 0x92, 0x0f, 0xb0, 0x5b, 0x1d, 0x47, 0xd2, 0x31, + 0xcb, 0xb4, 0x9f, 0xce, 0x8b, 0x0d, 0xa8, 0x40, 0x72, 0x04, 0x4d, 0x63, 0x7d, 0xa4, 0xab, 0xab, + 0x56, 0xcf, 0x97, 0xb3, 0xbf, 0x11, 0x17, 0x48, 0x0e, 0x01, 0x96, 0x6e, 0x93, 0x6a, 0xc8, 0xca, + 0x2e, 0x9d, 0xee, 0x26, 0x58, 0xe0, 0xc7, 0x37, 0x5f, 0x5f, 0xc9, 0xc7, 0x70, 0x12, 0x8c, 0x8c, + 0x57, 0x50, 0x3e, 0x99, 0x87, 0x45, 0xfd, 0x55, 0x43, 0x41, 0xef, 0xfe, 0x05, 0x00, 0x00, 0xff, + 0xff, 0x1e, 0xc0, 0x37, 0x3b, 0x4d, 0x05, 0x00, 0x00, +} diff --git a/pkg/proto/auth/auth.proto b/pkg/proto/auth/auth.proto index ee970268d..d6018c667 100644 --- a/pkg/proto/auth/auth.proto +++ b/pkg/proto/auth/auth.proto @@ -50,7 +50,7 @@ message ParseTokenReq{ message ParseTokenResp{ string userID = 1; - string operationID = 2; + string platform = 2; CommonResp commonResp = 3; uint32 expireTimeSeconds = 4; } From 51fa675e90b38b57a6ef61ac0c79a0a18ab86200 Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 26 Sep 2022 12:22:28 +0800 Subject: [PATCH 15/15] callback update --- internal/push/logic/callback.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/push/logic/callback.go b/internal/push/logic/callback.go index 746b9e122..788a6e6e6 100644 --- a/internal/push/logic/callback.go +++ b/internal/push/logic/callback.go @@ -62,7 +62,7 @@ func callbackOfflinePush(operationID string, userIDList []string, msg *commonPb. func callbackOnlinePush(operationID string, userIDList []string, msg *commonPb.MsgData) cbApi.CommonCallbackResp { callbackResp := cbApi.CommonCallbackResp{OperationID: operationID} - if !config.Config.Callback.CallbackOnlinePush.Enable { + if !config.Config.Callback.CallbackOnlinePush.Enable || utils.IsContain(msg.SendID, userIDList) { return callbackResp } req := cbApi.CallbackBeforePushReq{