generated from pkg/go-template
commit
6701d2ba15
|
@ -0,0 +1,31 @@
|
|||
package user
|
||||
|
||||
import (
|
||||
"git.icechen.cn/monorepo/backend/pkg/proto/zeus/lark"
|
||||
"git.icechen.cn/monorepo/backend/pkg/rpc"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
ctxLogger "github.com/luizsuper/ctxLoggers"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
var ErrorUser = fiber.NewError(0, "错误")
|
||||
|
||||
func LoginHandle(c *fiber.Ctx) error {
|
||||
var p = struct {
|
||||
Code string `json:"code"`
|
||||
}{}
|
||||
err := c.BodyParser(&p)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
response, err := lark.NewUserClient(rpc.GetServiceConn("lark")).Login(c.Context(), &lark.LoginRequest{
|
||||
Code: p.Code,
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
ctxLogger.FInfo(c, "response", zap.Any("resp", response))
|
||||
return c.JSON(response)
|
||||
}
|
|
@ -1,11 +1,64 @@
|
|||
package main
|
||||
|
||||
import "github.com/gofiber/fiber/v2"
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"git.icechen.cn/monorepo/backend/app/zeus/api/lark/internal/user"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
ctxLogger "github.com/luizsuper/ctxLoggers"
|
||||
)
|
||||
|
||||
func main() {
|
||||
router := fiber.New()
|
||||
router.Get("/user", func(ctx *fiber.Ctx) error {
|
||||
return ctx.SendString("user")
|
||||
router := fiber.New(fiber.Config{
|
||||
AppName: "api-lark",
|
||||
ErrorHandler: middlewareError,
|
||||
})
|
||||
// router.Use(middlewareResp)
|
||||
|
||||
userRouter := router.Group("/user")
|
||||
userRouter.Post("/login", user.LoginHandle)
|
||||
|
||||
err := router.Listen(":8080")
|
||||
if err != nil {
|
||||
ctxLogger.Error(nil, err.Error())
|
||||
}
|
||||
}
|
||||
|
||||
func middlewareResp(c *fiber.Ctx) error {
|
||||
err := c.Next()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp := Response{
|
||||
Code: 0,
|
||||
Message: "",
|
||||
Data: c.Response().Body(),
|
||||
}
|
||||
return c.JSON(resp)
|
||||
}
|
||||
|
||||
type Response struct {
|
||||
Code int `json:"code"`
|
||||
Message string `json:"message"`
|
||||
Data json.RawMessage `json:"data"`
|
||||
}
|
||||
|
||||
func middlewareError(ctx *fiber.Ctx, err error) error {
|
||||
code := fiber.StatusInternalServerError
|
||||
msg := ""
|
||||
|
||||
if e, ok := err.(*fiber.Error); ok {
|
||||
code = e.Code
|
||||
msg = e.Message
|
||||
}
|
||||
if err != nil {
|
||||
msg = err.Error()
|
||||
}
|
||||
|
||||
return ctx.Status(code).JSON(Response{
|
||||
Code: code,
|
||||
Message: msg,
|
||||
Data: nil,
|
||||
})
|
||||
router.Listen(":8080")
|
||||
}
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
package lark
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/larksuite/oapi-sdk-go/core"
|
||||
im "github.com/larksuite/oapi-sdk-go/service/im/v1"
|
||||
)
|
||||
|
||||
func (l Lark) SendMessage(code string) error {
|
||||
coreCtx := core.WrapContext(context.Background())
|
||||
|
||||
reqCall := l.imService.Messages.Create(coreCtx, &im.MessageCreateReqBody{
|
||||
ReceiveId: "ou_a11d2bcc7d852afbcaf37e5b3ad01f7e",
|
||||
Content: `{"text":"<at user_id="ou_a11d2bcc7d852afbcaf37e5b3ad01f7e">Tom</at> test content"}`,
|
||||
MsgType: "text",
|
||||
})
|
||||
reqCall.SetReceiveIdType("user_id")
|
||||
_, err := reqCall.Do()
|
||||
return err
|
||||
}
|
|
@ -1,31 +1,28 @@
|
|||
package lark
|
||||
|
||||
import (
|
||||
"context"
|
||||
cfg "git.icechen.cn/monorepo/backend/app/zeus/service/lark/internal/config"
|
||||
"github.com/larksuite/oapi-sdk-go/core"
|
||||
"github.com/larksuite/oapi-sdk-go/core/config"
|
||||
authen "github.com/larksuite/oapi-sdk-go/service/authen/v1"
|
||||
im "github.com/larksuite/oapi-sdk-go/service/im/v1"
|
||||
)
|
||||
|
||||
type Lark struct {
|
||||
conf *config.Config
|
||||
conf *config.Config
|
||||
userService *authen.Service
|
||||
imService *im.Service
|
||||
}
|
||||
|
||||
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 || lark.userService == nil {
|
||||
appSettings := core.NewInternalAppSettings(
|
||||
core.SetAppCredentials(cfg.Config.LarkAppID, cfg.Config.LarkAppSecret))
|
||||
lark.conf = core.NewConfig(core.DomainFeiShu, appSettings, core.SetLoggerLevel(core.LoggerLevelError))
|
||||
lark.userService = authen.NewService(lark.conf)
|
||||
lark.imService = im.NewService(lark.conf)
|
||||
}
|
||||
}
|
||||
|
||||
func (l Lark) Auth(code string) (*authen.UserAccessTokenInfo, error) {
|
||||
s := authen.NewService(l.conf)
|
||||
return s.Authens.AccessToken(core.WrapContext(context.Background()), &authen.AuthenAccessTokenReqBody{
|
||||
GrantType: "",
|
||||
Code: code,
|
||||
}).Do()
|
||||
return lark
|
||||
}
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
package lark
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/larksuite/oapi-sdk-go/core"
|
||||
authen "github.com/larksuite/oapi-sdk-go/service/authen/v1"
|
||||
)
|
||||
|
||||
func (l Lark) Auth(code string) (*authen.UserAccessTokenInfo, error) {
|
||||
return l.userService.Authens.AccessToken(core.WrapContext(context.Background()), &authen.AuthenAccessTokenReqBody{
|
||||
GrantType: "",
|
||||
Code: code,
|
||||
}).Do()
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"git.icechen.cn/monorepo/backend/pkg/orm"
|
||||
)
|
||||
|
||||
func init() {
|
||||
err := orm.DB.AutoMigrate(&UserInfo{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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
|
||||
}
|
|
@ -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)
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
var db *gorm.DB
|
||||
|
||||
func init() {
|
||||
err := db.AutoMigrate(&UserInfo{})
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
}
|
42
go.mod
42
go.mod
|
@ -5,53 +5,51 @@ go 1.17
|
|||
require (
|
||||
github.com/gofiber/fiber/v2 v2.24.0
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/google/uuid v1.1.2
|
||||
github.com/jinzhu/copier v0.3.4
|
||||
github.com/larksuite/oapi-sdk-go v1.1.43
|
||||
github.com/luizsuper/ctxLoggers v1.0.3
|
||||
github.com/pkg/errors v0.9.1
|
||||
github.com/spf13/cast v1.4.1
|
||||
go.etcd.io/etcd/client/v3 v3.5.1
|
||||
go.uber.org/zap v1.19.1
|
||||
go.uber.org/zap v1.20.0
|
||||
google.golang.org/grpc v1.43.0
|
||||
gorm.io/driver/mysql v1.2.3
|
||||
gorm.io/gorm v1.22.4
|
||||
)
|
||||
|
||||
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.13.0 // indirect
|
||||
github.com/go-playground/universal-translator v0.17.0 // indirect
|
||||
github.com/go-playground/validator/v10 v10.4.1 // 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/json-iterator/go v1.1.11 // indirect
|
||||
github.com/klauspost/compress v1.13.4 // indirect
|
||||
github.com/leodido/go-urn v1.2.0 // 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/mattn/go-isatty v0.0.12 // 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.1 // indirect
|
||||
github.com/ugorji/go/codec v1.1.7 // 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
|
||||
golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // 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
|
||||
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
|
||||
gopkg.in/yaml.v2 v2.3.0 // indirect
|
||||
google.golang.org/protobuf v1.27.1 // indirect
|
||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
||||
)
|
||||
|
|
89
go.sum
89
go.sum
|
@ -6,8 +6,9 @@ github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuy
|
|||
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
|
||||
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 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8=
|
||||
github.com/benbjohnson/clock v1.1.0/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA=
|
||||
|
@ -27,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=
|
||||
|
@ -55,13 +57,16 @@ 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 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
||||
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 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
|
||||
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=
|
||||
|
@ -101,7 +106,6 @@ github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
|||
github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/google/uuid v1.1.2 h1:EVhdT+1Kseyi1/pUmXKaFxYsDNy9RQYkMWRH68J/W7Y=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
|
||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||
|
@ -118,26 +122,32 @@ github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX
|
|||
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
|
||||
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 h1:uVUAXhF2To8cbw/3xN3pxj6kk7TYKs98NIrTqPlMWAQ=
|
||||
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 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
|
||||
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 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
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 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
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 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
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 h1:RKf14vYWi2ttpEmkA4aQ3j4u9dStX2t4M8UM6qqNsG8=
|
||||
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=
|
||||
|
@ -146,15 +156,17 @@ github.com/lestrrat-go/strftime v1.0.5 h1:A7H3tT8DhTz8u65w+JRpiBxM4dINQhUXAZnhBa
|
|||
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 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
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 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI=
|
||||
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=
|
||||
|
@ -164,6 +176,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=
|
||||
|
@ -186,12 +199,13 @@ 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 h1:FCbCCtXNOY3UtUuHUYaghJg4y7Fd14rXifAYUAtL9R8=
|
||||
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=
|
||||
github.com/sirupsen/logrus v1.7.0/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0=
|
||||
github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA=
|
||||
github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
|
@ -201,14 +215,17 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
|||
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
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 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
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=
|
||||
|
@ -222,21 +239,27 @@ go.etcd.io/etcd/client/v3 v3.5.1 h1:oImGuV5LGKjCqXdjkMHCyWa5OO1gYKCnC/1sgdfj1Uk=
|
|||
go.etcd.io/etcd/client/v3 v3.5.1/go.mod h1:OnjH4M8OnAotwaB2l9bVgZzRFKru7/ZMoS46OtKyd3Q=
|
||||
go.opentelemetry.io/otel v0.11.0/go.mod h1:G8UCk+KooF2HLkgo8RHX9epABH/aRGYET7gQOqBVdB0=
|
||||
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/goleak v1.1.11-0.20210813005559-691160354723 h1:sHOAIxRGBp443oHZIPB+HsUGaksVCXVQENPxwTfQdH4=
|
||||
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-0.20210813005559-691160354723/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
|
||||
go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4=
|
||||
go.uber.org/goleak v1.1.11 h1:wy28qYRKZgnJTxGxvye5/wgWr1EKjmUDGYox5mGlRlI=
|
||||
go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ=
|
||||
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/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo=
|
||||
go.uber.org/zap v1.19.1 h1:ue41HOKd1vGURxrmeKIgELGb3jPW9DMUDGtsinblHwI=
|
||||
go.uber.org/zap v1.19.1/go.mod h1:j3DNczoxDZroyBnOT1L/Q79cfUMGZxlv/9dzN7SM1rI=
|
||||
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 h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc=
|
||||
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=
|
||||
|
@ -264,8 +287,9 @@ golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81R
|
|||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
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=
|
||||
|
@ -302,15 +326,20 @@ golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
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=
|
||||
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=
|
||||
|
@ -354,13 +383,16 @@ google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2
|
|||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
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 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
|
||||
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
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=
|
||||
|
@ -369,8 +401,9 @@ gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
|||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
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=
|
||||
|
|
|
@ -10,9 +10,9 @@ import (
|
|||
"time"
|
||||
)
|
||||
|
||||
const (
|
||||
var (
|
||||
EndPoints = "ENDPOINTS"
|
||||
EndAddress = "etcd:2379"
|
||||
EndAddress = "etcd." + env.Namespace + ":2379"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -40,7 +40,7 @@ func GetValue(key string) (string, error) {
|
|||
}
|
||||
kv := clientV3.NewKV(client)
|
||||
defer client.Close()
|
||||
ctx, cancel := context.WithTimeout(context.TODO(), time.Minute*3)
|
||||
ctx, cancel := context.WithTimeout(context.TODO(), time.Second*3)
|
||||
defer cancel()
|
||||
if getResp, err := kv.Get(ctx, key, clientV3.WithPrefix()); err == nil {
|
||||
if len(getResp.Kvs) > 0 {
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue