From c048909a9dbf4472c7a134e8b311c3b9af3da187 Mon Sep 17 00:00:00 2001 From: icechen Date: Wed, 12 Jan 2022 00:40:37 +0800 Subject: [PATCH] feat: service-lark update --- app/zeus/service/lark/internal/lark/lark.go | 13 +- .../service/lark/{ => internal}/model/init.go | 0 .../lark/{ => internal}/model/user_info.go | 24 +- .../service/lark/internal/model/user_token.go | 47 ++++ .../lark/internal/{lark => server}/rpc.go | 22 +- app/zeus/service/lark/internal/server/user.go | 63 +++++ app/zeus/service/lark/main.go | 4 +- go.mod | 36 ++- go.sum | 72 ++++++ pkg/proto/.keep | 0 pkg/proto/zeus/lark/user.pb.go | 218 ++++++++++++++---- pkg/proto/zeus/lark/user.proto | 9 + pkg/rpc/.keep | 0 13 files changed, 420 insertions(+), 88 deletions(-) rename app/zeus/service/lark/{ => internal}/model/init.go (100%) rename app/zeus/service/lark/{ => internal}/model/user_info.go (68%) create mode 100644 app/zeus/service/lark/internal/model/user_token.go rename app/zeus/service/lark/internal/{lark => server}/rpc.go (58%) create mode 100644 app/zeus/service/lark/internal/server/user.go delete mode 100644 pkg/proto/.keep delete mode 100644 pkg/rpc/.keep diff --git a/app/zeus/service/lark/internal/lark/lark.go b/app/zeus/service/lark/internal/lark/lark.go index 55063c1..3e0252a 100644 --- a/app/zeus/service/lark/internal/lark/lark.go +++ b/app/zeus/service/lark/internal/lark/lark.go @@ -12,14 +12,15 @@ type Lark struct { conf *config.Config } -func NewLark() Lark { - appSettings := core.NewInternalAppSettings( - core.SetAppCredentials(cfg.Config.LarkAppID, cfg.Config.LarkAppSecret)) - conf := core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError)) +var lark Lark - return Lark{ - conf: conf, +func Client() Lark { + if lark.conf == nil { + appSettings := core.NewInternalAppSettings( + core.SetAppCredentials(cfg.Config.LarkAppID, cfg.Config.LarkAppSecret)) + lark.conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError)) } + return lark } func (l Lark) Auth(code string) (*authen.UserAccessTokenInfo, error) { diff --git a/app/zeus/service/lark/model/init.go b/app/zeus/service/lark/internal/model/init.go similarity index 100% rename from app/zeus/service/lark/model/init.go rename to app/zeus/service/lark/internal/model/init.go diff --git a/app/zeus/service/lark/model/user_info.go b/app/zeus/service/lark/internal/model/user_info.go similarity index 68% rename from app/zeus/service/lark/model/user_info.go rename to app/zeus/service/lark/internal/model/user_info.go index a2a5e50..25df436 100644 --- a/app/zeus/service/lark/model/user_info.go +++ b/app/zeus/service/lark/internal/model/user_info.go @@ -1,6 +1,9 @@ package model -import "gorm.io/gorm" +import ( + "git.icechen.cn/monorepo/backend/pkg/orm" + "gorm.io/gorm" +) type UserInfo struct { gorm.Model @@ -13,11 +16,11 @@ type UserInfo struct { AvatarThumb string `json:"avatar_thumb,omitempty" gorm:"avatar_thumb"` AvatarMiddle string `json:"avatar_middle,omitempty" gorm:"avatar_middle"` AvatarBig string `json:"avatar_big,omitempty" gorm:"avatar_big"` - OpenId string `json:"open_id,omitempty" gorm:"open_id"` - UnionId string `json:"union_id,omitempty" gorm:"union_id"` - Email string `json:"email,omitempty" gorm:"email"` + OpenId string `json:"open_id,omitempty" gorm:"open_id;uniqueIndex"` + UnionId string `json:"union_id,omitempty" gorm:"union_id;uniqueIndex"` + Email string `json:"email,omitempty" gorm:"email;uniqueIndex"` UserId string `json:"user_id,omitempty" gorm:"user_id"` - Mobile string `json:"mobile,omitempty" gorm:"mobile"` + Mobile string `json:"mobile,omitempty" gorm:"mobile;uniqueIndex"` TenantKey string `json:"tenant_key,omitempty" gorm:"tenant_key"` RefreshExpiresIn int `json:"refresh_expires_in,omitempty" gorm:"refresh_expires_in"` RefreshToken string `json:"refresh_token,omitempty" gorm:"refresh_token"` @@ -26,3 +29,14 @@ type UserInfo struct { func (UserInfo) TableName() string { return "user_info" } + +// CreateUser 创建用户 +func CreateUser(user *UserInfo) error { + return orm.DB.Where("open_id = ?", user.OpenId).Assign(user).FirstOrCreate(user).Error +} + +// GetUserByID 根据ID获取用户信息 +func GetUserByID(userID uint) (info UserInfo, err error) { + err = orm.DB.First(&info, userID).Error + return +} diff --git a/app/zeus/service/lark/internal/model/user_token.go b/app/zeus/service/lark/internal/model/user_token.go new file mode 100644 index 0000000..9d39f3c --- /dev/null +++ b/app/zeus/service/lark/internal/model/user_token.go @@ -0,0 +1,47 @@ +package model + +import ( + "git.icechen.cn/monorepo/backend/pkg/orm" + "github.com/gofiber/fiber/v2/utils" + "gorm.io/gorm" + "time" +) + +// TokenEffectiveTime token有效时长 +const TokenEffectiveTime = time.Hour * 2 + +type UserToken struct { + gorm.Model + Token string `json:"token" gorm:"token;uniqueIndex"` + ExpiresTime time.Time `json:"expires_time" gorm:"expires_time"` + UserInfoID uint `json:"user_info_id" gorm:"user_info_id"` +} + +func (UserToken) TableName() string { + return "user_token" +} + +// CreateToken 创建Token +func CreateToken(userInfoID uint) (string, error) { + userToken := UserToken{ + Token: genToken(), + ExpiresTime: time.Now().Add(TokenEffectiveTime), + UserInfoID: userInfoID, + } + err := orm.DB.Where("user_info_id = ?", userInfoID). + Assign(UserToken{UserInfoID: userInfoID}). + FirstOrCreate(&userToken).Error + return userToken.Token, err +} + +func genToken() string { + return utils.UUIDv4() +} + +// GetToken 根据token获取token对象 +func GetToken(token string) (UserToken, error) { + userToken := UserToken{} + err := orm.DB.Where("token = ? AND expires_time < ?", token, time.Now()). + First(&userToken).Error + return userToken, err +} diff --git a/app/zeus/service/lark/internal/lark/rpc.go b/app/zeus/service/lark/internal/server/rpc.go similarity index 58% rename from app/zeus/service/lark/internal/lark/rpc.go rename to app/zeus/service/lark/internal/server/rpc.go index 0811363..c8b9486 100644 --- a/app/zeus/service/lark/internal/lark/rpc.go +++ b/app/zeus/service/lark/internal/server/rpc.go @@ -1,7 +1,6 @@ -package lark +package server import ( - "context" "fmt" "google.golang.org/grpc/keepalive" "log" @@ -9,7 +8,6 @@ import ( "time" "git.icechen.cn/monorepo/backend/pkg/proto/zeus/lark" - "github.com/jinzhu/copier" "google.golang.org/grpc" "google.golang.org/grpc/reflection" ) @@ -23,7 +21,7 @@ func RpcServer() { s := grpc.NewServer(grpc.KeepaliveParams(keepalive.ServerParameters{ MaxConnectionIdle: 5 * time.Minute, })) - lark.RegisterUserServer(s, &Server{}) + lark.RegisterUserServer(s, &UserServer{}) reflection.Register(s) @@ -32,19 +30,3 @@ func RpcServer() { log.Fatalf("failed to serve: %v", err) } } - -type Server struct{} - -func (s Server) Login(ctx context.Context, in *lark.LoginRequest) (*lark.LoginResponse, error) { - userInfo, err := NewLark().Auth(in.Code) - if err != nil { - return nil, err - } - - resp := new(lark.LoginResponse) - err = copier.Copy(resp, userInfo) - if err != nil { - return nil, err - } - return resp, nil -} diff --git a/app/zeus/service/lark/internal/server/user.go b/app/zeus/service/lark/internal/server/user.go new file mode 100644 index 0000000..e45dcc8 --- /dev/null +++ b/app/zeus/service/lark/internal/server/user.go @@ -0,0 +1,63 @@ +package server + +import ( + "context" + lark2 "git.icechen.cn/monorepo/backend/app/zeus/service/lark/internal/lark" + "git.icechen.cn/monorepo/backend/app/zeus/service/lark/internal/model" + "git.icechen.cn/monorepo/backend/pkg/proto/zeus/lark" + "github.com/jinzhu/copier" +) + +type UserServer struct{} + +func (s UserServer) Login(ctx context.Context, in *lark.LoginRequest) (*lark.LoginResponse, error) { + userInfo, err := lark2.Client().Auth(in.Code) + if err != nil { + return nil, err + } + + // userInfo to db + user := model.UserInfo{} + err = copier.Copy(&user, userInfo) + if err != nil { + return nil, err + } + err = model.CreateUser(&user) + if err != nil { + return nil, err + } + + // gen token + token, err := model.CreateToken(user.ID) + if err != nil { + return nil, err + } + + // return token + resp := &lark.LoginResponse{ + Token: token, + } + return resp, nil +} + +func (s UserServer) Info(ctx context.Context, in *lark.InfoRequest) (*lark.InfoResponse, error) { + // token to user info + _ = in.Token + info, err := getUserByToken(in.Token) + if err != nil { + return nil, err + } + + resp := new(lark.InfoResponse) + err = copier.Copy(resp, info) + return resp, err +} + +func getUserByToken(token string) (model.UserInfo, error) { + userToken, err := model.GetToken(token) + if err != nil { + return model.UserInfo{}, err + } + + return model.GetUserByID(userToken.UserInfoID) +} diff --git a/app/zeus/service/lark/main.go b/app/zeus/service/lark/main.go index 5a8c693..582d442 100755 --- a/app/zeus/service/lark/main.go +++ b/app/zeus/service/lark/main.go @@ -1,9 +1,9 @@ package main import ( - "git.icechen.cn/monorepo/backend/app/zeus/service/lark/internal/lark" + "git.icechen.cn/monorepo/backend/app/zeus/service/lark/internal/server" ) func main() { - lark.RpcServer() + server.RpcServer() } diff --git a/go.mod b/go.mod index 2574691..b803414 100644 --- a/go.mod +++ b/go.mod @@ -15,25 +15,41 @@ require ( ) require ( - github.com/andybalholm/brotli v1.0.2 // indirect + github.com/andybalholm/brotli v1.0.4 // indirect github.com/coreos/go-semver v0.3.0 // indirect github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/gin-gonic/gin v1.7.7 // indirect + github.com/go-playground/locales v0.14.0 // indirect + github.com/go-playground/universal-translator v0.18.0 // indirect + github.com/go-playground/validator/v10 v10.10.0 // indirect github.com/go-sql-driver/mysql v1.6.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/jinzhu/inflection v1.0.0 // indirect github.com/jinzhu/now v1.1.3 // indirect - github.com/klauspost/compress v1.13.4 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.13.6 // indirect + github.com/leodido/go-urn v1.2.1 // indirect + github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible // indirect + github.com/lestrrat-go/strftime v1.0.5 // indirect + github.com/luizsuper/ctxLoggers v1.0.3 // indirect + github.com/mattn/go-isatty v0.0.14 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/ugorji/go/codec v1.2.6 // indirect github.com/valyala/bytebufferpool v1.0.0 // indirect - github.com/valyala/fasthttp v1.31.0 // indirect + github.com/valyala/fasthttp v1.32.0 // indirect github.com/valyala/tcplisten v1.0.0 // indirect go.etcd.io/etcd/api/v3 v3.5.1 // indirect go.etcd.io/etcd/client/pkg/v3 v3.5.1 // indirect - go.uber.org/atomic v1.7.0 // indirect - go.uber.org/multierr v1.6.0 // indirect - go.uber.org/zap v1.17.0 // indirect - golang.org/x/net v0.0.0-20210510120150-4163338589ed // indirect - golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 // indirect - golang.org/x/text v0.3.6 // indirect + go.uber.org/atomic v1.9.0 // indirect + go.uber.org/multierr v1.7.0 // indirect + go.uber.org/zap v1.20.0 // indirect + golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 // indirect + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect + golang.org/x/sys v0.0.0-20220111092808-5a964db01320 // indirect + golang.org/x/text v0.3.7 // indirect google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c // indirect - google.golang.org/protobuf v1.26.0 // indirect + google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect ) diff --git a/go.sum b/go.sum index 6df08c3..fc7493a 100644 --- a/go.sum +++ b/go.sum @@ -8,7 +8,10 @@ github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRF github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/andybalholm/brotli v1.0.2 h1:JKnhI/XQ75uFBTiuzXpzFrUriDPiZjlOSzh6wXogP0E= github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.4 h1:V7DdXeJtZscaqfNuAdSRuRFzuiKlHSC/Zh3zl9qY3JY= +github.com/andybalholm/brotli v1.0.4/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= @@ -25,6 +28,7 @@ github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmf github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= github.com/coreos/go-systemd/v22 v22.3.2 h1:D9/bQk5vlXQFZ6Kwuu6zaiXJ9oTPe68++AzAJc1DzSI= github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -40,8 +44,11 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE= github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI= github.com/gin-gonic/gin v1.6.3/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M= +github.com/gin-gonic/gin v1.7.7 h1:3DoBmSbJbZAWqXJC3SLjAPfutPJJRN1U5pALB7EeTTs= +github.com/gin-gonic/gin v1.7.7/go.mod h1:axIBovoeJpVj8S3BwE0uPMTeReE4+AfFtqpqaZ1qq1U= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= @@ -50,8 +57,15 @@ github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/locales v0.14.0 h1:u50s323jtVGugKlcYeyzC0etD1HifMjqmJqb8WugfUU= +github.com/go-playground/locales v0.14.0/go.mod h1:sawfccIbzZTqEDETgFXqTho0QybSa7l++s0DH+LDiLs= github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/universal-translator v0.18.0 h1:82dyy6p4OuJq4/CByFNOn/jYrnRPArHwAcmLoJZxyho= +github.com/go-playground/universal-translator v0.18.0/go.mod h1:UvRDBj+xPUEGrFYl+lu/H90nyDXpg0fqeB/AQUGNTVA= github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-playground/validator/v10 v10.10.0 h1:I7mrTYv78z8k8VXa/qJlOlEXn/nBh+BF8dHX5nt/dr0= +github.com/go-playground/validator/v10 v10.10.0/go.mod h1:74x4gJWsvQexRdW8Pn3dXSGrTK4nAUsbPlLADvpJkos= github.com/go-redis/redis/v8 v8.2.2/go.mod h1:ysgGY09J/QeDYbu3HikWEIPCwaeOkuNoTgKayTEaEOw= github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= @@ -105,27 +119,48 @@ github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCV github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/klauspost/compress v1.13.4 h1:0zhec2I8zGnjWcKyLl6i3gPqKANCCn5e9xmviEEeX6s= github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.6 h1:P76CopJELS0TiO2mebmnzgWaajssP/EszplttgQxcgc= +github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/larksuite/oapi-sdk-go v1.1.43 h1:DVUAbiYOfE+1yPyTKYofxcEpB027nhq9Lfk2DaLX960= github.com/larksuite/oapi-sdk-go v1.1.43/go.mod h1:7ybKAbVdKBjXuX0YrMTfnWUyCaIe/zeI1wqjNfN9XOk= github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/leodido/go-urn v1.2.1 h1:BqpAaACuzVSgi/VLzGZIobT2z4v53pjosyNd9Yv6n/w= +github.com/leodido/go-urn v1.2.1/go.mod h1:zt4jvISO2HfUBqxjfIshjdMTYS56ZS/qv49ictyFfxY= +github.com/lestrrat-go/envload v0.0.0-20180220234015-a3eb8ddeffcc/go.mod h1:kopuH9ugFRkIXf3YoqHKyrJ9YfUFsckUU9S7B+XP+is= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible h1:Y6sqxHMyB1D2YSzWkLibYKgg+SwmyFU9dF2hn6MdTj4= +github.com/lestrrat-go/file-rotatelogs v2.4.0+incompatible/go.mod h1:ZQnN8lSECaebrkQytbHj4xNgtg8CR7RYXnPok8e0EHA= +github.com/lestrrat-go/strftime v1.0.5 h1:A7H3tT8DhTz8u65w+JRpiBxM4dINQhUXAZnhBa2xeOE= +github.com/lestrrat-go/strftime v1.0.5/go.mod h1:E1nN3pCbtMSu1yjSVeyuRFVm/U0xoR76fd03sz+Qz4g= +github.com/luizsuper/ctxLoggers v1.0.3 h1:u7YGzxhXb2uHm2sJxoO70xfpHz97PC7wIsmsX43Auzc= +github.com/luizsuper/ctxLoggers v1.0.3/go.mod h1:wjnYowzWZwBJ7eWVwtcZN9Vbb4DdW8VHKSXzCvsdjIo= github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= @@ -135,6 +170,7 @@ github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9k github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= github.com/onsi/gomega v1.10.2/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= @@ -157,6 +193,8 @@ github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsT github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= +github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6poM+XZ2dLUbcbE= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= @@ -171,11 +209,17 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= +github.com/ugorji/go v1.2.6 h1:tGiWC9HENWE2tqYycIqFTNorMmFRVhNwCpDOpWqnk8E= +github.com/ugorji/go v1.2.6/go.mod h1:anCg0y61KIhDlPZmnH+so+RQbysYVyDko0IMgJv0Nn0= github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= +github.com/ugorji/go/codec v1.2.6 h1:7kbGefxLoDBuYXOms4yD7223OpNMMPNPZxXk5TvFcyQ= +github.com/ugorji/go/codec v1.2.6/go.mod h1:V6TCNZ4PHqoHGFZuSG1W8nrCzzdgA2DozYxWFFpvxTw= github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasthttp v1.31.0 h1:lrauRLII19afgCs2fnWRJ4M5IkV0lo2FqA61uGkNBfE= github.com/valyala/fasthttp v1.31.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/fasthttp v1.32.0 h1:keswgWzyKyNIIjz2a7JmCYHOOIkRp6HMx9oTV6QrZWY= +github.com/valyala/fasthttp v1.32.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= github.com/valyala/tcplisten v1.0.0 h1:rBHj/Xf+E1tRGZyWIWwJDiRY0zc1Js+CV5DqwacVSA8= github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -191,19 +235,30 @@ go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQO go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/atomic v1.9.0 h1:ECmE8Bn/WFTYwEW/bpKD3M8VtR/zQVbavAoalC1PYyE= +go.uber.org/atomic v1.9.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.7.0 h1:zaiO/rmgFjbmCXdSYJWQcdvOCsthmdaHfr3Gm2Kx4Ec= +go.uber.org/multierr v1.7.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.20.0 h1:N4oPlghZwYG55MlU6LXk/Zp00FVNE9X9wrYO8CEs4lc= +go.uber.org/zap v1.20.0/go.mod h1:wjWOCqI0f2ZZrJF/UufIOkiC8ii6tm1iqIsLo76RfJw= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3 h1:0es+/5331RGQPcXlMfP+WrnIIS6dNnNRe0WB02W0F4M= +golang.org/x/crypto v0.0.0-20211215153901-e495a2d5b3d3/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -228,6 +283,8 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210510120150-4163338589ed h1:p9UgmWI9wKpfYmgaV/IZKGdXc5qEK45tDwwwDyjS26I= golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -266,6 +323,11 @@ golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40 h1:JWgyZ1qgdTaF3N3oxC+MdTV7qvEEgHo3otj+HB5CM7Q= golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY= +golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= @@ -273,6 +335,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -283,6 +347,7 @@ golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapK golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= @@ -317,9 +382,14 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -330,6 +400,8 @@ gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/pkg/proto/.keep b/pkg/proto/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/pkg/proto/zeus/lark/user.pb.go b/pkg/proto/zeus/lark/user.pb.go index 86f8ae7..80921fa 100644 --- a/pkg/proto/zeus/lark/user.pb.go +++ b/pkg/proto/zeus/lark/user.pb.go @@ -64,18 +64,7 @@ func (m *LoginRequest) GetCode() string { } type LoginResponse struct { - AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - EnName string `protobuf:"bytes,3,opt,name=en_name,json=enName,proto3" json:"en_name,omitempty"` - AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` - AvatarThumb string `protobuf:"bytes,5,opt,name=avatar_thumb,json=avatarThumb,proto3" json:"avatar_thumb,omitempty"` - AvatarMiddle string `protobuf:"bytes,6,opt,name=avatar_middle,json=avatarMiddle,proto3" json:"avatar_middle,omitempty"` - AvatarBig string `protobuf:"bytes,7,opt,name=avatar_big,json=avatarBig,proto3" json:"avatar_big,omitempty"` - OpenId string `protobuf:"bytes,8,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"` - UnionId string `protobuf:"bytes,9,opt,name=union_id,json=unionId,proto3" json:"union_id,omitempty"` - Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"` - UserId string `protobuf:"bytes,11,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` - Mobile string `protobuf:"bytes,12,opt,name=mobile,proto3" json:"mobile,omitempty"` + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` XXX_NoUnkeyedLiteral struct{} `json:"-"` XXX_unrecognized []byte `json:"-"` XXX_sizecache int32 `json:"-"` @@ -106,84 +95,181 @@ func (m *LoginResponse) XXX_DiscardUnknown() { var xxx_messageInfo_LoginResponse proto.InternalMessageInfo -func (m *LoginResponse) GetAccessToken() string { +func (m *LoginResponse) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +type InfoRequest struct { + Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InfoRequest) Reset() { *m = InfoRequest{} } +func (m *InfoRequest) String() string { return proto.CompactTextString(m) } +func (*InfoRequest) ProtoMessage() {} +func (*InfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_116e343673f7ffaf, []int{2} +} + +func (m *InfoRequest) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InfoRequest.Unmarshal(m, b) +} +func (m *InfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InfoRequest.Marshal(b, m, deterministic) +} +func (m *InfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoRequest.Merge(m, src) +} +func (m *InfoRequest) XXX_Size() int { + return xxx_messageInfo_InfoRequest.Size(m) +} +func (m *InfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_InfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_InfoRequest proto.InternalMessageInfo + +func (m *InfoRequest) GetToken() string { + if m != nil { + return m.Token + } + return "" +} + +type InfoResponse struct { + Id uint64 `protobuf:"varint,13,opt,name=id,proto3" json:"id,omitempty"` + AccessToken string `protobuf:"bytes,1,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + EnName string `protobuf:"bytes,3,opt,name=en_name,json=enName,proto3" json:"en_name,omitempty"` + AvatarUrl string `protobuf:"bytes,4,opt,name=avatar_url,json=avatarUrl,proto3" json:"avatar_url,omitempty"` + AvatarThumb string `protobuf:"bytes,5,opt,name=avatar_thumb,json=avatarThumb,proto3" json:"avatar_thumb,omitempty"` + AvatarMiddle string `protobuf:"bytes,6,opt,name=avatar_middle,json=avatarMiddle,proto3" json:"avatar_middle,omitempty"` + AvatarBig string `protobuf:"bytes,7,opt,name=avatar_big,json=avatarBig,proto3" json:"avatar_big,omitempty"` + OpenId string `protobuf:"bytes,8,opt,name=open_id,json=openId,proto3" json:"open_id,omitempty"` + UnionId string `protobuf:"bytes,9,opt,name=union_id,json=unionId,proto3" json:"union_id,omitempty"` + Email string `protobuf:"bytes,10,opt,name=email,proto3" json:"email,omitempty"` + UserId string `protobuf:"bytes,11,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` + Mobile string `protobuf:"bytes,12,opt,name=mobile,proto3" json:"mobile,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *InfoResponse) Reset() { *m = InfoResponse{} } +func (m *InfoResponse) String() string { return proto.CompactTextString(m) } +func (*InfoResponse) ProtoMessage() {} +func (*InfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_116e343673f7ffaf, []int{3} +} + +func (m *InfoResponse) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_InfoResponse.Unmarshal(m, b) +} +func (m *InfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_InfoResponse.Marshal(b, m, deterministic) +} +func (m *InfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_InfoResponse.Merge(m, src) +} +func (m *InfoResponse) XXX_Size() int { + return xxx_messageInfo_InfoResponse.Size(m) +} +func (m *InfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_InfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_InfoResponse proto.InternalMessageInfo + +func (m *InfoResponse) GetId() uint64 { + if m != nil { + return m.Id + } + return 0 +} + +func (m *InfoResponse) GetAccessToken() string { if m != nil { return m.AccessToken } return "" } -func (m *LoginResponse) GetName() string { +func (m *InfoResponse) GetName() string { if m != nil { return m.Name } return "" } -func (m *LoginResponse) GetEnName() string { +func (m *InfoResponse) GetEnName() string { if m != nil { return m.EnName } return "" } -func (m *LoginResponse) GetAvatarUrl() string { +func (m *InfoResponse) GetAvatarUrl() string { if m != nil { return m.AvatarUrl } return "" } -func (m *LoginResponse) GetAvatarThumb() string { +func (m *InfoResponse) GetAvatarThumb() string { if m != nil { return m.AvatarThumb } return "" } -func (m *LoginResponse) GetAvatarMiddle() string { +func (m *InfoResponse) GetAvatarMiddle() string { if m != nil { return m.AvatarMiddle } return "" } -func (m *LoginResponse) GetAvatarBig() string { +func (m *InfoResponse) GetAvatarBig() string { if m != nil { return m.AvatarBig } return "" } -func (m *LoginResponse) GetOpenId() string { +func (m *InfoResponse) GetOpenId() string { if m != nil { return m.OpenId } return "" } -func (m *LoginResponse) GetUnionId() string { +func (m *InfoResponse) GetUnionId() string { if m != nil { return m.UnionId } return "" } -func (m *LoginResponse) GetEmail() string { +func (m *InfoResponse) GetEmail() string { if m != nil { return m.Email } return "" } -func (m *LoginResponse) GetUserId() string { +func (m *InfoResponse) GetUserId() string { if m != nil { return m.UserId } return "" } -func (m *LoginResponse) GetMobile() string { +func (m *InfoResponse) GetMobile() string { if m != nil { return m.Mobile } @@ -193,32 +279,38 @@ func (m *LoginResponse) GetMobile() string { func init() { proto.RegisterType((*LoginRequest)(nil), "example_service.LoginRequest") proto.RegisterType((*LoginResponse)(nil), "example_service.LoginResponse") + proto.RegisterType((*InfoRequest)(nil), "example_service.InfoRequest") + proto.RegisterType((*InfoResponse)(nil), "example_service.InfoResponse") } func init() { proto.RegisterFile("user.proto", fileDescriptor_116e343673f7ffaf) } var fileDescriptor_116e343673f7ffaf = []byte{ - // 320 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x91, 0x41, 0x4b, 0x03, 0x31, - 0x10, 0x85, 0x6d, 0xdd, 0x6e, 0xdb, 0x69, 0x8b, 0x10, 0x44, 0xa3, 0x50, 0xd1, 0xf5, 0xe2, 0xa9, - 0x07, 0xfd, 0x07, 0x3d, 0x59, 0x50, 0x91, 0xd2, 0x5e, 0xbc, 0x2c, 0xd9, 0xcd, 0x50, 0x43, 0xb3, - 0xc9, 0x9a, 0xec, 0x16, 0x7f, 0xae, 0x3f, 0x45, 0x32, 0xd9, 0x43, 0x11, 0xbc, 0xe5, 0x7d, 0xef, - 0x65, 0x26, 0xe4, 0x01, 0xb4, 0x1e, 0xdd, 0xa2, 0x76, 0xb6, 0xb1, 0xec, 0x0c, 0xbf, 0x45, 0x55, - 0x6b, 0xcc, 0x3d, 0xba, 0x83, 0x2a, 0x31, 0xcb, 0x60, 0xfa, 0x62, 0x77, 0xca, 0xac, 0xf1, 0xab, - 0x45, 0xdf, 0x30, 0x06, 0x49, 0x69, 0x25, 0xf2, 0xde, 0x6d, 0xef, 0x61, 0xbc, 0xa6, 0x73, 0xf6, - 0xd3, 0x87, 0x59, 0x17, 0xf2, 0xb5, 0x35, 0x1e, 0xd9, 0x1d, 0x4c, 0x45, 0x59, 0xa2, 0xf7, 0x79, - 0x63, 0xf7, 0x68, 0xba, 0xf4, 0x24, 0xb2, 0x4d, 0x40, 0x61, 0x90, 0x11, 0x15, 0xf2, 0x7e, 0x1c, - 0x14, 0xce, 0xec, 0x12, 0x86, 0x68, 0x72, 0xc2, 0xa7, 0x84, 0x53, 0x34, 0x6f, 0xc1, 0x98, 0x03, - 0x88, 0x83, 0x68, 0x84, 0xcb, 0x5b, 0xa7, 0x79, 0x42, 0xde, 0x38, 0x92, 0xad, 0xd3, 0xb4, 0x2e, - 0xda, 0xcd, 0x67, 0x5b, 0x15, 0x7c, 0xd0, 0xad, 0x23, 0xb6, 0x09, 0x88, 0xdd, 0xc3, 0xac, 0x8b, - 0x54, 0x4a, 0x4a, 0x8d, 0x3c, 0xa5, 0x4c, 0x77, 0xef, 0x95, 0xd8, 0xd1, 0x9a, 0x42, 0xed, 0xf8, - 0xf0, 0x78, 0xcd, 0x52, 0xed, 0xc2, 0xf3, 0x6c, 0x8d, 0x26, 0x57, 0x92, 0x8f, 0xe2, 0xf3, 0x82, - 0x5c, 0x49, 0x76, 0x05, 0xa3, 0xd6, 0x28, 0x4b, 0xce, 0x98, 0x9c, 0x21, 0xe9, 0x95, 0x64, 0xe7, - 0x30, 0xc0, 0x4a, 0x28, 0xcd, 0x81, 0x78, 0x14, 0x61, 0x52, 0xf8, 0xf4, 0x90, 0x9f, 0xc4, 0x49, - 0x41, 0xae, 0x24, 0xbb, 0x80, 0xb4, 0xb2, 0x85, 0xd2, 0xc8, 0xa7, 0x91, 0x47, 0xf5, 0xf8, 0x0e, - 0xc9, 0xd6, 0xa3, 0x63, 0xcf, 0x30, 0xa0, 0x9f, 0x66, 0xf3, 0xc5, 0x9f, 0xa6, 0x16, 0xc7, 0x35, - 0x5d, 0xdf, 0xfc, 0x67, 0xc7, 0x82, 0xb2, 0x93, 0x65, 0xfa, 0x91, 0x68, 0xe1, 0xf6, 0x45, 0x4a, - 0xc5, 0x3f, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x68, 0x47, 0xbc, 0x3c, 0x06, 0x02, 0x00, 0x00, + // 380 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x52, 0xcd, 0x8e, 0xd3, 0x30, + 0x10, 0x26, 0x21, 0x4d, 0xdb, 0x69, 0x0a, 0x92, 0x85, 0xc0, 0x54, 0x14, 0x95, 0x54, 0x48, 0x3d, + 0xf5, 0x00, 0x6f, 0x50, 0x09, 0x89, 0x48, 0xc0, 0xa1, 0x6a, 0x2f, 0x5c, 0x22, 0x27, 0x1e, 0x8a, + 0xd5, 0xc4, 0x0e, 0x76, 0x52, 0xf1, 0x26, 0xfb, 0x98, 0xfb, 0x0a, 0x2b, 0xdb, 0xa9, 0x14, 0xed, + 0x6e, 0x6f, 0xfe, 0x7e, 0xfc, 0xcd, 0x68, 0x66, 0x00, 0x3a, 0x83, 0x7a, 0xdb, 0x68, 0xd5, 0x2a, + 0xf2, 0x1a, 0xff, 0xb3, 0xba, 0xa9, 0x30, 0x37, 0xa8, 0x2f, 0xa2, 0xc4, 0x34, 0x85, 0xe4, 0x87, + 0x3a, 0x09, 0xb9, 0xc7, 0x7f, 0x1d, 0x9a, 0x96, 0x10, 0x88, 0x4a, 0xc5, 0x91, 0x06, 0xab, 0x60, + 0x33, 0xdd, 0xbb, 0x77, 0xfa, 0x19, 0xe6, 0xbd, 0xc7, 0x34, 0x4a, 0x1a, 0x24, 0x6f, 0x60, 0xd4, + 0xaa, 0x33, 0xca, 0xde, 0xe5, 0x41, 0xba, 0x86, 0x59, 0x26, 0xff, 0xa8, 0x6b, 0xd2, 0xf3, 0xa6, + 0xfb, 0x10, 0x12, 0xef, 0xea, 0xb3, 0x5e, 0x41, 0x28, 0x38, 0x9d, 0xaf, 0x82, 0x4d, 0xb4, 0x0f, + 0x05, 0x27, 0x9f, 0x20, 0x61, 0x65, 0x89, 0xc6, 0xe4, 0xc3, 0xdf, 0x33, 0xcf, 0x1d, 0x2c, 0x65, + 0x7b, 0x94, 0xac, 0x46, 0x1a, 0xfa, 0x1e, 0xed, 0x9b, 0xbc, 0x83, 0x31, 0xca, 0xdc, 0xd1, 0x2f, + 0x1d, 0x1d, 0xa3, 0xfc, 0x65, 0x85, 0x25, 0x00, 0xbb, 0xb0, 0x96, 0xe9, 0xbc, 0xd3, 0x15, 0x8d, + 0x9c, 0x36, 0xf5, 0xcc, 0x51, 0x57, 0xae, 0x9c, 0x97, 0xdb, 0xbf, 0x5d, 0x5d, 0xd0, 0x51, 0x5f, + 0xce, 0x71, 0x07, 0x4b, 0x91, 0x35, 0xcc, 0x7b, 0x4b, 0x2d, 0x38, 0xaf, 0x90, 0xc6, 0xce, 0xd3, + 0xff, 0xfb, 0xe9, 0xb8, 0x41, 0x99, 0x42, 0x9c, 0xe8, 0x78, 0x58, 0x66, 0x27, 0x4e, 0xb6, 0x3d, + 0xd5, 0xa0, 0xcc, 0x05, 0xa7, 0x13, 0xdf, 0x9e, 0x85, 0x19, 0x27, 0xef, 0x61, 0xd2, 0x49, 0xa1, + 0x9c, 0x32, 0x75, 0xca, 0xd8, 0xe1, 0x8c, 0xdb, 0x01, 0x62, 0xcd, 0x44, 0x45, 0xc1, 0x0f, 0xd0, + 0x01, 0x9b, 0x64, 0xf7, 0x69, 0xfd, 0x33, 0x9f, 0x64, 0x61, 0xc6, 0xc9, 0x5b, 0x88, 0x6b, 0x55, + 0x88, 0x0a, 0x69, 0xe2, 0x79, 0x8f, 0xbe, 0xdc, 0x05, 0x10, 0x1d, 0x0d, 0x6a, 0xf2, 0x1d, 0x46, + 0x6e, 0x8d, 0x64, 0xb9, 0x7d, 0x74, 0x05, 0xdb, 0xe1, 0x09, 0x2c, 0x3e, 0xde, 0x92, 0xfd, 0xc6, + 0xd2, 0x17, 0xe4, 0x1b, 0x44, 0x76, 0x87, 0xe4, 0xc3, 0x13, 0xe7, 0xe0, 0x00, 0x16, 0xcb, 0x1b, + 0xea, 0x35, 0x66, 0x17, 0xff, 0x8e, 0x2a, 0xa6, 0xcf, 0x45, 0xec, 0x6e, 0xf3, 0xeb, 0x43, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x46, 0x1e, 0x8d, 0x0a, 0xa9, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -234,6 +326,7 @@ const _ = grpc.SupportPackageIsVersion4 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. type UserClient interface { Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) + Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) } type userClient struct { @@ -253,9 +346,19 @@ func (c *userClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.C return out, nil } +func (c *userClient) Info(ctx context.Context, in *InfoRequest, opts ...grpc.CallOption) (*InfoResponse, error) { + out := new(InfoResponse) + err := c.cc.Invoke(ctx, "/example_service.User/Info", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // UserServer is the server API for User service. type UserServer interface { Login(context.Context, *LoginRequest) (*LoginResponse, error) + Info(context.Context, *InfoRequest) (*InfoResponse, error) } // UnimplementedUserServer can be embedded to have forward compatible implementations. @@ -265,6 +368,9 @@ type UnimplementedUserServer struct { func (*UnimplementedUserServer) Login(ctx context.Context, req *LoginRequest) (*LoginResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Login not implemented") } +func (*UnimplementedUserServer) Info(ctx context.Context, req *InfoRequest) (*InfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Info not implemented") +} func RegisterUserServer(s *grpc.Server, srv UserServer) { s.RegisterService(&_User_serviceDesc, srv) @@ -288,6 +394,24 @@ func _User_Login_Handler(srv interface{}, ctx context.Context, dec func(interfac return interceptor(ctx, in, info, handler) } +func _User_Info_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(InfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(UserServer).Info(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/example_service.User/Info", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(UserServer).Info(ctx, req.(*InfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _User_serviceDesc = grpc.ServiceDesc{ ServiceName: "example_service.User", HandlerType: (*UserServer)(nil), @@ -296,6 +420,10 @@ var _User_serviceDesc = grpc.ServiceDesc{ MethodName: "Login", Handler: _User_Login_Handler, }, + { + MethodName: "Info", + Handler: _User_Info_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", diff --git a/pkg/proto/zeus/lark/user.proto b/pkg/proto/zeus/lark/user.proto index 56d092c..fdcefdb 100644 --- a/pkg/proto/zeus/lark/user.proto +++ b/pkg/proto/zeus/lark/user.proto @@ -6,6 +6,7 @@ package example_service; service User { rpc Login (LoginRequest) returns (LoginResponse) {} + rpc Info (InfoRequest) returns (InfoResponse) {} } message LoginRequest { @@ -13,6 +14,14 @@ message LoginRequest { } message LoginResponse { + string token = 1; +} + +message InfoRequest { + string token = 1; +} + +message InfoResponse { uint64 id = 13; string access_token = 1; string name = 2; diff --git a/pkg/rpc/.keep b/pkg/rpc/.keep deleted file mode 100644 index e69de29..0000000