From 121988bfe19725bcb54807a884d493f5dac8a840 Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Sun, 24 Apr 2022 23:45:03 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E7=94=A8=E6=88=B7=EF=BC=8C=E6=96=B0=E5=A2=9E=E7=A4=BC=E7=89=A9?= =?UTF-8?q?=E6=94=B6=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/gift/genModel.bat | 20 + app/gift/generate.go | 12 + app/gift/model/gift_model.go | 44 + app/gift/model/gift_model_gen.go | 87 + app/gift/model/vars.go | 5 + app/gift/rpc/etc/gift.yaml | 13 + app/gift/rpc/gift.go | 45 + app/gift/rpc/gift/gift.go | 39 + app/gift/rpc/internal/config/config.go | 22 + .../rpc/internal/logic/collect_gift_logic.go | 51 + app/gift/rpc/internal/server/gift_server.go | 29 + app/gift/rpc/internal/svc/service_context.go | 21 + app/gift/rpc/msg_transfer/gift/msg_to_db.go | 81 + app/gift/rpc/msg_transfer/init.go | 20 + app/gift/rpc/pb/generate.go | 3 + app/gift/rpc/pb/gift.pb.go | 228 ++ app/gift/rpc/pb/gift.proto | 21 + app/gift/rpc/pb/gift_grpc.pb.go | 107 + app/pb/mq/gen.bat | 1 + app/pb/mq/mq.pb.go | 377 +++ app/pb/mq/mq.proto | 32 + app/user_center/genModel.bat | 13 +- app/user_center/generate.go | 2 +- app/user_center/model/user_platform_model.go | 22 +- .../model/user_platform_model_gen.go | 24 +- app/user_center/rpc/etc/user_center.yaml | 17 + app/user_center/rpc/internal/config/config.go | 29 + .../platform_user/platform_user_retrieve.go | 36 + .../logic/platform_user/retrieve_bilibili.go | 46 + .../logic/retrieve_platform_user_logic.go | 112 + .../rpc/internal/server/user_center_server.go | 29 + .../rpc/internal/svc/service_context.go | 22 + .../rpc/msg_transfer/danmaku/cmd_manager.go | 35 + .../rpc/msg_transfer/danmaku/cmd_parser.go | 67 + .../rpc/msg_transfer/danmaku/msg_to_db.go | 99 + app/user_center/rpc/msg_transfer/init.go | 20 + app/user_center/rpc/pb/generate.go | 2 +- app/user_center/rpc/pb/user_center.pb.go | 2572 +---------------- app/user_center/rpc/pb/user_center.proto | 219 +- app/user_center/rpc/pb/user_center_grpc.pb.go | 508 +--- app/user_center/rpc/user_center.go | 46 + app/user_center/rpc/usercenter/user_center.go | 40 + common/kafka/codec.go | 29 + go.mod | 68 +- go.sum | 104 +- 45 files changed, 2249 insertions(+), 3170 deletions(-) create mode 100644 app/gift/genModel.bat create mode 100644 app/gift/generate.go create mode 100644 app/gift/model/gift_model.go create mode 100644 app/gift/model/gift_model_gen.go create mode 100644 app/gift/model/vars.go create mode 100644 app/gift/rpc/etc/gift.yaml create mode 100644 app/gift/rpc/gift.go create mode 100644 app/gift/rpc/gift/gift.go create mode 100644 app/gift/rpc/internal/config/config.go create mode 100644 app/gift/rpc/internal/logic/collect_gift_logic.go create mode 100644 app/gift/rpc/internal/server/gift_server.go create mode 100644 app/gift/rpc/internal/svc/service_context.go create mode 100644 app/gift/rpc/msg_transfer/gift/msg_to_db.go create mode 100644 app/gift/rpc/msg_transfer/init.go create mode 100644 app/gift/rpc/pb/generate.go create mode 100644 app/gift/rpc/pb/gift.pb.go create mode 100644 app/gift/rpc/pb/gift.proto create mode 100644 app/gift/rpc/pb/gift_grpc.pb.go create mode 100644 app/pb/mq/gen.bat create mode 100644 app/pb/mq/mq.pb.go create mode 100644 app/pb/mq/mq.proto create mode 100644 app/user_center/rpc/etc/user_center.yaml create mode 100644 app/user_center/rpc/internal/config/config.go create mode 100644 app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go create mode 100644 app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go create mode 100644 app/user_center/rpc/internal/logic/retrieve_platform_user_logic.go create mode 100644 app/user_center/rpc/internal/server/user_center_server.go create mode 100644 app/user_center/rpc/internal/svc/service_context.go create mode 100644 app/user_center/rpc/msg_transfer/danmaku/cmd_manager.go create mode 100644 app/user_center/rpc/msg_transfer/danmaku/cmd_parser.go create mode 100644 app/user_center/rpc/msg_transfer/danmaku/msg_to_db.go create mode 100644 app/user_center/rpc/msg_transfer/init.go create mode 100644 app/user_center/rpc/user_center.go create mode 100644 app/user_center/rpc/usercenter/user_center.go create mode 100644 common/kafka/codec.go diff --git a/app/gift/genModel.bat b/app/gift/genModel.bat new file mode 100644 index 0000000..8d22f6c --- /dev/null +++ b/app/gift/genModel.bat @@ -0,0 +1,20 @@ +@echo off +@echo ?????????????? + +set tables=gift +set targetDir=.\model +set templateDir=..\..\doc\template + +::set host=127.0.0.1 +::set port=23306 +set host=192.168.1.100 +set port=3306 +::set dbname=dcg +set dbname=dmgame +set username=root +set password=root + +for %%i in (%tables%) do ( + echo ????????? %dbname% ??? %%i + goctl model mysql datasource --url "%username%:%password%@tcp(%host%:%port%)/%dbname%" -t %%i -d %targetDir% --style go_zero --home %templateDir% +) \ No newline at end of file diff --git a/app/gift/generate.go b/app/gift/generate.go new file mode 100644 index 0000000..e11656f --- /dev/null +++ b/app/gift/generate.go @@ -0,0 +1,12 @@ +package user_center + +// protoc 生成 +//go:generate goctl rpc protoc ./rpc/pb/gift.proto --style=go_zero --go_out=./rpc --go-grpc_out=./rpc --zrpc_out=./rpc + +// api 生成 +//go:generate goctl api go -api ./api/doc/user_center.api -dir ./api --style go_zero + +// api swagger 文档生成 需要sh +//go:generate goctl api plugin -plugin goctl-swagger="swagger -filename user_center.json -host 127.0.0.1" -api ./api/doc/user_center.api -dir ./api/doc + +// model 生成 配合genModel.sh (可能需要复制到terminal执行) diff --git a/app/gift/model/gift_model.go b/app/gift/model/gift_model.go new file mode 100644 index 0000000..19d74b8 --- /dev/null +++ b/app/gift/model/gift_model.go @@ -0,0 +1,44 @@ +package model + +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ GiftModel = (*customGiftModel)(nil) + +type ( + // GiftModel is an interface to be customized, add more methods here, + // and implement the added methods in customGiftModel. + GiftModel interface { + giftModel + FindOneByGiftId(ctx context.Context, giftId string) (*Gift, error) + } + + customGiftModel struct { + *defaultGiftModel + } +) + +// NewGiftModel returns a model for the database table. +func NewGiftModel(conn sqlx.SqlConn) GiftModel { + return &customGiftModel{ + defaultGiftModel: newGiftModel(conn), + } +} + +func (m *customGiftModel) FindOneByGiftId(ctx context.Context, giftId string) (*Gift, error) { + query := fmt.Sprintf("select %s from %s where `gift_id` = ? limit 1", giftRows, m.table) + var resp Gift + err := m.conn.QueryRowCtx(ctx, &resp, query, giftId) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} diff --git a/app/gift/model/gift_model_gen.go b/app/gift/model/gift_model_gen.go new file mode 100644 index 0000000..4d8f6c2 --- /dev/null +++ b/app/gift/model/gift_model_gen.go @@ -0,0 +1,87 @@ +// Code generated by goctl. DO NOT EDIT! + +package model + +import ( + "context" + "database/sql" + "fmt" + "strings" + + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) + +var ( + giftFieldNames = builder.RawFieldNames(&Gift{}) + giftRows = strings.Join(giftFieldNames, ",") + giftRowsExpectAutoSet = strings.Join(stringx.Remove(giftFieldNames, "`create_time`", "`update_time`"), ",") + giftRowsWithPlaceHolder = strings.Join(stringx.Remove(giftFieldNames, "`id`", "`create_time`", "`update_time`"), "=?,") + "=?" +) + +type ( + giftModel interface { + Insert(ctx context.Context, data *Gift) (sql.Result, error) + FindOne(ctx context.Context, id int64) (*Gift, error) + Update(ctx context.Context, data *Gift) error + Delete(ctx context.Context, id int64) error + } + + defaultGiftModel struct { + conn sqlx.SqlConn + table string + } + + Gift struct { + Id int64 `db:"id"` // 主键 + GiftId string `db:"gift_id"` // 礼物ID,不同平台可能类型都不同,用varchar + GiftName string `db:"gift_name"` // 礼物名 + Platform string `db:"platform"` // 平台 + PPrice int64 `db:"p_price"` // 平台价值货币总数B站: 瓜子虎牙: xxx + } +) + +func newGiftModel(conn sqlx.SqlConn) *defaultGiftModel { + return &defaultGiftModel{ + conn: conn, + table: "`gift`", + } +} + +func (m *defaultGiftModel) Insert(ctx context.Context, data *Gift) (sql.Result, error) { + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, giftRowsExpectAutoSet) + ret, err := m.conn.ExecCtx(ctx, query, data.Id, data.GiftId, data.GiftName, data.Platform, data.PPrice) + return ret, err +} + +func (m *defaultGiftModel) FindOne(ctx context.Context, id int64) (*Gift, error) { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", giftRows, m.table) + var resp Gift + err := m.conn.QueryRowCtx(ctx, &resp, query, id) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultGiftModel) Update(ctx context.Context, data *Gift) error { + query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, giftRowsWithPlaceHolder) + _, err := m.conn.ExecCtx(ctx, query, data.GiftId, data.GiftName, data.Platform, data.PPrice, data.Id) + return err +} + +func (m *defaultGiftModel) Delete(ctx context.Context, id int64) error { + query := fmt.Sprintf("delete from %s where `id` = ?", m.table) + _, err := m.conn.ExecCtx(ctx, query, id) + return err +} + +func (m *defaultGiftModel) tableName() string { + return m.table +} diff --git a/app/gift/model/vars.go b/app/gift/model/vars.go new file mode 100644 index 0000000..69ca814 --- /dev/null +++ b/app/gift/model/vars.go @@ -0,0 +1,5 @@ +package model + +import "github.com/zeromicro/go-zero/core/stores/sqlx" + +var ErrNotFound = sqlx.ErrNotFound diff --git a/app/gift/rpc/etc/gift.yaml b/app/gift/rpc/etc/gift.yaml new file mode 100644 index 0000000..513e567 --- /dev/null +++ b/app/gift/rpc/etc/gift.yaml @@ -0,0 +1,13 @@ +Name: gift.rpc +ListenOn: 127.0.0.1:10000 +DB: + DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true +Etcd: + Hosts: + - 127.0.0.1:2379 + Key: gift.rpc +Gift: + Kafka: + Addr: [ "127.0.0.1:9093" ] + Topic: "gift" + ConsumerGroupId: "msgToDb" \ No newline at end of file diff --git a/app/gift/rpc/gift.go b/app/gift/rpc/gift.go new file mode 100644 index 0000000..21521a3 --- /dev/null +++ b/app/gift/rpc/gift.go @@ -0,0 +1,45 @@ +package main + +import ( + "context" + "flag" + "fmt" + "live-service/app/gift/rpc/msg_transfer" + + "live-service/app/gift/rpc/internal/config" + "live-service/app/gift/rpc/internal/server" + "live-service/app/gift/rpc/internal/svc" + "live-service/app/gift/rpc/pb" + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/core/service" + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" +) + +var configFile = flag.String("f", "etc/gift.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + ctx := svc.NewServiceContext(c) + svr := server.NewGiftServer(ctx) + + msg_transfer.Init(context.Background(), ctx, svr) + msg_transfer.Run() + + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + pb.RegisterGiftServer(grpcServer, svr) + + if c.Mode == service.DevMode || c.Mode == service.TestMode { + reflection.Register(grpcServer) + } + }) + defer s.Stop() + + fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) + s.Start() +} diff --git a/app/gift/rpc/gift/gift.go b/app/gift/rpc/gift/gift.go new file mode 100644 index 0000000..4e080bc --- /dev/null +++ b/app/gift/rpc/gift/gift.go @@ -0,0 +1,39 @@ +// Code generated by goctl. DO NOT EDIT! +// Source: gift.proto + +package gift + +import ( + "context" + + "live-service/app/gift/rpc/pb" + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + CollectGift = pb.CollectGift + Empty = pb.Empty + + Gift interface { + // collectGift 收集礼物,仅作为收集使用 + CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error) + } + + defaultGift struct { + cli zrpc.Client + } +) + +func NewGift(cli zrpc.Client) Gift { + return &defaultGift{ + cli: cli, + } +} + +// collectGift 收集礼物,仅作为收集使用 +func (m *defaultGift) CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error) { + client := pb.NewGiftClient(m.cli.Conn()) + return client.CollectGift(ctx, in, opts...) +} diff --git a/app/gift/rpc/internal/config/config.go b/app/gift/rpc/internal/config/config.go new file mode 100644 index 0000000..bc9ae92 --- /dev/null +++ b/app/gift/rpc/internal/config/config.go @@ -0,0 +1,22 @@ +package config + +import "github.com/zeromicro/go-zero/zrpc" + +type ( + Kafka struct { + Addr []string + Topic string + ConsumerGroupId string + } + Config struct { + zrpc.RpcServerConf + + DB struct { + DataSource string + } + + Gift struct { + Kafka Kafka + } + } +) diff --git a/app/gift/rpc/internal/logic/collect_gift_logic.go b/app/gift/rpc/internal/logic/collect_gift_logic.go new file mode 100644 index 0000000..352fde7 --- /dev/null +++ b/app/gift/rpc/internal/logic/collect_gift_logic.go @@ -0,0 +1,51 @@ +package logic + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/pkg/errors" + "live-service/app/gift/model" + + "live-service/app/gift/rpc/internal/svc" + "live-service/app/gift/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type CollectGiftLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewCollectGiftLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CollectGiftLogic { + return &CollectGiftLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// CollectGift 收集礼物,仅作为收集使用 +func (l *CollectGiftLogic) CollectGift(in *pb.CollectGift) (*pb.Empty, error) { + dbGift, err := l.svcCtx.GiftModel.FindOneByGiftId(l.ctx, string(in.GiftId)) + if err == nil { + return &pb.Empty{}, nil + } + if err != nil { + if !errors.Is(err, model.ErrNotFound) { + return nil, errors.Wrap(err, "数据库错误") + } + } + dbGift = &model.Gift{ + Id: uuid.NextId(), + GiftId: string(in.GiftId), + GiftName: in.GiftName, + Platform: in.Platform, + PPrice: in.TotalCoin, + } + if _, err := l.svcCtx.GiftModel.Insert(l.ctx, dbGift); err != nil { + return nil, errors.Wrap(err, "数据库插入错误") + } + return &pb.Empty{}, nil +} diff --git a/app/gift/rpc/internal/server/gift_server.go b/app/gift/rpc/internal/server/gift_server.go new file mode 100644 index 0000000..bc7a0e5 --- /dev/null +++ b/app/gift/rpc/internal/server/gift_server.go @@ -0,0 +1,29 @@ +// Code generated by goctl. DO NOT EDIT! +// Source: gift.proto + +package server + +import ( + "context" + + "live-service/app/gift/rpc/internal/logic" + "live-service/app/gift/rpc/internal/svc" + "live-service/app/gift/rpc/pb" +) + +type GiftServer struct { + svcCtx *svc.ServiceContext + pb.UnimplementedGiftServer +} + +func NewGiftServer(svcCtx *svc.ServiceContext) *GiftServer { + return &GiftServer{ + svcCtx: svcCtx, + } +} + +// collectGift 收集礼物,仅作为收集使用 +func (s *GiftServer) CollectGift(ctx context.Context, in *pb.CollectGift) (*pb.Empty, error) { + l := logic.NewCollectGiftLogic(ctx, s.svcCtx) + return l.CollectGift(in) +} diff --git a/app/gift/rpc/internal/svc/service_context.go b/app/gift/rpc/internal/svc/service_context.go new file mode 100644 index 0000000..8e3a5b1 --- /dev/null +++ b/app/gift/rpc/internal/svc/service_context.go @@ -0,0 +1,21 @@ +package svc + +import ( + "github.com/zeromicro/go-zero/core/stores/sqlx" + "live-service/app/gift/model" + "live-service/app/gift/rpc/internal/config" +) + +type ServiceContext struct { + Config config.Config + + GiftModel model.GiftModel +} + +func NewServiceContext(c config.Config) *ServiceContext { + return &ServiceContext{ + Config: c, + // model + GiftModel: model.NewGiftModel(sqlx.NewMysql(c.DB.DataSource)), + } +} diff --git a/app/gift/rpc/msg_transfer/gift/msg_to_db.go b/app/gift/rpc/msg_transfer/gift/msg_to_db.go new file mode 100644 index 0000000..14d2b56 --- /dev/null +++ b/app/gift/rpc/msg_transfer/gift/msg_to_db.go @@ -0,0 +1,81 @@ +package gift + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/kafka" + "github.com/Shopify/sarama" + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/protobuf/proto" + "live-service/app/gift/rpc/internal/server" + "live-service/app/gift/rpc/internal/svc" + "live-service/app/gift/rpc/pb" + pbMq "live-service/app/pb/mq" + kfk "live-service/common/kafka" +) + +type msgHandlerFunc func(data []byte, msgKey string) + +type MsgToDBHandler struct { + context context.Context + ctx *svc.ServiceContext + svr *server.GiftServer + + msgHandle map[string]msgHandlerFunc + + ConsumerGroup *kafka.ConsumerGroup + + logx.Logger +} + +func (h *MsgToDBHandler) Init(context context.Context, ctx *svc.ServiceContext, svr *server.GiftServer) { + h.context = context + h.ctx = ctx + h.svr = svr + h.Logger = logx.WithContext(h.context) + + cfg := ctx.Config.Gift.Kafka + h.msgHandle = make(map[string]msgHandlerFunc) + h.msgHandle["gift"] = h.handleGift + + var err error + h.ConsumerGroup, err = kafka.NewConsumerGroup(&kafka.ConsumerGroupConfig{ + KafkaVersion: sarama.V3_1_0_0, + OffsetsInitial: sarama.OffsetNewest, + IsReturnErr: false, + UnMarshaler: kfk.ProtobufMarshaler, + }, cfg.Addr, []string{cfg.Topic}, cfg.ConsumerGroupId) + + if err != nil { + h.Logger.Error(err) + } +} + +func (h *MsgToDBHandler) handleGift(data []byte, msgKey string) { + // msg proto + var msgFromMq pbMq.MqGift + if err := proto.Unmarshal(data, &msgFromMq); err != nil { + h.Logger.Error("unmarshal msg err", err) + return + } + if _, err := h.svr.CollectGift(context.Background(), &pb.CollectGift{ + Platform: msgFromMq.Platform, + GiftId: msgFromMq.GiftId, + GiftName: msgFromMq.GiftName, + TotalCoin: msgFromMq.TotalCoin, + }); err != nil { + h.Logger.Error("收集礼物错误 ", err) + return + } +} + +func (MsgToDBHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (MsgToDBHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (h *MsgToDBHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + if hFunc, ok := h.msgHandle[msg.Topic]; ok { + hFunc(msg.Value, string(msg.Key)) + } + sess.MarkMessage(msg, "") + } + return nil +} diff --git a/app/gift/rpc/msg_transfer/init.go b/app/gift/rpc/msg_transfer/init.go new file mode 100644 index 0000000..1a79075 --- /dev/null +++ b/app/gift/rpc/msg_transfer/init.go @@ -0,0 +1,20 @@ +package msg_transfer + +import ( + "context" + "live-service/app/gift/rpc/internal/server" + "live-service/app/gift/rpc/internal/svc" + "live-service/app/gift/rpc/msg_transfer/gift" +) + +var ( + giftMsgToDb gift.MsgToDBHandler +) + +func Init(context context.Context, ctx *svc.ServiceContext, svr *server.GiftServer) { + giftMsgToDb.Init(context, ctx, svr) +} + +func Run() { + go giftMsgToDb.ConsumerGroup.RegisterHandlerAndConsumer(&giftMsgToDb) +} diff --git a/app/gift/rpc/pb/generate.go b/app/gift/rpc/pb/generate.go new file mode 100644 index 0000000..dbb41e0 --- /dev/null +++ b/app/gift/rpc/pb/generate.go @@ -0,0 +1,3 @@ +package pb + +//go:generate goctl rpc protoc gift.proto --style=go_zero --go_out=../ --go-grpc_out=../ --zrpc_out=../ diff --git a/app/gift/rpc/pb/gift.pb.go b/app/gift/rpc/pb/gift.pb.go new file mode 100644 index 0000000..4a0e0bc --- /dev/null +++ b/app/gift/rpc/pb/gift.pb.go @@ -0,0 +1,228 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.19.4 +// source: gift.proto + +package pb + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +// req +type CollectGift struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + GiftId int32 `protobuf:"varint,2,opt,name=giftId,proto3" json:"giftId,omitempty"` + GiftName string `protobuf:"bytes,3,opt,name=giftName,proto3" json:"giftName,omitempty"` + TotalCoin int64 `protobuf:"varint,4,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` +} + +func (x *CollectGift) Reset() { + *x = CollectGift{} + if protoimpl.UnsafeEnabled { + mi := &file_gift_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CollectGift) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CollectGift) ProtoMessage() {} + +func (x *CollectGift) ProtoReflect() protoreflect.Message { + mi := &file_gift_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use CollectGift.ProtoReflect.Descriptor instead. +func (*CollectGift) Descriptor() ([]byte, []int) { + return file_gift_proto_rawDescGZIP(), []int{0} +} + +func (x *CollectGift) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *CollectGift) GetGiftId() int32 { + if x != nil { + return x.GiftId + } + return 0 +} + +func (x *CollectGift) GetGiftName() string { + if x != nil { + return x.GiftName + } + return "" +} + +func (x *CollectGift) GetTotalCoin() int64 { + if x != nil { + return x.TotalCoin + } + return 0 +} + +type Empty struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *Empty) Reset() { + *x = Empty{} + if protoimpl.UnsafeEnabled { + mi := &file_gift_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Empty) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Empty) ProtoMessage() {} + +func (x *Empty) ProtoReflect() protoreflect.Message { + mi := &file_gift_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use Empty.ProtoReflect.Descriptor instead. +func (*Empty) Descriptor() ([]byte, []int) { + return file_gift_proto_rawDescGZIP(), []int{1} +} + +var File_gift_proto protoreflect.FileDescriptor + +var file_gift_proto_rawDesc = []byte{ + 0x0a, 0x0a, 0x67, 0x69, 0x66, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, + 0x22, 0x7b, 0x0a, 0x0b, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x47, 0x69, 0x66, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x67, + 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x69, 0x66, + 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x09, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x22, 0x07, 0x0a, + 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x32, 0x31, 0x0a, 0x04, 0x67, 0x69, 0x66, 0x74, 0x12, 0x29, + 0x0a, 0x0b, 0x63, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x47, 0x69, 0x66, 0x74, 0x12, 0x0f, 0x2e, + 0x70, 0x62, 0x2e, 0x43, 0x6f, 0x6c, 0x6c, 0x65, 0x63, 0x74, 0x47, 0x69, 0x66, 0x74, 0x1a, 0x09, + 0x2e, 0x70, 0x62, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_gift_proto_rawDescOnce sync.Once + file_gift_proto_rawDescData = file_gift_proto_rawDesc +) + +func file_gift_proto_rawDescGZIP() []byte { + file_gift_proto_rawDescOnce.Do(func() { + file_gift_proto_rawDescData = protoimpl.X.CompressGZIP(file_gift_proto_rawDescData) + }) + return file_gift_proto_rawDescData +} + +var file_gift_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_gift_proto_goTypes = []interface{}{ + (*CollectGift)(nil), // 0: pb.CollectGift + (*Empty)(nil), // 1: pb.Empty +} +var file_gift_proto_depIdxs = []int32{ + 0, // 0: pb.gift.collectGift:input_type -> pb.CollectGift + 1, // 1: pb.gift.collectGift:output_type -> pb.Empty + 1, // [1:2] is the sub-list for method output_type + 0, // [0:1] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_gift_proto_init() } +func file_gift_proto_init() { + if File_gift_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_gift_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CollectGift); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_gift_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Empty); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_gift_proto_rawDesc, + NumEnums: 0, + NumMessages: 2, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_gift_proto_goTypes, + DependencyIndexes: file_gift_proto_depIdxs, + MessageInfos: file_gift_proto_msgTypes, + }.Build() + File_gift_proto = out.File + file_gift_proto_rawDesc = nil + file_gift_proto_goTypes = nil + file_gift_proto_depIdxs = nil +} diff --git a/app/gift/rpc/pb/gift.proto b/app/gift/rpc/pb/gift.proto new file mode 100644 index 0000000..e5dd2e4 --- /dev/null +++ b/app/gift/rpc/pb/gift.proto @@ -0,0 +1,21 @@ +syntax = "proto3"; + +package pb; + +option go_package = "./pb"; + +// req +message CollectGift { + string platform = 1; + int32 giftId = 2; + string giftName = 3; + int64 totalCoin = 4; +} + +message Empty {} + + +service gift { + // collectGift 收集礼物,仅作为收集使用 + rpc collectGift(CollectGift) returns (Empty); +} \ No newline at end of file diff --git a/app/gift/rpc/pb/gift_grpc.pb.go b/app/gift/rpc/pb/gift_grpc.pb.go new file mode 100644 index 0000000..9d343c8 --- /dev/null +++ b/app/gift/rpc/pb/gift_grpc.pb.go @@ -0,0 +1,107 @@ +// Code generated by protoc-gen-go-grpc. DO NOT EDIT. +// versions: +// - protoc-gen-go-grpc v1.2.0 +// - protoc v3.19.4 +// source: gift.proto + +package pb + +import ( + context "context" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" +) + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +// Requires gRPC-Go v1.32.0 or later. +const _ = grpc.SupportPackageIsVersion7 + +// GiftClient is the client API for Gift service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. +type GiftClient interface { + // collectGift 收集礼物,仅作为收集使用 + CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error) +} + +type giftClient struct { + cc grpc.ClientConnInterface +} + +func NewGiftClient(cc grpc.ClientConnInterface) GiftClient { + return &giftClient{cc} +} + +func (c *giftClient) CollectGift(ctx context.Context, in *CollectGift, opts ...grpc.CallOption) (*Empty, error) { + out := new(Empty) + err := c.cc.Invoke(ctx, "/pb.gift/collectGift", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// GiftServer is the server API for Gift service. +// All implementations must embed UnimplementedGiftServer +// for forward compatibility +type GiftServer interface { + // collectGift 收集礼物,仅作为收集使用 + CollectGift(context.Context, *CollectGift) (*Empty, error) + mustEmbedUnimplementedGiftServer() +} + +// UnimplementedGiftServer must be embedded to have forward compatible implementations. +type UnimplementedGiftServer struct { +} + +func (UnimplementedGiftServer) CollectGift(context.Context, *CollectGift) (*Empty, error) { + return nil, status.Errorf(codes.Unimplemented, "method CollectGift not implemented") +} +func (UnimplementedGiftServer) mustEmbedUnimplementedGiftServer() {} + +// UnsafeGiftServer may be embedded to opt out of forward compatibility for this service. +// Use of this interface is not recommended, as added methods to GiftServer will +// result in compilation errors. +type UnsafeGiftServer interface { + mustEmbedUnimplementedGiftServer() +} + +func RegisterGiftServer(s grpc.ServiceRegistrar, srv GiftServer) { + s.RegisterService(&Gift_ServiceDesc, srv) +} + +func _Gift_CollectGift_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CollectGift) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(GiftServer).CollectGift(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/pb.gift/collectGift", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(GiftServer).CollectGift(ctx, req.(*CollectGift)) + } + return interceptor(ctx, in, info, handler) +} + +// Gift_ServiceDesc is the grpc.ServiceDesc for Gift service. +// It's only intended for direct use with grpc.RegisterService, +// and not to be introspected or modified (even as a copy) +var Gift_ServiceDesc = grpc.ServiceDesc{ + ServiceName: "pb.gift", + HandlerType: (*GiftServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "collectGift", + Handler: _Gift_CollectGift_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "gift.proto", +} diff --git a/app/pb/mq/gen.bat b/app/pb/mq/gen.bat new file mode 100644 index 0000000..944bcfd --- /dev/null +++ b/app/pb/mq/gen.bat @@ -0,0 +1 @@ +protoc --go_opt=paths=source_relative --go-grpc_opt=paths=source_relative --go-grpc_opt=require_unimplemented_servers=false --go_out=. --go-grpc_out=. --proto_path=. mq.proto \ No newline at end of file diff --git a/app/pb/mq/mq.pb.go b/app/pb/mq/mq.pb.go new file mode 100644 index 0000000..b515cf0 --- /dev/null +++ b/app/pb/mq/mq.pb.go @@ -0,0 +1,377 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.0 +// protoc v3.19.4 +// source: mq.proto + +package pbMq + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +const ( + // Verify that this generated code is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) + // Verify that runtime/protoimpl is sufficiently up-to-date. + _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) +) + +type Platform int32 + +const ( + Platform_bilibili Platform = 0 // B站 + Platform_huya Platform = 1 // 虎牙 + Platform_douyu Platform = 2 // 斗鱼 + Platform_douyin Platform = 3 // 抖音 +) + +// Enum value maps for Platform. +var ( + Platform_name = map[int32]string{ + 0: "bilibili", + 1: "huya", + 2: "douyu", + 3: "douyin", + } + Platform_value = map[string]int32{ + "bilibili": 0, + "huya": 1, + "douyu": 2, + "douyin": 3, + } +) + +func (x Platform) Enum() *Platform { + p := new(Platform) + *p = x + return p +} + +func (x Platform) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Platform) Descriptor() protoreflect.EnumDescriptor { + return file_mq_proto_enumTypes[0].Descriptor() +} + +func (Platform) Type() protoreflect.EnumType { + return &file_mq_proto_enumTypes[0] +} + +func (x Platform) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Platform.Descriptor instead. +func (Platform) EnumDescriptor() ([]byte, []int) { + return file_mq_proto_rawDescGZIP(), []int{0} +} + +type MqDanmaku struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` + Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` + Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` + Content string `protobuf:"bytes,5,opt,name=content,proto3" json:"content,omitempty"` + SendTime int64 `protobuf:"varint,6,opt,name=sendTime,proto3" json:"sendTime,omitempty"` +} + +func (x *MqDanmaku) Reset() { + *x = MqDanmaku{} + if protoimpl.UnsafeEnabled { + mi := &file_mq_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MqDanmaku) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MqDanmaku) ProtoMessage() {} + +func (x *MqDanmaku) ProtoReflect() protoreflect.Message { + mi := &file_mq_proto_msgTypes[0] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MqDanmaku.ProtoReflect.Descriptor instead. +func (*MqDanmaku) Descriptor() ([]byte, []int) { + return file_mq_proto_rawDescGZIP(), []int{0} +} + +func (x *MqDanmaku) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *MqDanmaku) GetLiveRoomId() int64 { + if x != nil { + return x.LiveRoomId + } + return 0 +} + +func (x *MqDanmaku) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *MqDanmaku) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *MqDanmaku) GetContent() string { + if x != nil { + return x.Content + } + return "" +} + +func (x *MqDanmaku) GetSendTime() int64 { + if x != nil { + return x.SendTime + } + return 0 +} + +type MqGift struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + LiveRoomId int64 `protobuf:"varint,2,opt,name=liveRoomId,proto3" json:"liveRoomId,omitempty"` + Uid int64 `protobuf:"varint,3,opt,name=uid,proto3" json:"uid,omitempty"` + Uname string `protobuf:"bytes,4,opt,name=uname,proto3" json:"uname,omitempty"` + GiftId int32 `protobuf:"varint,5,opt,name=giftId,proto3" json:"giftId,omitempty"` + GiftName string `protobuf:"bytes,6,opt,name=giftName,proto3" json:"giftName,omitempty"` + TotalCoin int64 `protobuf:"varint,7,opt,name=totalCoin,proto3" json:"totalCoin,omitempty"` + SendTime int64 `protobuf:"varint,8,opt,name=sendTime,proto3" json:"sendTime,omitempty"` +} + +func (x *MqGift) Reset() { + *x = MqGift{} + if protoimpl.UnsafeEnabled { + mi := &file_mq_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MqGift) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MqGift) ProtoMessage() {} + +func (x *MqGift) ProtoReflect() protoreflect.Message { + mi := &file_mq_proto_msgTypes[1] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MqGift.ProtoReflect.Descriptor instead. +func (*MqGift) Descriptor() ([]byte, []int) { + return file_mq_proto_rawDescGZIP(), []int{1} +} + +func (x *MqGift) GetPlatform() string { + if x != nil { + return x.Platform + } + return "" +} + +func (x *MqGift) GetLiveRoomId() int64 { + if x != nil { + return x.LiveRoomId + } + return 0 +} + +func (x *MqGift) GetUid() int64 { + if x != nil { + return x.Uid + } + return 0 +} + +func (x *MqGift) GetUname() string { + if x != nil { + return x.Uname + } + return "" +} + +func (x *MqGift) GetGiftId() int32 { + if x != nil { + return x.GiftId + } + return 0 +} + +func (x *MqGift) GetGiftName() string { + if x != nil { + return x.GiftName + } + return "" +} + +func (x *MqGift) GetTotalCoin() int64 { + if x != nil { + return x.TotalCoin + } + return 0 +} + +func (x *MqGift) GetSendTime() int64 { + if x != nil { + return x.SendTime + } + return 0 +} + +var File_mq_proto protoreflect.FileDescriptor + +var file_mq_proto_rawDesc = []byte{ + 0x0a, 0x08, 0x6d, 0x71, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xa5, + 0x01, 0x0a, 0x09, 0x4d, 0x71, 0x44, 0x61, 0x6e, 0x6d, 0x61, 0x6b, 0x75, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, 0x0a, 0x6c, 0x69, 0x76, 0x65, + 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0a, 0x6c, 0x69, + 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x75, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, + 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, + 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xda, 0x01, 0x0a, 0x06, 0x4d, 0x71, 0x47, 0x69, 0x66, + 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x1e, 0x0a, + 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x03, 0x52, 0x0a, 0x6c, 0x69, 0x76, 0x65, 0x52, 0x6f, 0x6f, 0x6d, 0x49, 0x64, 0x12, 0x10, 0x0a, + 0x03, 0x75, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12, + 0x14, 0x0a, 0x05, 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x75, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x18, + 0x05, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x67, 0x69, 0x66, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, + 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x08, 0x67, 0x69, 0x66, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x6f, 0x74, + 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x6f, + 0x74, 0x61, 0x6c, 0x43, 0x6f, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x73, 0x65, 0x6e, 0x64, 0x54, + 0x69, 0x6d, 0x65, 0x2a, 0x39, 0x0a, 0x08, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, + 0x0c, 0x0a, 0x08, 0x62, 0x69, 0x6c, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x10, 0x00, 0x12, 0x08, 0x0a, + 0x04, 0x68, 0x75, 0x79, 0x61, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x64, 0x6f, 0x75, 0x79, 0x75, + 0x10, 0x02, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x6f, 0x75, 0x79, 0x69, 0x6e, 0x10, 0x03, 0x42, 0x07, + 0x5a, 0x05, 0x2f, 0x70, 0x62, 0x4d, 0x71, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_mq_proto_rawDescOnce sync.Once + file_mq_proto_rawDescData = file_mq_proto_rawDesc +) + +func file_mq_proto_rawDescGZIP() []byte { + file_mq_proto_rawDescOnce.Do(func() { + file_mq_proto_rawDescData = protoimpl.X.CompressGZIP(file_mq_proto_rawDescData) + }) + return file_mq_proto_rawDescData +} + +var file_mq_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_mq_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_mq_proto_goTypes = []interface{}{ + (Platform)(0), // 0: pb.Platform + (*MqDanmaku)(nil), // 1: pb.MqDanmaku + (*MqGift)(nil), // 2: pb.MqGift +} +var file_mq_proto_depIdxs = []int32{ + 0, // [0:0] is the sub-list for method output_type + 0, // [0:0] is the sub-list for method input_type + 0, // [0:0] is the sub-list for extension type_name + 0, // [0:0] is the sub-list for extension extendee + 0, // [0:0] is the sub-list for field type_name +} + +func init() { file_mq_proto_init() } +func file_mq_proto_init() { + if File_mq_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_mq_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MqDanmaku); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_mq_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MqGift); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + } + type x struct{} + out := protoimpl.TypeBuilder{ + File: protoimpl.DescBuilder{ + GoPackagePath: reflect.TypeOf(x{}).PkgPath(), + RawDescriptor: file_mq_proto_rawDesc, + NumEnums: 1, + NumMessages: 2, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_mq_proto_goTypes, + DependencyIndexes: file_mq_proto_depIdxs, + EnumInfos: file_mq_proto_enumTypes, + MessageInfos: file_mq_proto_msgTypes, + }.Build() + File_mq_proto = out.File + file_mq_proto_rawDesc = nil + file_mq_proto_goTypes = nil + file_mq_proto_depIdxs = nil +} diff --git a/app/pb/mq/mq.proto b/app/pb/mq/mq.proto new file mode 100644 index 0000000..29822ed --- /dev/null +++ b/app/pb/mq/mq.proto @@ -0,0 +1,32 @@ +syntax = "proto3"; + +package pb; + +option go_package = "/pbMq"; + +enum Platform { + bilibili = 0; // B站 + huya = 1; // 虎牙 + douyu = 2; // 斗鱼 + douyin = 3; // 抖音 +} + +message MqDanmaku { + string platform = 1; + int64 liveRoomId = 2; + int64 uid = 3; + string uname = 4; + string content = 5; + int64 sendTime = 6; +} + +message MqGift { + string platform = 1; + int64 liveRoomId = 2; + int64 uid = 3; + string uname = 4; + int32 giftId = 5; + string giftName = 6; + int64 totalCoin = 7; + int64 sendTime = 8; +} \ No newline at end of file diff --git a/app/user_center/genModel.bat b/app/user_center/genModel.bat index c13d5bc..594d6fa 100644 --- a/app/user_center/genModel.bat +++ b/app/user_center/genModel.bat @@ -1,17 +1,20 @@ @echo off -@echo ʼģ +@echo ?????????????? set tables=user,user_platform set targetDir=.\model set templateDir=..\..\doc\template -set host=127.0.0.1 -set port=23306 -set dbname=dcg +::set host=127.0.0.1 +::set port=23306 +set host=192.168.1.100 +set port=3306 +::set dbname=dcg +set dbname=dmgame set username=root set password=root for %%i in (%tables%) do ( - echo ʼ⣺ %dbname% ı %%i + echo ????????? %dbname% ??? %%i goctl model mysql datasource --url "%username%:%password%@tcp(%host%:%port%)/%dbname%" -t %%i -d %targetDir% --style go_zero --home %templateDir% ) \ No newline at end of file diff --git a/app/user_center/generate.go b/app/user_center/generate.go index 2988186..e11656f 100644 --- a/app/user_center/generate.go +++ b/app/user_center/generate.go @@ -1,7 +1,7 @@ package user_center // protoc 生成 -//go:generate goctl rpc protoc ./rpc/pb/user_center.proto --style=go_zero --go_out=./rpc --go-grpc_out=./rpc --zrpc_out=./rpc +//go:generate goctl rpc protoc ./rpc/pb/gift.proto --style=go_zero --go_out=./rpc --go-grpc_out=./rpc --zrpc_out=./rpc // api 生成 //go:generate goctl api go -api ./api/doc/user_center.api -dir ./api --style go_zero diff --git a/app/user_center/model/user_platform_model.go b/app/user_center/model/user_platform_model.go index 3769f32..a31d456 100644 --- a/app/user_center/model/user_platform_model.go +++ b/app/user_center/model/user_platform_model.go @@ -1,6 +1,11 @@ package model -import "github.com/zeromicro/go-zero/core/stores/sqlx" +import ( + "context" + "fmt" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) var _ UserPlatformModel = (*customUserPlatformModel)(nil) @@ -9,6 +14,7 @@ type ( // and implement the added methods in customUserPlatformModel. UserPlatformModel interface { userPlatformModel + FindOneByPlatformAndPUid(ctx context.Context, platform string, pUid string) (*UserPlatform, error) } customUserPlatformModel struct { @@ -22,3 +28,17 @@ func NewUserPlatformModel(conn sqlx.SqlConn) UserPlatformModel { defaultUserPlatformModel: newUserPlatformModel(conn), } } + +func (c *customUserPlatformModel) FindOneByPlatformAndPUid(ctx context.Context, platform string, pUid string) (*UserPlatform, error) { + query := fmt.Sprintf("select %s from %s where `platform` = ? and `p_uid` = ? limit 1", userPlatformRows, c.table) + var resp UserPlatform + err := c.conn.QueryRowCtx(ctx, &resp, query, platform, pUid) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} diff --git a/app/user_center/model/user_platform_model_gen.go b/app/user_center/model/user_platform_model_gen.go index 5a4f285..3932304 100644 --- a/app/user_center/model/user_platform_model_gen.go +++ b/app/user_center/model/user_platform_model_gen.go @@ -36,16 +36,16 @@ type ( } UserPlatform struct { - Id int64 `db:"id"` // 主键 - UserId int64 `db:"user_id"` // 用户ID - Platform string `db:"platform"` // 平台类型 - POpenid sql.NullString `db:"p_openid"` // 平台用户openid - PUid string `db:"p_uid"` // 平台用户uid - Uname string `db:"uname"` // 平台用户名 - Avatar string `db:"avatar"` // 平台用户头像地址 - Info string `db:"info"` // 平台用户原始信息(json) - CreateTime time.Time `db:"create_time"` // 创建时间 - UpdateTime time.Time `db:"update_time"` // 更新时间 + Id int64 `db:"id"` // 主键 + UserId int64 `db:"user_id"` // 用户ID + Platform string `db:"platform"` // 平台类型 + POpenid string `db:"p_openid"` // 平台用户openid + PUid string `db:"p_uid"` // 平台用户uid + PUname string `db:"p_uname"` // 平台用户名 + PInfo string `db:"p_info"` // 平台用户原始信息(json) + PAvatar string `db:"p_avatar"` // 平台用户头像地址 + CreateTime time.Time `db:"create_time"` // 创建时间 + UpdateTime time.Time `db:"update_time"` // 更新时间 } ) @@ -58,7 +58,7 @@ func newUserPlatformModel(conn sqlx.SqlConn) *defaultUserPlatformModel { func (m *defaultUserPlatformModel) Insert(ctx context.Context, data *UserPlatform) (sql.Result, error) { query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?, ?, ?, ?)", m.table, userPlatformRowsExpectAutoSet) - ret, err := m.conn.ExecCtx(ctx, query, data.Id, data.UserId, data.Platform, data.POpenid, data.PUid, data.Uname, data.Avatar, data.Info) + ret, err := m.conn.ExecCtx(ctx, query, data.Id, data.UserId, data.Platform, data.POpenid, data.PUid, data.PUname, data.PInfo, data.PAvatar) return ret, err } @@ -78,7 +78,7 @@ func (m *defaultUserPlatformModel) FindOne(ctx context.Context, id int64) (*User func (m *defaultUserPlatformModel) Update(ctx context.Context, data *UserPlatform) error { query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, userPlatformRowsWithPlaceHolder) - _, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Platform, data.POpenid, data.PUid, data.Uname, data.Avatar, data.Info, data.Id) + _, err := m.conn.ExecCtx(ctx, query, data.UserId, data.Platform, data.POpenid, data.PUid, data.PUname, data.PInfo, data.PAvatar, data.Id) return err } diff --git a/app/user_center/rpc/etc/user_center.yaml b/app/user_center/rpc/etc/user_center.yaml new file mode 100644 index 0000000..49efc1c --- /dev/null +++ b/app/user_center/rpc/etc/user_center.yaml @@ -0,0 +1,17 @@ +Name: usercenter.rpc +ListenOn: 127.0.0.1:10001 +Etcd: + Hosts: + - 127.0.0.1:2379 + Key: usercenter.rpc +DB: + DataSource: root:root@tcp(192.168.1.100:3306)/dmgame?charset=utf8mb4&loc=Asia%2FShanghai&parseTime=true +Danmaku: + Kafka: + Addr: [ "127.0.0.1:9093" ] + Topic: "danmaku" + ConsumerGroupId: "msgToDb" + Command: + Keys: [ "j","J","加入","加入游戏" ] +User: + UpdateDuration: 72 # 72 hours \ No newline at end of file diff --git a/app/user_center/rpc/internal/config/config.go b/app/user_center/rpc/internal/config/config.go new file mode 100644 index 0000000..b3fdae9 --- /dev/null +++ b/app/user_center/rpc/internal/config/config.go @@ -0,0 +1,29 @@ +package config + +import "github.com/zeromicro/go-zero/zrpc" + +type ( + Kafka struct { + Addr []string + Topic string + ConsumerGroupId string + } + Config struct { + zrpc.RpcServerConf + + DB struct { + DataSource string + } + + Danmaku struct { + Kafka Kafka + Command struct { + Keys []string + } + } + + User struct { + UpdateDuration int64 // 用户信息更新最短间隔 单位 h + } + } +) diff --git a/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go b/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go new file mode 100644 index 0000000..46a290f --- /dev/null +++ b/app/user_center/rpc/internal/logic/platform_user/platform_user_retrieve.go @@ -0,0 +1,36 @@ +package platform_user + +import ( + "github.com/pkg/errors" + pbMq "live-service/app/user_center/pb/mq" +) + +// PlatformUser 仅提取需要的部分,其余的json后装到p_info +type ( + PlatformUser struct { + PUid string + PName string + PAvatar string + PInfo string + } + UserRetriever struct { + retrieveMapper map[string]RetrieveFunc + } +) + +type RetrieveFunc func(pUid string) (*PlatformUser, error) + +func NewUserRetriever() *UserRetriever { + return &UserRetriever{ + retrieveMapper: map[string]RetrieveFunc{ + pbMq.Platform_name[int32(pbMq.Platform_bilibili)]: RetrieveBilibili, + }, + } +} + +func (r *UserRetriever) RetrieveUser(platform, pUid string) (*PlatformUser, error) { + if handle, ok := r.retrieveMapper[platform]; ok { + return handle(pUid) + } + return nil, errors.New("没有此平台的用户数据收集器") +} diff --git a/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go b/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go new file mode 100644 index 0000000..f248c49 --- /dev/null +++ b/app/user_center/rpc/internal/logic/platform_user/retrieve_bilibili.go @@ -0,0 +1,46 @@ +package platform_user + +import ( + "encoding/json" + "fmt" + "github.com/pkg/errors" + "io" + "net/http" + "strconv" +) + +func RetrieveBilibili(pUid string) (*PlatformUser, error) { + httpResponse, err := http.Get(fmt.Sprintf("https://api.bilibili.com/x/space/acc/info?mid=%s", pUid)) + if err != nil { + return nil, errors.Wrap(err, "网络错误") + } + all, err := io.ReadAll(httpResponse.Body) + if err != nil { + return nil, errors.Wrap(err, "读取接口数据错误 IO/Error") + } + var resp struct { + Code int64 `json:"code"` + Message string `json:"message"` + Ttl int64 `json:"ttl"` // 未知意义 + Data map[string]interface{} `json:"data,omitempty"` + } + err = json.Unmarshal(all, &resp) + if err != nil { + return nil, errors.Wrap(err, "读取接口数据错误 Unmarshal/Error") + } + if resp.Code == 0 && resp.Data != nil { + // 成功 + data, err := json.Marshal(resp.Data) + if err != nil { + return nil, errors.Wrap(err, "读取接口数据错误 Marshal/Data/Error") + } + return &PlatformUser{ + PUid: strconv.FormatInt(int64(resp.Data["mid"].(float64)), 10), + PName: resp.Data["name"].(string), + PAvatar: resp.Data["face"].(string), + PInfo: string(data), + }, nil + } else { + return nil, errors.New(resp.Message) + } +} diff --git a/app/user_center/rpc/internal/logic/retrieve_platform_user_logic.go b/app/user_center/rpc/internal/logic/retrieve_platform_user_logic.go new file mode 100644 index 0000000..c494e08 --- /dev/null +++ b/app/user_center/rpc/internal/logic/retrieve_platform_user_logic.go @@ -0,0 +1,112 @@ +package logic + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/uuid" + "github.com/pkg/errors" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/logic/platform_user" + "time" + + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RetrievePlatformUserLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + platformUserRetriever *platform_user.UserRetriever + + logx.Logger +} + +func NewRetrievePlatformUserLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RetrievePlatformUserLogic { + return &RetrievePlatformUserLogic{ + ctx: ctx, + svcCtx: svcCtx, + platformUserRetriever: platform_user.NewUserRetriever(), + Logger: logx.WithContext(ctx), + } +} + +// RetrievePlatformUser 查询或创建用户 +func (l *RetrievePlatformUserLogic) RetrievePlatformUser(in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) { + var err error + dbPlatformUser, err := l.svcCtx.UserPlatformModel.FindOneByPlatformAndPUid(l.ctx, in.Platform, in.PUid) + if err != nil { + if !errors.Is(err, model.ErrNotFound) { + return nil, err // sql错误 + } + } + // 根据 updateTime 判断是否需要更新 + if dbPlatformUser != nil && time.Now().Add(time.Duration(l.svcCtx.Config.User.UpdateDuration)*time.Hour).Before(dbPlatformUser.UpdateTime) { + var username *string + if one, err := l.svcCtx.UserModel.FindOne(l.ctx, dbPlatformUser.UserId); err != nil { + username = &one.Username + } + return &pb.PlatformUserResp{ + User: l.buildPBUser(username, dbPlatformUser), + }, nil + } + + var platformUser *platform_user.PlatformUser + platformUser, err = l.platformUserRetriever.RetrieveUser(in.Platform, in.PUid) + if err != nil { + // 获取平台信息失败 + return nil, errors.Wrap(err, "获取平台信息失败") + } + + var dbUser model.User + if dbPlatformUser == nil { + // create + dbUser = model.User{ + Id: uuid.NextId(), + Username: "", + } + if _, err = l.svcCtx.UserModel.Insert(l.ctx, &dbUser); err != nil { + return nil, errors.Wrap(err, "插入用户数据失败") + } + dbPlatformUser = &model.UserPlatform{ + Id: uuid.NextId(), + UserId: dbUser.Id, + Platform: in.Platform, + POpenid: "", + PUid: platformUser.PUid, + PUname: platformUser.PName, + PInfo: platformUser.PInfo, + PAvatar: platformUser.PAvatar, + } + if _, err = l.svcCtx.UserPlatformModel.Insert(l.ctx, dbPlatformUser); err != nil { + return nil, errors.Wrap(err, "插入平台用户数据失败") + } + } else { + // update + dbPlatformUser.PUid = platformUser.PUid + dbPlatformUser.PUname = platformUser.PName + dbPlatformUser.PAvatar = platformUser.PAvatar + dbPlatformUser.PInfo = platformUser.PInfo + if err = l.svcCtx.UserPlatformModel.Update(l.ctx, dbPlatformUser); err != nil { + return nil, errors.Wrap(err, "更新平台用户数据失败") + } + } + return &pb.PlatformUserResp{ + User: l.buildPBUser(&dbUser.Username, dbPlatformUser), + }, nil +} + +func (l *RetrievePlatformUserLogic) buildPBUser(username *string, dbPlatformUser *model.UserPlatform) *pb.User { + result := &pb.User{ + Id: dbPlatformUser.UserId, + Platform: dbPlatformUser.Platform, + PUid: dbPlatformUser.PUid, + PUname: dbPlatformUser.PUname, + PAvatar: dbPlatformUser.PAvatar, + PInfo: dbPlatformUser.PInfo, + } + if username != nil { + result.Username = *username + } + return result +} diff --git a/app/user_center/rpc/internal/server/user_center_server.go b/app/user_center/rpc/internal/server/user_center_server.go new file mode 100644 index 0000000..6560ba2 --- /dev/null +++ b/app/user_center/rpc/internal/server/user_center_server.go @@ -0,0 +1,29 @@ +// Code generated by goctl. DO NOT EDIT! +// Source: gift.proto + +package server + +import ( + "context" + + "live-service/app/user_center/rpc/internal/logic" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" +) + +type UserCenterServer struct { + svcCtx *svc.ServiceContext + pb.UnimplementedUserCenterServer +} + +func NewUserCenterServer(svcCtx *svc.ServiceContext) *UserCenterServer { + return &UserCenterServer{ + svcCtx: svcCtx, + } +} + +// user +func (s *UserCenterServer) RetrievePlatformUser(ctx context.Context, in *pb.PlatformUserReq) (*pb.PlatformUserResp, error) { + l := logic.NewRetrievePlatformUserLogic(ctx, s.svcCtx) + return l.RetrievePlatformUser(in) +} diff --git a/app/user_center/rpc/internal/svc/service_context.go b/app/user_center/rpc/internal/svc/service_context.go new file mode 100644 index 0000000..07428c8 --- /dev/null +++ b/app/user_center/rpc/internal/svc/service_context.go @@ -0,0 +1,22 @@ +package svc + +import ( + "github.com/zeromicro/go-zero/core/stores/sqlx" + "live-service/app/user_center/model" + "live-service/app/user_center/rpc/internal/config" +) + +type ServiceContext struct { + Config config.Config + + UserModel model.UserModel + UserPlatformModel model.UserPlatformModel +} + +func NewServiceContext(c config.Config) *ServiceContext { + return &ServiceContext{ + Config: c, + UserModel: model.NewUserModel(sqlx.NewMysql(c.DB.DataSource)), + UserPlatformModel: model.NewUserPlatformModel(sqlx.NewMysql(c.DB.DataSource)), + } +} diff --git a/app/user_center/rpc/msg_transfer/danmaku/cmd_manager.go b/app/user_center/rpc/msg_transfer/danmaku/cmd_manager.go new file mode 100644 index 0000000..051c79c --- /dev/null +++ b/app/user_center/rpc/msg_transfer/danmaku/cmd_manager.go @@ -0,0 +1,35 @@ +package danmaku + +import pbMq "live-service/app/user_center/pb/mq" + +type HandlerFunc func(roomId int64, cmd string, dm *pbMq.MqDanmaku) + +type Manager struct { + handlers map[string]HandlerFunc +} + +func NewManager() *Manager { + return &Manager{ + handlers: make(map[string]HandlerFunc), + } +} + +func (m *Manager) Register(h HandlerFunc, cmd string, alias ...string) { + if _, ok := m.handlers[cmd]; ok { + return + } + m.handlers[cmd] = h + // alias + for _, s := range alias { + if _, ok := m.handlers[cmd]; ok { + continue + } + m.handlers[s] = h + } +} + +func (m *Manager) Handle(roomId int64, cmd string, user *pbMq.MqDanmaku) { + if h, ok := m.handlers[cmd]; ok { + h(roomId, cmd, user) + } +} diff --git a/app/user_center/rpc/msg_transfer/danmaku/cmd_parser.go b/app/user_center/rpc/msg_transfer/danmaku/cmd_parser.go new file mode 100644 index 0000000..14be103 --- /dev/null +++ b/app/user_center/rpc/msg_transfer/danmaku/cmd_parser.go @@ -0,0 +1,67 @@ +package danmaku + +import ( + "git.noahlan.cn/northlan/ntools-go/stringn/ac" +) + +type ( + CMD struct { + IsCMD bool // 是否CMD + Arr []string // 具体CMD []string + } + Parser struct { + trie *ac.Trie + allKeyArr []string + keywordMap map[string]struct{} + } + ParserBuilder struct { + } +) + +func NewCMDParser(keys []string) *Parser { + p := &Parser{ + keywordMap: make(map[string]struct{}), + allKeyArr: make([]string, len(keys)), + } + for _, keyword := range keys { + p.keywordMap[keyword] = struct{}{} + p.allKeyArr = append(p.allKeyArr, keyword) + } + p.trie = ac.NewTrieBuilder().AddStrings(p.allKeyArr).Build() + return p +} + +func (p *Parser) ParseTest(content string) { + p.trie.MatchString(content) +} + +func (p *Parser) Parse(content string) *CMD { + matches := p.trie.MatchString(content) + + allKeyLen := 0 + matchedKeyMap := make(map[string]struct{}) + for _, match := range matches { + tmp := p.allKeyArr[match.Pattern()] + matchedKeyMap[tmp] = struct{}{} + allKeyLen += len(tmp) + } + isCMD := len(content) <= allKeyLen + + // 避免同类型指令重复 + arrMap := make(map[rune]struct{}) + var matchedCmdArr []string + if isCMD { + matchedCmdArr = make([]string, 0, len(matchedKeyMap)) + for s := range matchedKeyMap { + sRune := []rune(s) + if _, ok := arrMap[sRune[0]]; !ok { + arrMap[sRune[0]] = struct{}{} + matchedCmdArr = append(matchedCmdArr, s) + } + } + } + return &CMD{ + IsCMD: len(content) <= allKeyLen, + Arr: matchedCmdArr, + } +} diff --git a/app/user_center/rpc/msg_transfer/danmaku/msg_to_db.go b/app/user_center/rpc/msg_transfer/danmaku/msg_to_db.go new file mode 100644 index 0000000..eebfc17 --- /dev/null +++ b/app/user_center/rpc/msg_transfer/danmaku/msg_to_db.go @@ -0,0 +1,99 @@ +package danmaku + +import ( + "context" + "git.noahlan.cn/northlan/ntools-go/kafka" + "github.com/Shopify/sarama" + "github.com/zeromicro/go-zero/core/logx" + "google.golang.org/protobuf/proto" + pbMq "live-service/app/user_center/pb/mq" + "live-service/app/user_center/rpc/internal/server" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + kfk "live-service/common/kafka" + "strconv" +) + +type msgHandlerFunc func(data []byte, msgKey string) + +type MsgToDBHandler struct { + context context.Context + ctx *svc.ServiceContext + svr *server.UserCenterServer + + msgHandle map[string]msgHandlerFunc + + cmdParser *Parser + commandManager *Manager + + ConsumerGroup *kafka.ConsumerGroup + + logx.Logger +} + +func (h *MsgToDBHandler) Init(context context.Context, ctx *svc.ServiceContext, svr *server.UserCenterServer) { + h.context = context + h.ctx = ctx + h.svr = svr + h.Logger = logx.WithContext(h.context) + + cfg := ctx.Config.Danmaku.Kafka + h.msgHandle = make(map[string]msgHandlerFunc) + h.msgHandle["danmaku"] = h.handleDanmaku + + h.cmdParser = NewCMDParser(ctx.Config.Danmaku.Command.Keys) + // + h.commandManager = NewManager() + h.commandManager.Register(h.handleJoinGame, "j", "J", "加入", "加入游戏") + + var err error + h.ConsumerGroup, err = kafka.NewConsumerGroup(&kafka.ConsumerGroupConfig{ + KafkaVersion: sarama.V3_1_0_0, + OffsetsInitial: sarama.OffsetNewest, + IsReturnErr: false, + UnMarshaler: kfk.ProtobufMarshaler, + }, cfg.Addr, []string{cfg.Topic}, cfg.ConsumerGroupId) + + if err != nil { + h.Logger.Error(err) + } +} + +func (h *MsgToDBHandler) handleJoinGame(_ int64, _ string, danmaku *pbMq.MqDanmaku) { + _, err := h.svr.RetrievePlatformUser(h.context, &pb.PlatformUserReq{ + Platform: danmaku.Platform, + PUid: strconv.FormatInt(danmaku.Uid, 10), + }) + if err != nil { + return + } +} + +func (h *MsgToDBHandler) handleDanmaku(data []byte, msgKey string) { + // msg proto + var msgFromMq pbMq.MqDanmaku + if err := proto.Unmarshal(data, &msgFromMq); err != nil { + h.Logger.Error("unmarshal msg err", err) + return + } + + cmdStruct := h.cmdParser.Parse(msgFromMq.Content) + // 只处理命令 + if cmdStruct.IsCMD { + for _, cmd := range cmdStruct.Arr { + h.commandManager.Handle(msgFromMq.LiveRoomId, cmd, &msgFromMq) + } + } +} + +func (MsgToDBHandler) Setup(_ sarama.ConsumerGroupSession) error { return nil } +func (MsgToDBHandler) Cleanup(_ sarama.ConsumerGroupSession) error { return nil } +func (h *MsgToDBHandler) ConsumeClaim(sess sarama.ConsumerGroupSession, claim sarama.ConsumerGroupClaim) error { + for msg := range claim.Messages() { + if hFunc, ok := h.msgHandle[msg.Topic]; ok { + hFunc(msg.Value, string(msg.Key)) + } + sess.MarkMessage(msg, "") + } + return nil +} diff --git a/app/user_center/rpc/msg_transfer/init.go b/app/user_center/rpc/msg_transfer/init.go new file mode 100644 index 0000000..842b023 --- /dev/null +++ b/app/user_center/rpc/msg_transfer/init.go @@ -0,0 +1,20 @@ +package msg_transfer + +import ( + "context" + "live-service/app/user_center/rpc/internal/server" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/msg_transfer/danmaku" +) + +var ( + danmakuMsgToDb danmaku.MsgToDBHandler +) + +func Init(context context.Context, ctx *svc.ServiceContext, svr *server.UserCenterServer) { + danmakuMsgToDb.Init(context, ctx, svr) +} + +func Run() { + go danmakuMsgToDb.ConsumerGroup.RegisterHandlerAndConsumer(&danmakuMsgToDb) +} diff --git a/app/user_center/rpc/pb/generate.go b/app/user_center/rpc/pb/generate.go index 12c2758..dbb41e0 100644 --- a/app/user_center/rpc/pb/generate.go +++ b/app/user_center/rpc/pb/generate.go @@ -1,3 +1,3 @@ package pb -//go:generate goctl rpc protoc user_center.proto --style=go_zero --go_out=../ --go-grpc_out=../ --zrpc_out=../ +//go:generate goctl rpc protoc gift.proto --style=go_zero --go_out=../ --go-grpc_out=../ --zrpc_out=../ diff --git a/app/user_center/rpc/pb/user_center.pb.go b/app/user_center/rpc/pb/user_center.pb.go index 6767cbe..2fa3604 100644 --- a/app/user_center/rpc/pb/user_center.pb.go +++ b/app/user_center/rpc/pb/user_center.pb.go @@ -2,7 +2,7 @@ // versions: // protoc-gen-go v1.28.0 // protoc v3.19.4 -// source: rpc/pb/user_center.proto +// source: gift.proto package pb @@ -26,26 +26,20 @@ type User struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` - PhoneNumber string `protobuf:"bytes,3,opt,name=phoneNumber,proto3" json:"phoneNumber,omitempty"` - Email string `protobuf:"bytes,4,opt,name=email,proto3" json:"email,omitempty"` - Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` - // profile - Name string `protobuf:"bytes,6,opt,name=name,proto3" json:"name,omitempty"` - Nickname string `protobuf:"bytes,7,opt,name=nickname,proto3" json:"nickname,omitempty"` - Gender int64 `protobuf:"varint,8,opt,name=gender,proto3" json:"gender,omitempty"` - Birthdate string `protobuf:"bytes,9,opt,name=birthdate,proto3" json:"birthdate,omitempty"` - Address string `protobuf:"bytes,10,opt,name=address,proto3" json:"address,omitempty"` - Age int32 `protobuf:"varint,11,opt,name=age,proto3" json:"age,omitempty"` - Country string `protobuf:"bytes,12,opt,name=country,proto3" json:"country,omitempty"` - Picture string `protobuf:"bytes,13,opt,name=picture,proto3" json:"picture,omitempty"` + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` + Username string `protobuf:"bytes,2,opt,name=username,proto3" json:"username,omitempty"` + // platform + Platform string `protobuf:"bytes,3,opt,name=platform,proto3" json:"platform,omitempty"` + PUid string `protobuf:"bytes,4,opt,name=pUid,proto3" json:"pUid,omitempty"` + PUname string `protobuf:"bytes,5,opt,name=pUname,proto3" json:"pUname,omitempty"` + PAvatar string `protobuf:"bytes,6,opt,name=pAvatar,proto3" json:"pAvatar,omitempty"` + PInfo string `protobuf:"bytes,7,opt,name=pInfo,proto3" json:"pInfo,omitempty"` } func (x *User) Reset() { *x = User{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[0] + mi := &file_user_center_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -58,7 +52,7 @@ func (x *User) String() string { func (*User) ProtoMessage() {} func (x *User) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[0] + mi := &file_user_center_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -71,7 +65,7 @@ func (x *User) ProtoReflect() protoreflect.Message { // Deprecated: Use User.ProtoReflect.Descriptor instead. func (*User) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{0} + return file_user_center_proto_rawDescGZIP(), []int{0} } func (x *User) GetId() int64 { @@ -88,198 +82,68 @@ func (x *User) GetUsername() string { return "" } -func (x *User) GetPhoneNumber() string { - if x != nil { - return x.PhoneNumber - } - return "" -} - -func (x *User) GetEmail() string { - if x != nil { - return x.Email - } - return "" -} - -func (x *User) GetPassword() string { - if x != nil { - return x.Password - } - return "" -} - -func (x *User) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *User) GetNickname() string { - if x != nil { - return x.Nickname - } - return "" -} - -func (x *User) GetGender() int64 { - if x != nil { - return x.Gender - } - return 0 -} - -func (x *User) GetBirthdate() string { - if x != nil { - return x.Birthdate - } - return "" -} - -func (x *User) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -func (x *User) GetAge() int32 { - if x != nil { - return x.Age - } - return 0 -} - -func (x *User) GetCountry() string { - if x != nil { - return x.Country - } - return "" -} - -func (x *User) GetPicture() string { - if x != nil { - return x.Picture - } - return "" -} - -type UserLoginRecord struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - LastLoginAt string `protobuf:"bytes,2,opt,name=lastLoginAt,proto3" json:"lastLoginAt,omitempty"` - LastLoginIp string `protobuf:"bytes,3,opt,name=lastLoginIp,proto3" json:"lastLoginIp,omitempty"` - LastLoginDevice string `protobuf:"bytes,4,opt,name=lastLoginDevice,proto3" json:"lastLoginDevice,omitempty"` - LastLoginUA string `protobuf:"bytes,5,opt,name=lastLoginUA,proto3" json:"lastLoginUA,omitempty"` - Count string `protobuf:"bytes,6,opt,name=count,proto3" json:"count,omitempty"` -} - -func (x *UserLoginRecord) Reset() { - *x = UserLoginRecord{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserLoginRecord) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserLoginRecord) ProtoMessage() {} - -func (x *UserLoginRecord) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserLoginRecord.ProtoReflect.Descriptor instead. -func (*UserLoginRecord) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{1} -} - -func (x *UserLoginRecord) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UserLoginRecord) GetLastLoginAt() string { +func (x *User) GetPlatform() string { if x != nil { - return x.LastLoginAt + return x.Platform } return "" } -func (x *UserLoginRecord) GetLastLoginIp() string { +func (x *User) GetPUid() string { if x != nil { - return x.LastLoginIp + return x.PUid } return "" } -func (x *UserLoginRecord) GetLastLoginDevice() string { +func (x *User) GetPUname() string { if x != nil { - return x.LastLoginDevice + return x.PUname } return "" } -func (x *UserLoginRecord) GetLastLoginUA() string { +func (x *User) GetPAvatar() string { if x != nil { - return x.LastLoginUA + return x.PAvatar } return "" } -func (x *UserLoginRecord) GetCount() string { +func (x *User) GetPInfo() string { if x != nil { - return x.Count + return x.PInfo } return "" } -type Role struct { +// req +type PlatformUserReq struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"` - Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` - Desc string `protobuf:"bytes,4,opt,name=desc,proto3" json:"desc,omitempty"` + Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` + PUid string `protobuf:"bytes,2,opt,name=pUid,proto3" json:"pUid,omitempty"` } -func (x *Role) Reset() { - *x = Role{} +func (x *PlatformUserReq) Reset() { + *x = PlatformUserReq{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[2] + mi := &file_user_center_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *Role) String() string { +func (x *PlatformUserReq) String() string { return protoimpl.X.MessageStringOf(x) } -func (*Role) ProtoMessage() {} +func (*PlatformUserReq) ProtoMessage() {} -func (x *Role) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[2] +func (x *PlatformUserReq) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -290,269 +154,26 @@ func (x *Role) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use Role.ProtoReflect.Descriptor instead. -func (*Role) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{2} -} - -func (x *Role) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *Role) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *Role) GetName() string { - if x != nil { - return x.Name - } - return "" +// Deprecated: Use PlatformUserReq.ProtoReflect.Descriptor instead. +func (*PlatformUserReq) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{1} } -func (x *Role) GetDesc() string { +func (x *PlatformUserReq) GetPlatform() string { if x != nil { - return x.Desc + return x.Platform } return "" } -type EmptyMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *EmptyMessage) Reset() { - *x = EmptyMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *EmptyMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*EmptyMessage) ProtoMessage() {} - -func (x *EmptyMessage) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use EmptyMessage.ProtoReflect.Descriptor instead. -func (*EmptyMessage) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{3} -} - -type SimpleMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Msg string `protobuf:"bytes,1,opt,name=msg,proto3" json:"msg,omitempty"` -} - -func (x *SimpleMessage) Reset() { - *x = SimpleMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SimpleMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SimpleMessage) ProtoMessage() {} - -func (x *SimpleMessage) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SimpleMessage.ProtoReflect.Descriptor instead. -func (*SimpleMessage) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{4} -} - -func (x *SimpleMessage) GetMsg() string { +func (x *PlatformUserReq) GetPUid() string { if x != nil { - return x.Msg - } - return "" -} - -type CreateUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id *int64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` - PhoneNumber *string `protobuf:"bytes,3,opt,name=phoneNumber,proto3,oneof" json:"phoneNumber,omitempty"` - Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` - Password *string `protobuf:"bytes,5,opt,name=password,proto3,oneof" json:"password,omitempty"` - // profile - Name *string `protobuf:"bytes,6,opt,name=name,proto3,oneof" json:"name,omitempty"` - Nickname *string `protobuf:"bytes,7,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"` - Gender *int64 `protobuf:"varint,8,opt,name=gender,proto3,oneof" json:"gender,omitempty"` - Birthdate *string `protobuf:"bytes,9,opt,name=birthdate,proto3,oneof" json:"birthdate,omitempty"` - Address *string `protobuf:"bytes,10,opt,name=address,proto3,oneof" json:"address,omitempty"` - Age *int64 `protobuf:"varint,11,opt,name=age,proto3,oneof" json:"age,omitempty"` - Country *string `protobuf:"bytes,12,opt,name=country,proto3,oneof" json:"country,omitempty"` - Picture *string `protobuf:"bytes,13,opt,name=picture,proto3,oneof" json:"picture,omitempty"` -} - -func (x *CreateUserReq) Reset() { - *x = CreateUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateUserReq) ProtoMessage() {} - -func (x *CreateUserReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateUserReq.ProtoReflect.Descriptor instead. -func (*CreateUserReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{5} -} - -func (x *CreateUserReq) GetId() int64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *CreateUserReq) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -func (x *CreateUserReq) GetPhoneNumber() string { - if x != nil && x.PhoneNumber != nil { - return *x.PhoneNumber - } - return "" -} - -func (x *CreateUserReq) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -func (x *CreateUserReq) GetPassword() string { - if x != nil && x.Password != nil { - return *x.Password - } - return "" -} - -func (x *CreateUserReq) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *CreateUserReq) GetNickname() string { - if x != nil && x.Nickname != nil { - return *x.Nickname - } - return "" -} - -func (x *CreateUserReq) GetGender() int64 { - if x != nil && x.Gender != nil { - return *x.Gender - } - return 0 -} - -func (x *CreateUserReq) GetBirthdate() string { - if x != nil && x.Birthdate != nil { - return *x.Birthdate - } - return "" -} - -func (x *CreateUserReq) GetAddress() string { - if x != nil && x.Address != nil { - return *x.Address - } - return "" -} - -func (x *CreateUserReq) GetAge() int64 { - if x != nil && x.Age != nil { - return *x.Age - } - return 0 -} - -func (x *CreateUserReq) GetCountry() string { - if x != nil && x.Country != nil { - return *x.Country - } - return "" -} - -func (x *CreateUserReq) GetPicture() string { - if x != nil && x.Picture != nil { - return *x.Picture + return x.PUid } return "" } -type CreateUserResp struct { +type PlatformUserResp struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields @@ -560,23 +181,23 @@ type CreateUserResp struct { User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` } -func (x *CreateUserResp) Reset() { - *x = CreateUserResp{} +func (x *PlatformUserResp) Reset() { + *x = PlatformUserResp{} if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[6] + mi := &file_user_center_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *CreateUserResp) String() string { +func (x *PlatformUserResp) String() string { return protoimpl.X.MessageStringOf(x) } -func (*CreateUserResp) ProtoMessage() {} +func (*PlatformUserResp) ProtoMessage() {} -func (x *CreateUserResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[6] +func (x *PlatformUserResp) ProtoReflect() protoreflect.Message { + mi := &file_user_center_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -587,2021 +208,86 @@ func (x *CreateUserResp) ProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -// Deprecated: Use CreateUserResp.ProtoReflect.Descriptor instead. -func (*CreateUserResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{6} +// Deprecated: Use PlatformUserResp.ProtoReflect.Descriptor instead. +func (*PlatformUserResp) Descriptor() ([]byte, []int) { + return file_user_center_proto_rawDescGZIP(), []int{2} } -func (x *CreateUserResp) GetUser() *User { +func (x *PlatformUserResp) GetUser() *User { if x != nil { return x.User } return nil } -type UpdateUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // profile - Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` - Nickname *string `protobuf:"bytes,3,opt,name=nickname,proto3,oneof" json:"nickname,omitempty"` - Gender *int64 `protobuf:"varint,4,opt,name=gender,proto3,oneof" json:"gender,omitempty"` - Birthdate *string `protobuf:"bytes,5,opt,name=birthdate,proto3,oneof" json:"birthdate,omitempty"` - Address *string `protobuf:"bytes,6,opt,name=address,proto3,oneof" json:"address,omitempty"` - Age *int64 `protobuf:"varint,7,opt,name=age,proto3,oneof" json:"age,omitempty"` - Country *string `protobuf:"bytes,8,opt,name=country,proto3,oneof" json:"country,omitempty"` - Picture *string `protobuf:"bytes,9,opt,name=picture,proto3,oneof" json:"picture,omitempty"` +var File_user_center_proto protoreflect.FileDescriptor + +var file_user_center_proto_rawDesc = []byte{ + 0x0a, 0x11, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xaa, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, + 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x12, 0x16, 0x0a, 0x06, + 0x70, 0x55, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x70, 0x55, + 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x18, + 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x41, 0x76, 0x61, 0x74, 0x61, 0x72, 0x12, 0x14, + 0x0a, 0x05, 0x70, 0x49, 0x6e, 0x66, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, + 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x41, 0x0a, 0x0f, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, + 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x55, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x04, 0x70, 0x55, 0x69, 0x64, 0x22, 0x30, 0x0a, 0x10, 0x50, 0x6c, 0x61, 0x74, 0x66, + 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, + 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x4f, 0x0a, 0x0a, 0x75, 0x73, 0x65, + 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x41, 0x0a, 0x14, 0x72, 0x65, 0x74, 0x72, 0x69, + 0x65, 0x76, 0x65, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x12, + 0x13, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x55, 0x73, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x1a, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x50, 0x6c, 0x61, 0x74, 0x66, 0x6f, + 0x72, 0x6d, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x2f, + 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } -func (x *UpdateUserReq) Reset() { - *x = UpdateUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } +var ( + file_user_center_proto_rawDescOnce sync.Once + file_user_center_proto_rawDescData = file_user_center_proto_rawDesc +) + +func file_user_center_proto_rawDescGZIP() []byte { + file_user_center_proto_rawDescOnce.Do(func() { + file_user_center_proto_rawDescData = protoimpl.X.CompressGZIP(file_user_center_proto_rawDescData) + }) + return file_user_center_proto_rawDescData } -func (x *UpdateUserReq) String() string { - return protoimpl.X.MessageStringOf(x) +var file_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 3) +var file_user_center_proto_goTypes = []interface{}{ + (*User)(nil), // 0: pb.User + (*PlatformUserReq)(nil), // 1: pb.PlatformUserReq + (*PlatformUserResp)(nil), // 2: pb.PlatformUserResp +} +var file_user_center_proto_depIdxs = []int32{ + 0, // 0: pb.PlatformUserResp.user:type_name -> pb.User + 1, // 1: pb.userCenter.retrievePlatformUser:input_type -> pb.PlatformUserReq + 2, // 2: pb.userCenter.retrievePlatformUser:output_type -> pb.PlatformUserResp + 2, // [2:3] is the sub-list for method output_type + 1, // [1:2] is the sub-list for method input_type + 1, // [1:1] is the sub-list for extension type_name + 1, // [1:1] is the sub-list for extension extendee + 0, // [0:1] is the sub-list for field type_name } -func (*UpdateUserReq) ProtoMessage() {} - -func (x *UpdateUserReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserReq.ProtoReflect.Descriptor instead. -func (*UpdateUserReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{7} -} - -func (x *UpdateUserReq) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *UpdateUserReq) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *UpdateUserReq) GetNickname() string { - if x != nil && x.Nickname != nil { - return *x.Nickname - } - return "" -} - -func (x *UpdateUserReq) GetGender() int64 { - if x != nil && x.Gender != nil { - return *x.Gender - } - return 0 -} - -func (x *UpdateUserReq) GetBirthdate() string { - if x != nil && x.Birthdate != nil { - return *x.Birthdate - } - return "" -} - -func (x *UpdateUserReq) GetAddress() string { - if x != nil && x.Address != nil { - return *x.Address - } - return "" -} - -func (x *UpdateUserReq) GetAge() int64 { - if x != nil && x.Age != nil { - return *x.Age - } - return 0 -} - -func (x *UpdateUserReq) GetCountry() string { - if x != nil && x.Country != nil { - return *x.Country - } - return "" -} - -func (x *UpdateUserReq) GetPicture() string { - if x != nil && x.Picture != nil { - return *x.Picture - } - return "" -} - -type UpdateUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *UpdateUserResp) Reset() { - *x = UpdateUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateUserResp) ProtoMessage() {} - -func (x *UpdateUserResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateUserResp.ProtoReflect.Descriptor instead. -func (*UpdateUserResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{8} -} - -func (x *UpdateUserResp) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type DeleteUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` -} - -func (x *DeleteUserReq) Reset() { - *x = DeleteUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserReq) ProtoMessage() {} - -func (x *DeleteUserReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserReq.ProtoReflect.Descriptor instead. -func (*DeleteUserReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{9} -} - -func (x *DeleteUserReq) GetIds() []int64 { - if x != nil { - return x.Ids - } - return nil -} - -type DeleteUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` -} - -func (x *DeleteUserResp) Reset() { - *x = DeleteUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteUserResp) ProtoMessage() {} - -func (x *DeleteUserResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteUserResp.ProtoReflect.Descriptor instead. -func (*DeleteUserResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{10} -} - -func (x *DeleteUserResp) GetIds() []int64 { - if x != nil { - return x.Ids - } - return nil -} - -type GetUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id *int64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` - Username *string `protobuf:"bytes,2,opt,name=username,proto3,oneof" json:"username,omitempty"` - PhoneNumber *string `protobuf:"bytes,3,opt,name=phoneNumber,proto3,oneof" json:"phoneNumber,omitempty"` - Email *string `protobuf:"bytes,4,opt,name=email,proto3,oneof" json:"email,omitempty"` -} - -func (x *GetUserReq) Reset() { - *x = GetUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserReq) ProtoMessage() {} - -func (x *GetUserReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserReq.ProtoReflect.Descriptor instead. -func (*GetUserReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{11} -} - -func (x *GetUserReq) GetId() int64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *GetUserReq) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -func (x *GetUserReq) GetPhoneNumber() string { - if x != nil && x.PhoneNumber != nil { - return *x.PhoneNumber - } - return "" -} - -func (x *GetUserReq) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -type GetUserBySocialReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Platform string `protobuf:"bytes,1,opt,name=platform,proto3" json:"platform,omitempty"` // 平台类型 - Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` // platform: openid | unionid -} - -func (x *GetUserBySocialReq) Reset() { - *x = GetUserBySocialReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetUserBySocialReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserBySocialReq) ProtoMessage() {} - -func (x *GetUserBySocialReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserBySocialReq.ProtoReflect.Descriptor instead. -func (*GetUserBySocialReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{12} -} - -func (x *GetUserBySocialReq) GetPlatform() string { - if x != nil { - return x.Platform - } - return "" -} - -func (x *GetUserBySocialReq) GetUuid() string { - if x != nil { - return x.Uuid - } - return "" -} - -type GetUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"` -} - -func (x *GetUserResp) Reset() { - *x = GetUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) +func init() { file_user_center_proto_init() } +func file_user_center_proto_init() { + if File_user_center_proto != nil { + return } -} - -func (x *GetUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetUserResp) ProtoMessage() {} - -func (x *GetUserResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetUserResp.ProtoReflect.Descriptor instead. -func (*GetUserResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{13} -} - -func (x *GetUserResp) GetUser() *User { - if x != nil { - return x.User - } - return nil -} - -type UserLoginRecordReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - LastLoginIp string `protobuf:"bytes,2,opt,name=lastLoginIp,proto3" json:"lastLoginIp,omitempty"` - LastLoginDevice string `protobuf:"bytes,3,opt,name=lastLoginDevice,proto3" json:"lastLoginDevice,omitempty"` - LastLoginUA string `protobuf:"bytes,4,opt,name=lastLoginUA,proto3" json:"lastLoginUA,omitempty"` -} - -func (x *UserLoginRecordReq) Reset() { - *x = UserLoginRecordReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UserLoginRecordReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UserLoginRecordReq) ProtoMessage() {} - -func (x *UserLoginRecordReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UserLoginRecordReq.ProtoReflect.Descriptor instead. -func (*UserLoginRecordReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{14} -} - -func (x *UserLoginRecordReq) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *UserLoginRecordReq) GetLastLoginIp() string { - if x != nil { - return x.LastLoginIp - } - return "" -} - -func (x *UserLoginRecordReq) GetLastLoginDevice() string { - if x != nil { - return x.LastLoginDevice - } - return "" -} - -func (x *UserLoginRecordReq) GetLastLoginUA() string { - if x != nil { - return x.LastLoginUA - } - return "" -} - -// ModifyAccountReq 修改账户 -type ModifyAccountReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - PhoneNumber *string `protobuf:"bytes,2,opt,name=phoneNumber,proto3,oneof" json:"phoneNumber,omitempty"` - Email *string `protobuf:"bytes,3,opt,name=email,proto3,oneof" json:"email,omitempty"` - Username *string `protobuf:"bytes,4,opt,name=username,proto3,oneof" json:"username,omitempty"` -} - -func (x *ModifyAccountReq) Reset() { - *x = ModifyAccountReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ModifyAccountReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ModifyAccountReq) ProtoMessage() {} - -func (x *ModifyAccountReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use ModifyAccountReq.ProtoReflect.Descriptor instead. -func (*ModifyAccountReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{15} -} - -func (x *ModifyAccountReq) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *ModifyAccountReq) GetPhoneNumber() string { - if x != nil && x.PhoneNumber != nil { - return *x.PhoneNumber - } - return "" -} - -func (x *ModifyAccountReq) GetEmail() string { - if x != nil && x.Email != nil { - return *x.Email - } - return "" -} - -func (x *ModifyAccountReq) GetUsername() string { - if x != nil && x.Username != nil { - return *x.Username - } - return "" -} - -type BindSocialReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - Platform string `protobuf:"bytes,2,opt,name=platform,proto3" json:"platform,omitempty"` - Profile string `protobuf:"bytes,3,opt,name=profile,proto3" json:"profile,omitempty"` -} - -func (x *BindSocialReq) Reset() { - *x = BindSocialReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindSocialReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindSocialReq) ProtoMessage() {} - -func (x *BindSocialReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindSocialReq.ProtoReflect.Descriptor instead. -func (*BindSocialReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{16} -} - -func (x *BindSocialReq) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *BindSocialReq) GetPlatform() string { - if x != nil { - return x.Platform - } - return "" -} - -func (x *BindSocialReq) GetProfile() string { - if x != nil { - return x.Profile - } - return "" -} - -type BindSocialResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - SocialProfile string `protobuf:"bytes,2,opt,name=socialProfile,proto3" json:"socialProfile,omitempty"` -} - -func (x *BindSocialResp) Reset() { - *x = BindSocialResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindSocialResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindSocialResp) ProtoMessage() {} - -func (x *BindSocialResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindSocialResp.ProtoReflect.Descriptor instead. -func (*BindSocialResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{17} -} - -func (x *BindSocialResp) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *BindSocialResp) GetSocialProfile() string { - if x != nil { - return x.SocialProfile - } - return "" -} - -type CreateRoleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Code string `protobuf:"bytes,1,opt,name=code,proto3" json:"code,omitempty"` - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` - Desc string `protobuf:"bytes,3,opt,name=desc,proto3" json:"desc,omitempty"` -} - -func (x *CreateRoleReq) Reset() { - *x = CreateRoleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRoleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoleReq) ProtoMessage() {} - -func (x *CreateRoleReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRoleReq.ProtoReflect.Descriptor instead. -func (*CreateRoleReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{18} -} - -func (x *CreateRoleReq) GetCode() string { - if x != nil { - return x.Code - } - return "" -} - -func (x *CreateRoleReq) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -func (x *CreateRoleReq) GetDesc() string { - if x != nil { - return x.Desc - } - return "" -} - -type CreateRoleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *CreateRoleResp) Reset() { - *x = CreateRoleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateRoleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateRoleResp) ProtoMessage() {} - -func (x *CreateRoleResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use CreateRoleResp.ProtoReflect.Descriptor instead. -func (*CreateRoleResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{19} -} - -func (x *CreateRoleResp) GetRole() *Role { - if x != nil { - return x.Role - } - return nil -} - -type UpdateRoleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // - Name *string `protobuf:"bytes,2,opt,name=name,proto3,oneof" json:"name,omitempty"` - Desc *string `protobuf:"bytes,3,opt,name=desc,proto3,oneof" json:"desc,omitempty"` -} - -func (x *UpdateRoleReq) Reset() { - *x = UpdateRoleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[20] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRoleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRoleReq) ProtoMessage() {} - -func (x *UpdateRoleReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[20] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRoleReq.ProtoReflect.Descriptor instead. -func (*UpdateRoleReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{20} -} - -func (x *UpdateRoleReq) GetId() int64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *UpdateRoleReq) GetName() string { - if x != nil && x.Name != nil { - return *x.Name - } - return "" -} - -func (x *UpdateRoleReq) GetDesc() string { - if x != nil && x.Desc != nil { - return *x.Desc - } - return "" -} - -type UpdateRoleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *UpdateRoleResp) Reset() { - *x = UpdateRoleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[21] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UpdateRoleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UpdateRoleResp) ProtoMessage() {} - -func (x *UpdateRoleResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[21] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use UpdateRoleResp.ProtoReflect.Descriptor instead. -func (*UpdateRoleResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{21} -} - -func (x *UpdateRoleResp) GetRole() *Role { - if x != nil { - return x.Role - } - return nil -} - -type DeleteRoleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` -} - -func (x *DeleteRoleReq) Reset() { - *x = DeleteRoleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[22] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRoleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoleReq) ProtoMessage() {} - -func (x *DeleteRoleReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[22] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRoleReq.ProtoReflect.Descriptor instead. -func (*DeleteRoleReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{22} -} - -func (x *DeleteRoleReq) GetIds() []int64 { - if x != nil { - return x.Ids - } - return nil -} - -type DeleteRoleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Ids []int64 `protobuf:"varint,1,rep,packed,name=ids,proto3" json:"ids,omitempty"` -} - -func (x *DeleteRoleResp) Reset() { - *x = DeleteRoleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[23] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeleteRoleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeleteRoleResp) ProtoMessage() {} - -func (x *DeleteRoleResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[23] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use DeleteRoleResp.ProtoReflect.Descriptor instead. -func (*DeleteRoleResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{23} -} - -func (x *DeleteRoleResp) GetIds() []int64 { - if x != nil { - return x.Ids - } - return nil -} - -type GetRoleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Id *int64 `protobuf:"varint,1,opt,name=id,proto3,oneof" json:"id,omitempty"` - Code *string `protobuf:"bytes,2,opt,name=code,proto3,oneof" json:"code,omitempty"` -} - -func (x *GetRoleReq) Reset() { - *x = GetRoleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[24] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleReq) ProtoMessage() {} - -func (x *GetRoleReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[24] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRoleReq.ProtoReflect.Descriptor instead. -func (*GetRoleReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{24} -} - -func (x *GetRoleReq) GetId() int64 { - if x != nil && x.Id != nil { - return *x.Id - } - return 0 -} - -func (x *GetRoleReq) GetCode() string { - if x != nil && x.Code != nil { - return *x.Code - } - return "" -} - -type GetRoleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Role *Role `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` -} - -func (x *GetRoleResp) Reset() { - *x = GetRoleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[25] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *GetRoleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*GetRoleResp) ProtoMessage() {} - -func (x *GetRoleResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[25] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use GetRoleResp.ProtoReflect.Descriptor instead. -func (*GetRoleResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{25} -} - -func (x *GetRoleResp) GetRole() *Role { - if x != nil { - return x.Role - } - return nil -} - -type BindUserReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RoleId int64 `protobuf:"varint,1,opt,name=roleId,proto3" json:"roleId,omitempty"` - UserIds []int64 `protobuf:"varint,2,rep,packed,name=userIds,proto3" json:"userIds,omitempty"` -} - -func (x *BindUserReq) Reset() { - *x = BindUserReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[26] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindUserReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindUserReq) ProtoMessage() {} - -func (x *BindUserReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[26] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindUserReq.ProtoReflect.Descriptor instead. -func (*BindUserReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{26} -} - -func (x *BindUserReq) GetRoleId() int64 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *BindUserReq) GetUserIds() []int64 { - if x != nil { - return x.UserIds - } - return nil -} - -type BindUserResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - RoleId int64 `protobuf:"varint,1,opt,name=roleId,proto3" json:"roleId,omitempty"` - UserId []int64 `protobuf:"varint,2,rep,packed,name=userId,proto3" json:"userId,omitempty"` -} - -func (x *BindUserResp) Reset() { - *x = BindUserResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[27] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindUserResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindUserResp) ProtoMessage() {} - -func (x *BindUserResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[27] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindUserResp.ProtoReflect.Descriptor instead. -func (*BindUserResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{27} -} - -func (x *BindUserResp) GetRoleId() int64 { - if x != nil { - return x.RoleId - } - return 0 -} - -func (x *BindUserResp) GetUserId() []int64 { - if x != nil { - return x.UserId - } - return nil -} - -type BindRoleReq struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - RoleIds []int64 `protobuf:"varint,2,rep,packed,name=roleIds,proto3" json:"roleIds,omitempty"` -} - -func (x *BindRoleReq) Reset() { - *x = BindRoleReq{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[28] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindRoleReq) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindRoleReq) ProtoMessage() {} - -func (x *BindRoleReq) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[28] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindRoleReq.ProtoReflect.Descriptor instead. -func (*BindRoleReq) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{28} -} - -func (x *BindRoleReq) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *BindRoleReq) GetRoleIds() []int64 { - if x != nil { - return x.RoleIds - } - return nil -} - -type BindRoleResp struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - UserId int64 `protobuf:"varint,1,opt,name=userId,proto3" json:"userId,omitempty"` - RoleIds []int64 `protobuf:"varint,2,rep,packed,name=roleIds,proto3" json:"roleIds,omitempty"` -} - -func (x *BindRoleResp) Reset() { - *x = BindRoleResp{} - if protoimpl.UnsafeEnabled { - mi := &file_rpc_pb_user_center_proto_msgTypes[29] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BindRoleResp) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BindRoleResp) ProtoMessage() {} - -func (x *BindRoleResp) ProtoReflect() protoreflect.Message { - mi := &file_rpc_pb_user_center_proto_msgTypes[29] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use BindRoleResp.ProtoReflect.Descriptor instead. -func (*BindRoleResp) Descriptor() ([]byte, []int) { - return file_rpc_pb_user_center_proto_rawDescGZIP(), []int{29} -} - -func (x *BindRoleResp) GetUserId() int64 { - if x != nil { - return x.UserId - } - return 0 -} - -func (x *BindRoleResp) GetRoleIds() []int64 { - if x != nil { - return x.RoleIds - } - return nil -} - -var File_rpc_pb_user_center_proto protoreflect.FileDescriptor - -var file_rpc_pb_user_center_proto_rawDesc = []byte{ - 0x0a, 0x18, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x62, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x63, 0x65, - 0x6e, 0x74, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x02, 0x70, 0x62, 0x22, 0xcc, - 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6e, - 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, - 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, - 0x1c, 0x0a, 0x09, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x12, 0x18, 0x0a, - 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x0b, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x03, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x72, 0x79, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0d, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, 0xcf, 0x01, - 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, - 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x41, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x6c, - 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x12, 0x28, 0x0a, - 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, - 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x41, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, - 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x41, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x22, - 0x52, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, - 0x65, 0x73, 0x63, 0x22, 0x0e, 0x0a, 0x0c, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x22, 0x21, 0x0a, 0x0d, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x6d, 0x73, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x03, 0x6d, 0x73, 0x67, 0x22, 0xac, 0x04, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x01, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, - 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, - 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, - 0x01, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x05, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x69, - 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x08, - 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x67, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x07, 0x52, 0x06, 0x67, - 0x65, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x09, 0x62, 0x69, 0x72, 0x74, - 0x68, 0x64, 0x61, 0x74, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x08, 0x52, 0x09, 0x62, - 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09, 0x48, 0x09, 0x52, 0x07, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, 0x12, 0x15, 0x0a, 0x03, 0x61, 0x67, - 0x65, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x03, 0x48, 0x0a, 0x52, 0x03, 0x61, 0x67, 0x65, 0x88, 0x01, - 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x0b, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x88, 0x01, 0x01, - 0x12, 0x1d, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x0d, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x0c, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x42, - 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, - 0x62, 0x65, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0b, 0x0a, - 0x09, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, - 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, - 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x61, 0x67, 0x65, 0x42, 0x0a, 0x0a, - 0x08, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x69, - 0x63, 0x74, 0x75, 0x72, 0x65, 0x22, 0x2e, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, - 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xe8, 0x02, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, - 0x12, 0x1f, 0x0a, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x01, 0x52, 0x08, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, - 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, - 0x03, 0x48, 0x02, 0x52, 0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x21, - 0x0a, 0x09, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x03, 0x52, 0x09, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x74, 0x65, 0x88, 0x01, - 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x04, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x88, 0x01, 0x01, - 0x12, 0x15, 0x0a, 0x03, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x03, 0x48, 0x05, 0x52, - 0x03, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x72, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x48, 0x06, 0x52, 0x07, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x72, 0x79, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, - 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x48, 0x07, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, - 0x72, 0x65, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x6e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, - 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x62, 0x69, 0x72, 0x74, 0x68, - 0x64, 0x61, 0x74, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x61, 0x67, 0x65, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, - 0x22, 0x2e, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, - 0x22, 0x21, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, - 0x71, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, - 0x69, 0x64, 0x73, 0x22, 0x22, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, - 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, - 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, 0xb2, 0x01, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x55, - 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x03, 0x48, 0x00, 0x52, 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, - 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x25, 0x0a, 0x0b, - 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x48, 0x02, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x48, 0x03, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x88, 0x01, 0x01, 0x42, 0x05, - 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, - 0x6d, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, - 0x65, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x22, 0x44, 0x0a, 0x12, - 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x12, - 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, - 0x69, 0x64, 0x22, 0x2b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, - 0x9a, 0x01, 0x0a, 0x12, 0x55, 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x63, - 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x20, - 0x0a, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x49, 0x70, - 0x12, 0x28, 0x0a, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x44, 0x65, 0x76, - 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x61, 0x73, 0x74, 0x4c, - 0x6f, 0x67, 0x69, 0x6e, 0x44, 0x65, 0x76, 0x69, 0x63, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x6c, 0x61, - 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x41, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x6c, 0x61, 0x73, 0x74, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x41, 0x22, 0xac, 0x01, 0x0a, - 0x10, 0x4d, 0x6f, 0x64, 0x69, 0x66, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, - 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, - 0x64, 0x12, 0x25, 0x0a, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, - 0x75, 0x6d, 0x62, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, - 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, - 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, - 0x65, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x68, 0x6f, 0x6e, 0x65, 0x4e, 0x75, - 0x6d, 0x62, 0x65, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x42, 0x0b, - 0x0a, 0x09, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x55, 0x0a, 0x0d, 0x42, - 0x69, 0x6e, 0x64, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x66, - 0x69, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x66, 0x69, - 0x6c, 0x65, 0x22, 0x46, 0x0a, 0x0e, 0x42, 0x69, 0x6e, 0x64, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, - 0x52, 0x02, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x73, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x50, 0x72, - 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x63, - 0x69, 0x61, 0x6c, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x22, 0x4b, 0x0a, 0x0d, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x12, 0x0a, 0x04, 0x63, - 0x6f, 0x64, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x22, 0x2e, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, 0x0a, 0x04, 0x72, 0x6f, 0x6c, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, 0x62, 0x2e, 0x52, 0x6f, 0x6c, - 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x63, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x88, 0x01, - 0x01, 0x12, 0x17, 0x0a, 0x04, 0x64, 0x65, 0x73, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, - 0x01, 0x52, 0x04, 0x64, 0x65, 0x73, 0x63, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x6e, - 0x61, 0x6d, 0x65, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x64, 0x65, 0x73, 0x63, 0x22, 0x2e, 0x0a, 0x0e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x21, 0x0a, 0x0d, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x10, 0x0a, - 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, 0x69, 0x64, 0x73, 0x22, - 0x22, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x03, 0x52, 0x03, - 0x69, 0x64, 0x73, 0x22, 0x4a, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, - 0x71, 0x12, 0x13, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, - 0x02, 0x69, 0x64, 0x88, 0x01, 0x01, 0x12, 0x17, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x88, 0x01, 0x01, 0x42, - 0x05, 0x0a, 0x03, 0x5f, 0x69, 0x64, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x22, - 0x2b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x1c, - 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x70, - 0x62, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x3f, 0x0a, 0x0b, - 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x72, - 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, 0x6f, 0x6c, - 0x65, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x18, 0x02, - 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x73, 0x22, 0x3e, 0x0a, - 0x0c, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, 0x0a, - 0x06, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x72, - 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x3f, 0x0a, - 0x0b, 0x42, 0x69, 0x6e, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, 0x22, 0x40, - 0x0a, 0x0c, 0x42, 0x69, 0x6e, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x16, - 0x0a, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x03, 0x52, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x49, 0x64, 0x73, - 0x32, 0xea, 0x05, 0x0a, 0x0a, 0x75, 0x73, 0x65, 0x72, 0x43, 0x65, 0x6e, 0x74, 0x65, 0x72, 0x12, - 0x33, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, - 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, - 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, - 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0a, 0x64, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, - 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2a, - 0x0a, 0x07, 0x67, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, - 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3a, 0x0a, 0x0f, 0x67, 0x65, - 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x12, 0x16, 0x2e, - 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x42, 0x79, 0x53, 0x6f, 0x63, 0x69, - 0x61, 0x6c, 0x52, 0x65, 0x71, 0x1a, 0x0f, 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, - 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x12, 0x39, 0x0a, 0x0d, 0x6d, 0x6f, 0x64, 0x69, 0x66, 0x79, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x14, 0x2e, 0x70, 0x62, 0x2e, 0x4d, 0x6f, 0x64, - 0x69, 0x66, 0x79, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, - 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x33, 0x0a, 0x0a, 0x62, 0x69, 0x6e, 0x64, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x12, - 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x53, 0x6f, 0x63, 0x69, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x53, 0x6f, 0x63, 0x69, - 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x12, 0x3c, 0x0a, 0x0f, 0x75, 0x73, 0x65, 0x72, 0x4c, 0x6f, - 0x67, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x12, 0x16, 0x2e, 0x70, 0x62, 0x2e, 0x55, - 0x73, 0x65, 0x72, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x52, 0x65, - 0x71, 0x1a, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x12, 0x33, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6c, 0x65, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, - 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, 0x0a, 0x0a, 0x75, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x11, 0x2e, 0x70, 0x62, 0x2e, 0x55, 0x70, 0x64, - 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x12, 0x2e, 0x70, 0x62, 0x2e, - 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x33, - 0x0a, 0x0a, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x11, 0x2e, 0x70, - 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, - 0x12, 0x2e, 0x70, 0x62, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x12, 0x2a, 0x0a, 0x07, 0x67, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0e, - 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0f, - 0x2e, 0x70, 0x62, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, - 0x2d, 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0f, 0x2e, 0x70, 0x62, - 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, - 0x62, 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, - 0x0a, 0x08, 0x62, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0f, 0x2e, 0x70, 0x62, 0x2e, - 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x70, 0x62, - 0x2e, 0x42, 0x69, 0x6e, 0x64, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, - 0x04, 0x2e, 0x2f, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_rpc_pb_user_center_proto_rawDescOnce sync.Once - file_rpc_pb_user_center_proto_rawDescData = file_rpc_pb_user_center_proto_rawDesc -) - -func file_rpc_pb_user_center_proto_rawDescGZIP() []byte { - file_rpc_pb_user_center_proto_rawDescOnce.Do(func() { - file_rpc_pb_user_center_proto_rawDescData = protoimpl.X.CompressGZIP(file_rpc_pb_user_center_proto_rawDescData) - }) - return file_rpc_pb_user_center_proto_rawDescData -} - -var file_rpc_pb_user_center_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_rpc_pb_user_center_proto_goTypes = []interface{}{ - (*User)(nil), // 0: pb.User - (*UserLoginRecord)(nil), // 1: pb.UserLoginRecord - (*Role)(nil), // 2: pb.Role - (*EmptyMessage)(nil), // 3: pb.EmptyMessage - (*SimpleMessage)(nil), // 4: pb.SimpleMessage - (*CreateUserReq)(nil), // 5: pb.CreateUserReq - (*CreateUserResp)(nil), // 6: pb.CreateUserResp - (*UpdateUserReq)(nil), // 7: pb.UpdateUserReq - (*UpdateUserResp)(nil), // 8: pb.UpdateUserResp - (*DeleteUserReq)(nil), // 9: pb.DeleteUserReq - (*DeleteUserResp)(nil), // 10: pb.DeleteUserResp - (*GetUserReq)(nil), // 11: pb.GetUserReq - (*GetUserBySocialReq)(nil), // 12: pb.GetUserBySocialReq - (*GetUserResp)(nil), // 13: pb.GetUserResp - (*UserLoginRecordReq)(nil), // 14: pb.UserLoginRecordReq - (*ModifyAccountReq)(nil), // 15: pb.ModifyAccountReq - (*BindSocialReq)(nil), // 16: pb.BindSocialReq - (*BindSocialResp)(nil), // 17: pb.BindSocialResp - (*CreateRoleReq)(nil), // 18: pb.CreateRoleReq - (*CreateRoleResp)(nil), // 19: pb.CreateRoleResp - (*UpdateRoleReq)(nil), // 20: pb.UpdateRoleReq - (*UpdateRoleResp)(nil), // 21: pb.UpdateRoleResp - (*DeleteRoleReq)(nil), // 22: pb.DeleteRoleReq - (*DeleteRoleResp)(nil), // 23: pb.DeleteRoleResp - (*GetRoleReq)(nil), // 24: pb.GetRoleReq - (*GetRoleResp)(nil), // 25: pb.GetRoleResp - (*BindUserReq)(nil), // 26: pb.BindUserReq - (*BindUserResp)(nil), // 27: pb.BindUserResp - (*BindRoleReq)(nil), // 28: pb.BindRoleReq - (*BindRoleResp)(nil), // 29: pb.BindRoleResp -} -var file_rpc_pb_user_center_proto_depIdxs = []int32{ - 0, // 0: pb.CreateUserResp.user:type_name -> pb.User - 0, // 1: pb.UpdateUserResp.user:type_name -> pb.User - 0, // 2: pb.GetUserResp.user:type_name -> pb.User - 2, // 3: pb.CreateRoleResp.role:type_name -> pb.Role - 2, // 4: pb.UpdateRoleResp.role:type_name -> pb.Role - 2, // 5: pb.GetRoleResp.role:type_name -> pb.Role - 5, // 6: pb.userCenter.createUser:input_type -> pb.CreateUserReq - 7, // 7: pb.userCenter.updateUser:input_type -> pb.UpdateUserReq - 9, // 8: pb.userCenter.deleteUser:input_type -> pb.DeleteUserReq - 11, // 9: pb.userCenter.getUser:input_type -> pb.GetUserReq - 12, // 10: pb.userCenter.getUserBySocial:input_type -> pb.GetUserBySocialReq - 15, // 11: pb.userCenter.modifyAccount:input_type -> pb.ModifyAccountReq - 16, // 12: pb.userCenter.bindSocial:input_type -> pb.BindSocialReq - 14, // 13: pb.userCenter.userLoginRecord:input_type -> pb.UserLoginRecordReq - 18, // 14: pb.userCenter.createRole:input_type -> pb.CreateRoleReq - 20, // 15: pb.userCenter.updateRole:input_type -> pb.UpdateRoleReq - 22, // 16: pb.userCenter.deleteRole:input_type -> pb.DeleteRoleReq - 24, // 17: pb.userCenter.getRole:input_type -> pb.GetRoleReq - 28, // 18: pb.userCenter.bindRole:input_type -> pb.BindRoleReq - 26, // 19: pb.userCenter.bindUser:input_type -> pb.BindUserReq - 6, // 20: pb.userCenter.createUser:output_type -> pb.CreateUserResp - 8, // 21: pb.userCenter.updateUser:output_type -> pb.UpdateUserResp - 10, // 22: pb.userCenter.deleteUser:output_type -> pb.DeleteUserResp - 13, // 23: pb.userCenter.getUser:output_type -> pb.GetUserResp - 13, // 24: pb.userCenter.getUserBySocial:output_type -> pb.GetUserResp - 8, // 25: pb.userCenter.modifyAccount:output_type -> pb.UpdateUserResp - 17, // 26: pb.userCenter.bindSocial:output_type -> pb.BindSocialResp - 4, // 27: pb.userCenter.userLoginRecord:output_type -> pb.SimpleMessage - 19, // 28: pb.userCenter.createRole:output_type -> pb.CreateRoleResp - 21, // 29: pb.userCenter.updateRole:output_type -> pb.UpdateRoleResp - 23, // 30: pb.userCenter.deleteRole:output_type -> pb.DeleteRoleResp - 25, // 31: pb.userCenter.getRole:output_type -> pb.GetRoleResp - 29, // 32: pb.userCenter.bindRole:output_type -> pb.BindRoleResp - 27, // 33: pb.userCenter.bindUser:output_type -> pb.BindUserResp - 20, // [20:34] is the sub-list for method output_type - 6, // [6:20] is the sub-list for method input_type - 6, // [6:6] is the sub-list for extension type_name - 6, // [6:6] is the sub-list for extension extendee - 0, // [0:6] is the sub-list for field type_name -} - -func init() { file_rpc_pb_user_center_proto_init() } -func file_rpc_pb_user_center_proto_init() { - if File_rpc_pb_user_center_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_rpc_pb_user_center_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*User); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLoginRecord); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Role); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*EmptyMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SimpleMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserBySocialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetUserResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserLoginRecordReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ModifyAccountReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindSocialReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindSocialResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRoleReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateRoleResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRoleReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UpdateRoleResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRoleReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeleteRoleResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*GetRoleResp); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindUserReq); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_rpc_pb_user_center_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindUserResp); i { + if !protoimpl.UnsafeEnabled { + file_user_center_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*User); i { case 0: return &v.state case 1: @@ -2612,8 +298,8 @@ func file_rpc_pb_user_center_proto_init() { return nil } } - file_rpc_pb_user_center_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindRoleReq); i { + file_user_center_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlatformUserReq); i { case 0: return &v.state case 1: @@ -2624,8 +310,8 @@ func file_rpc_pb_user_center_proto_init() { return nil } } - file_rpc_pb_user_center_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BindRoleResp); i { + file_user_center_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*PlatformUserResp); i { case 0: return &v.state case 1: @@ -2637,28 +323,22 @@ func file_rpc_pb_user_center_proto_init() { } } } - file_rpc_pb_user_center_proto_msgTypes[5].OneofWrappers = []interface{}{} - file_rpc_pb_user_center_proto_msgTypes[7].OneofWrappers = []interface{}{} - file_rpc_pb_user_center_proto_msgTypes[11].OneofWrappers = []interface{}{} - file_rpc_pb_user_center_proto_msgTypes[15].OneofWrappers = []interface{}{} - file_rpc_pb_user_center_proto_msgTypes[20].OneofWrappers = []interface{}{} - file_rpc_pb_user_center_proto_msgTypes[24].OneofWrappers = []interface{}{} type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_rpc_pb_user_center_proto_rawDesc, + RawDescriptor: file_user_center_proto_rawDesc, NumEnums: 0, - NumMessages: 30, + NumMessages: 3, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_rpc_pb_user_center_proto_goTypes, - DependencyIndexes: file_rpc_pb_user_center_proto_depIdxs, - MessageInfos: file_rpc_pb_user_center_proto_msgTypes, + GoTypes: file_user_center_proto_goTypes, + DependencyIndexes: file_user_center_proto_depIdxs, + MessageInfos: file_user_center_proto_msgTypes, }.Build() - File_rpc_pb_user_center_proto = out.File - file_rpc_pb_user_center_proto_rawDesc = nil - file_rpc_pb_user_center_proto_goTypes = nil - file_rpc_pb_user_center_proto_depIdxs = nil + File_user_center_proto = out.File + file_user_center_proto_rawDesc = nil + file_user_center_proto_goTypes = nil + file_user_center_proto_depIdxs = nil } diff --git a/app/user_center/rpc/pb/user_center.proto b/app/user_center/rpc/pb/user_center.proto index a9cc4e6..2ffe8a0 100644 --- a/app/user_center/rpc/pb/user_center.proto +++ b/app/user_center/rpc/pb/user_center.proto @@ -8,221 +8,26 @@ option go_package = "./pb"; message User { int64 id = 1; string username = 2; - string phoneNumber = 3; - string email = 4; - string password = 5; - // profile - string name = 6; - string nickname = 7; - int64 gender = 8; - string birthdate = 9; - string address = 10; - int32 age = 11; - string country = 12; - string picture = 13; + // platform + string platform = 3; + string pUid = 4; + string pUname = 5; + string pAvatar = 6; + string pInfo = 7; } -message UserLoginRecord { - int64 userId = 1; - string lastLoginAt = 2; - string lastLoginIp = 3; - string lastLoginDevice = 4; - string lastLoginUA = 5; - string count = 6; +// req +message PlatformUserReq { + string platform = 1; + string pUid = 2; } -message Role { - int64 id = 1; - string code = 2; - string name = 3; - string desc = 4; -} - -message EmptyMessage { -} - -message SimpleMessage { - string msg = 1; -} - -/////////////////////////////// user /////////////////////////////////// - -message CreateUserReq { - optional int64 id = 1; - optional string username = 2; - optional string phoneNumber = 3; - optional string email = 4; - optional string password = 5; - // profile - optional string name = 6; - optional string nickname = 7; - optional int64 gender = 8; - optional string birthdate = 9; - optional string address = 10; - optional int64 age = 11; - optional string country = 12; - optional string picture = 13; -} - -message CreateUserResp { +message PlatformUserResp { User user = 1; } -message UpdateUserReq { - int64 id = 1; - // profile - optional string name = 2; - optional string nickname = 3; - optional int64 gender = 4; - optional string birthdate = 5; - optional string address = 6; - optional int64 age = 7; - optional string country = 8; - optional string picture = 9; -} - -message UpdateUserResp { - User user = 1; -} - -message DeleteUserReq { - repeated int64 ids = 1; -} - -message DeleteUserResp { - repeated int64 ids = 1; -} - -message GetUserReq { - optional int64 id = 1; - optional string username = 2; - optional string phoneNumber = 3; - optional string email = 4; -} - -message GetUserBySocialReq { - string platform = 1; // 平台类型 - string uuid = 2; // platform: openid | unionid -} - -message GetUserResp { - User user = 1; -} - -/////////////////////////////// user login record /////////////////////////////////// - -message UserLoginRecordReq { - int64 userId = 1; - string lastLoginIp = 2; - string lastLoginDevice = 3; - string lastLoginUA = 4; -} - -/////////////////////////////// phone | email | ?username? /////////////////////////////////// - -// ModifyAccountReq 修改账户 -message ModifyAccountReq { - int64 id = 1; - optional string phoneNumber = 2; - optional string email = 3; - optional string username = 4; -} - -/////////////////////////////// social_profile /////////////////////////////////// - -message BindSocialReq { - int64 id = 1; - string platform = 2; - string profile = 3; -} - -message BindSocialResp { - int64 id = 1; - string socialProfile = 2; -} - -/////////////////////////////// role /////////////////////////////////// - -message CreateRoleReq { - string code = 1; - string name = 2; - string desc = 3; -} - -message CreateRoleResp { - Role role = 1; -} - -message UpdateRoleReq { - int64 id = 1; - // - optional string name = 2; - optional string desc = 3; -} - -message UpdateRoleResp { - Role role = 1; -} - -message DeleteRoleReq { - repeated int64 ids = 1; -} - -message DeleteRoleResp { - repeated int64 ids = 1; -} - -message GetRoleReq { - optional int64 id = 1; - optional string code = 2; -} - -message GetRoleResp { - Role role = 1; -} - -/////////////////////////////// user-relationship /////////////////////////////////// - -message BindUserReq { - int64 roleId = 1; - repeated int64 userIds = 2; -} - -message BindUserResp { - int64 roleId = 1; - repeated int64 userId = 2; -} - -message BindRoleReq { - int64 userId = 1; - repeated int64 roleIds = 2; -} - -message BindRoleResp { - int64 userId = 1; - repeated int64 roleIds = 2; -} service userCenter { // user - rpc createUser(CreateUserReq) returns (CreateUserResp); - rpc updateUser(UpdateUserReq) returns (UpdateUserResp); - rpc deleteUser(DeleteUserReq) returns (DeleteUserResp); - rpc getUser(GetUserReq) returns (GetUserResp); - rpc getUserBySocial(GetUserBySocialReq) returns (GetUserResp); - // user-biz - rpc modifyAccount(ModifyAccountReq) returns (UpdateUserResp); - rpc bindSocial(BindSocialReq) returns (BindSocialResp); - // user login record - rpc userLoginRecord(UserLoginRecordReq) returns (SimpleMessage); - - // role - rpc createRole(CreateRoleReq) returns (CreateRoleResp); - rpc updateRole(UpdateRoleReq) returns (UpdateRoleResp); - rpc deleteRole(DeleteRoleReq) returns (DeleteRoleResp); - rpc getRole(GetRoleReq) returns (GetRoleResp); - - // relationship - rpc bindRole(BindRoleReq) returns (BindRoleResp); - rpc bindUser(BindUserReq) returns (BindUserResp); + rpc retrievePlatformUser(PlatformUserReq) returns (PlatformUserResp); } \ No newline at end of file diff --git a/app/user_center/rpc/pb/user_center_grpc.pb.go b/app/user_center/rpc/pb/user_center_grpc.pb.go index 4f0c56e..dbb0ad5 100644 --- a/app/user_center/rpc/pb/user_center_grpc.pb.go +++ b/app/user_center/rpc/pb/user_center_grpc.pb.go @@ -2,7 +2,7 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc v3.19.4 -// source: rpc/pb/user_center.proto +// source: gift.proto package pb @@ -23,24 +23,7 @@ const _ = grpc.SupportPackageIsVersion7 // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. type UserCenterClient interface { // user - CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*CreateUserResp, error) - UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*UpdateUserResp, error) - DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) - GetUser(ctx context.Context, in *GetUserReq, opts ...grpc.CallOption) (*GetUserResp, error) - GetUserBySocial(ctx context.Context, in *GetUserBySocialReq, opts ...grpc.CallOption) (*GetUserResp, error) - // user-biz - ModifyAccount(ctx context.Context, in *ModifyAccountReq, opts ...grpc.CallOption) (*UpdateUserResp, error) - BindSocial(ctx context.Context, in *BindSocialReq, opts ...grpc.CallOption) (*BindSocialResp, error) - // user login record - UserLoginRecord(ctx context.Context, in *UserLoginRecordReq, opts ...grpc.CallOption) (*SimpleMessage, error) - // role - CreateRole(ctx context.Context, in *CreateRoleReq, opts ...grpc.CallOption) (*CreateRoleResp, error) - UpdateRole(ctx context.Context, in *UpdateRoleReq, opts ...grpc.CallOption) (*UpdateRoleResp, error) - DeleteRole(ctx context.Context, in *DeleteRoleReq, opts ...grpc.CallOption) (*DeleteRoleResp, error) - GetRole(ctx context.Context, in *GetRoleReq, opts ...grpc.CallOption) (*GetRoleResp, error) - // relationship - BindRole(ctx context.Context, in *BindRoleReq, opts ...grpc.CallOption) (*BindRoleResp, error) - BindUser(ctx context.Context, in *BindUserReq, opts ...grpc.CallOption) (*BindUserResp, error) + RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) } type userCenterClient struct { @@ -51,126 +34,9 @@ func NewUserCenterClient(cc grpc.ClientConnInterface) UserCenterClient { return &userCenterClient{cc} } -func (c *userCenterClient) CreateUser(ctx context.Context, in *CreateUserReq, opts ...grpc.CallOption) (*CreateUserResp, error) { - out := new(CreateUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/createUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) UpdateUser(ctx context.Context, in *UpdateUserReq, opts ...grpc.CallOption) (*UpdateUserResp, error) { - out := new(UpdateUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/updateUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) DeleteUser(ctx context.Context, in *DeleteUserReq, opts ...grpc.CallOption) (*DeleteUserResp, error) { - out := new(DeleteUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/deleteUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) GetUser(ctx context.Context, in *GetUserReq, opts ...grpc.CallOption) (*GetUserResp, error) { - out := new(GetUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/getUser", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) GetUserBySocial(ctx context.Context, in *GetUserBySocialReq, opts ...grpc.CallOption) (*GetUserResp, error) { - out := new(GetUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/getUserBySocial", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) ModifyAccount(ctx context.Context, in *ModifyAccountReq, opts ...grpc.CallOption) (*UpdateUserResp, error) { - out := new(UpdateUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/modifyAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) BindSocial(ctx context.Context, in *BindSocialReq, opts ...grpc.CallOption) (*BindSocialResp, error) { - out := new(BindSocialResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/bindSocial", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) UserLoginRecord(ctx context.Context, in *UserLoginRecordReq, opts ...grpc.CallOption) (*SimpleMessage, error) { - out := new(SimpleMessage) - err := c.cc.Invoke(ctx, "/pb.userCenter/userLoginRecord", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) CreateRole(ctx context.Context, in *CreateRoleReq, opts ...grpc.CallOption) (*CreateRoleResp, error) { - out := new(CreateRoleResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/createRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) UpdateRole(ctx context.Context, in *UpdateRoleReq, opts ...grpc.CallOption) (*UpdateRoleResp, error) { - out := new(UpdateRoleResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/updateRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) DeleteRole(ctx context.Context, in *DeleteRoleReq, opts ...grpc.CallOption) (*DeleteRoleResp, error) { - out := new(DeleteRoleResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/deleteRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) GetRole(ctx context.Context, in *GetRoleReq, opts ...grpc.CallOption) (*GetRoleResp, error) { - out := new(GetRoleResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/getRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) BindRole(ctx context.Context, in *BindRoleReq, opts ...grpc.CallOption) (*BindRoleResp, error) { - out := new(BindRoleResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/bindRole", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *userCenterClient) BindUser(ctx context.Context, in *BindUserReq, opts ...grpc.CallOption) (*BindUserResp, error) { - out := new(BindUserResp) - err := c.cc.Invoke(ctx, "/pb.userCenter/bindUser", in, out, opts...) +func (c *userCenterClient) RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) { + out := new(PlatformUserResp) + err := c.cc.Invoke(ctx, "/pb.userCenter/retrievePlatformUser", in, out, opts...) if err != nil { return nil, err } @@ -182,24 +48,7 @@ func (c *userCenterClient) BindUser(ctx context.Context, in *BindUserReq, opts . // for forward compatibility type UserCenterServer interface { // user - CreateUser(context.Context, *CreateUserReq) (*CreateUserResp, error) - UpdateUser(context.Context, *UpdateUserReq) (*UpdateUserResp, error) - DeleteUser(context.Context, *DeleteUserReq) (*DeleteUserResp, error) - GetUser(context.Context, *GetUserReq) (*GetUserResp, error) - GetUserBySocial(context.Context, *GetUserBySocialReq) (*GetUserResp, error) - // user-biz - ModifyAccount(context.Context, *ModifyAccountReq) (*UpdateUserResp, error) - BindSocial(context.Context, *BindSocialReq) (*BindSocialResp, error) - // user login record - UserLoginRecord(context.Context, *UserLoginRecordReq) (*SimpleMessage, error) - // role - CreateRole(context.Context, *CreateRoleReq) (*CreateRoleResp, error) - UpdateRole(context.Context, *UpdateRoleReq) (*UpdateRoleResp, error) - DeleteRole(context.Context, *DeleteRoleReq) (*DeleteRoleResp, error) - GetRole(context.Context, *GetRoleReq) (*GetRoleResp, error) - // relationship - BindRole(context.Context, *BindRoleReq) (*BindRoleResp, error) - BindUser(context.Context, *BindUserReq) (*BindUserResp, error) + RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) mustEmbedUnimplementedUserCenterServer() } @@ -207,47 +56,8 @@ type UserCenterServer interface { type UnimplementedUserCenterServer struct { } -func (UnimplementedUserCenterServer) CreateUser(context.Context, *CreateUserReq) (*CreateUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented") -} -func (UnimplementedUserCenterServer) UpdateUser(context.Context, *UpdateUserReq) (*UpdateUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented") -} -func (UnimplementedUserCenterServer) DeleteUser(context.Context, *DeleteUserReq) (*DeleteUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented") -} -func (UnimplementedUserCenterServer) GetUser(context.Context, *GetUserReq) (*GetUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented") -} -func (UnimplementedUserCenterServer) GetUserBySocial(context.Context, *GetUserBySocialReq) (*GetUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetUserBySocial not implemented") -} -func (UnimplementedUserCenterServer) ModifyAccount(context.Context, *ModifyAccountReq) (*UpdateUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method ModifyAccount not implemented") -} -func (UnimplementedUserCenterServer) BindSocial(context.Context, *BindSocialReq) (*BindSocialResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method BindSocial not implemented") -} -func (UnimplementedUserCenterServer) UserLoginRecord(context.Context, *UserLoginRecordReq) (*SimpleMessage, error) { - return nil, status.Errorf(codes.Unimplemented, "method UserLoginRecord not implemented") -} -func (UnimplementedUserCenterServer) CreateRole(context.Context, *CreateRoleReq) (*CreateRoleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented") -} -func (UnimplementedUserCenterServer) UpdateRole(context.Context, *UpdateRoleReq) (*UpdateRoleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateRole not implemented") -} -func (UnimplementedUserCenterServer) DeleteRole(context.Context, *DeleteRoleReq) (*DeleteRoleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method DeleteRole not implemented") -} -func (UnimplementedUserCenterServer) GetRole(context.Context, *GetRoleReq) (*GetRoleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented") -} -func (UnimplementedUserCenterServer) BindRole(context.Context, *BindRoleReq) (*BindRoleResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method BindRole not implemented") -} -func (UnimplementedUserCenterServer) BindUser(context.Context, *BindUserReq) (*BindUserResp, error) { - return nil, status.Errorf(codes.Unimplemented, "method BindUser not implemented") +func (UnimplementedUserCenterServer) RetrievePlatformUser(context.Context, *PlatformUserReq) (*PlatformUserResp, error) { + return nil, status.Errorf(codes.Unimplemented, "method RetrievePlatformUser not implemented") } func (UnimplementedUserCenterServer) mustEmbedUnimplementedUserCenterServer() {} @@ -262,254 +72,20 @@ func RegisterUserCenterServer(s grpc.ServiceRegistrar, srv UserCenterServer) { s.RegisterService(&UserCenter_ServiceDesc, srv) } -func _UserCenter_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).CreateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/createUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).CreateUser(ctx, req.(*CreateUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).UpdateUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/updateUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).UpdateUser(ctx, req.(*UpdateUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).DeleteUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/deleteUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).DeleteUser(ctx, req.(*DeleteUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).GetUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/getUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).GetUser(ctx, req.(*GetUserReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_GetUserBySocial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetUserBySocialReq) +func _UserCenter_RetrievePlatformUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(PlatformUserReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(UserCenterServer).GetUserBySocial(ctx, in) + return srv.(UserCenterServer).RetrievePlatformUser(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/pb.userCenter/getUserBySocial", + FullMethod: "/pb.userCenter/retrievePlatformUser", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).GetUserBySocial(ctx, req.(*GetUserBySocialReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_ModifyAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(ModifyAccountReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).ModifyAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/modifyAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).ModifyAccount(ctx, req.(*ModifyAccountReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_BindSocial_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BindSocialReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).BindSocial(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/bindSocial", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).BindSocial(ctx, req.(*BindSocialReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_UserLoginRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UserLoginRecordReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).UserLoginRecord(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/userLoginRecord", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).UserLoginRecord(ctx, req.(*UserLoginRecordReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateRoleReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).CreateRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/createRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).CreateRole(ctx, req.(*CreateRoleReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_UpdateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(UpdateRoleReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).UpdateRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/updateRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).UpdateRole(ctx, req.(*UpdateRoleReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_DeleteRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(DeleteRoleReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).DeleteRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/deleteRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).DeleteRole(ctx, req.(*DeleteRoleReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(GetRoleReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).GetRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/getRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).GetRole(ctx, req.(*GetRoleReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_BindRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BindRoleReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).BindRole(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/bindRole", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).BindRole(ctx, req.(*BindRoleReq)) - } - return interceptor(ctx, in, info, handler) -} - -func _UserCenter_BindUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(BindUserReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(UserCenterServer).BindUser(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/pb.userCenter/bindUser", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(UserCenterServer).BindUser(ctx, req.(*BindUserReq)) + return srv.(UserCenterServer).RetrievePlatformUser(ctx, req.(*PlatformUserReq)) } return interceptor(ctx, in, info, handler) } @@ -522,62 +98,10 @@ var UserCenter_ServiceDesc = grpc.ServiceDesc{ HandlerType: (*UserCenterServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "createUser", - Handler: _UserCenter_CreateUser_Handler, - }, - { - MethodName: "updateUser", - Handler: _UserCenter_UpdateUser_Handler, - }, - { - MethodName: "deleteUser", - Handler: _UserCenter_DeleteUser_Handler, - }, - { - MethodName: "getUser", - Handler: _UserCenter_GetUser_Handler, - }, - { - MethodName: "getUserBySocial", - Handler: _UserCenter_GetUserBySocial_Handler, - }, - { - MethodName: "modifyAccount", - Handler: _UserCenter_ModifyAccount_Handler, - }, - { - MethodName: "bindSocial", - Handler: _UserCenter_BindSocial_Handler, - }, - { - MethodName: "userLoginRecord", - Handler: _UserCenter_UserLoginRecord_Handler, - }, - { - MethodName: "createRole", - Handler: _UserCenter_CreateRole_Handler, - }, - { - MethodName: "updateRole", - Handler: _UserCenter_UpdateRole_Handler, - }, - { - MethodName: "deleteRole", - Handler: _UserCenter_DeleteRole_Handler, - }, - { - MethodName: "getRole", - Handler: _UserCenter_GetRole_Handler, - }, - { - MethodName: "bindRole", - Handler: _UserCenter_BindRole_Handler, - }, - { - MethodName: "bindUser", - Handler: _UserCenter_BindUser_Handler, + MethodName: "retrievePlatformUser", + Handler: _UserCenter_RetrievePlatformUser_Handler, }, }, Streams: []grpc.StreamDesc{}, - Metadata: "rpc/pb/user_center.proto", + Metadata: "gift.proto", } diff --git a/app/user_center/rpc/user_center.go b/app/user_center/rpc/user_center.go new file mode 100644 index 0000000..6d1a7db --- /dev/null +++ b/app/user_center/rpc/user_center.go @@ -0,0 +1,46 @@ +package main + +import ( + "context" + "flag" + "fmt" + "live-service/app/user_center/rpc/msg_transfer" + + "live-service/app/user_center/rpc/internal/config" + "live-service/app/user_center/rpc/internal/server" + "live-service/app/user_center/rpc/internal/svc" + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/core/conf" + "github.com/zeromicro/go-zero/core/service" + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" + "google.golang.org/grpc/reflection" +) + +var configFile = flag.String("f", "etc/user_center.yaml", "the config file") + +func main() { + flag.Parse() + + var c config.Config + conf.MustLoad(*configFile, &c) + ctx := svc.NewServiceContext(c) + svr := server.NewUserCenterServer(ctx) + + // msg_transfer + msg_transfer.Init(context.Background(), ctx, svr) + msg_transfer.Run() + + s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) { + pb.RegisterUserCenterServer(grpcServer, svr) + + if c.Mode == service.DevMode || c.Mode == service.TestMode { + reflection.Register(grpcServer) + } + }) + defer s.Stop() + + fmt.Printf("Starting rpc server at %s...\n", c.ListenOn) + s.Start() +} diff --git a/app/user_center/rpc/usercenter/user_center.go b/app/user_center/rpc/usercenter/user_center.go new file mode 100644 index 0000000..bd794b8 --- /dev/null +++ b/app/user_center/rpc/usercenter/user_center.go @@ -0,0 +1,40 @@ +// Code generated by goctl. DO NOT EDIT! +// Source: gift.proto + +package usercenter + +import ( + "context" + + "live-service/app/user_center/rpc/pb" + + "github.com/zeromicro/go-zero/zrpc" + "google.golang.org/grpc" +) + +type ( + PlatformUserReq = pb.PlatformUserReq + PlatformUserResp = pb.PlatformUserResp + User = pb.User + + UserCenter interface { + // user + RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) + } + + defaultUserCenter struct { + cli zrpc.Client + } +) + +func NewUserCenter(cli zrpc.Client) UserCenter { + return &defaultUserCenter{ + cli: cli, + } +} + +// user +func (m *defaultUserCenter) RetrievePlatformUser(ctx context.Context, in *PlatformUserReq, opts ...grpc.CallOption) (*PlatformUserResp, error) { + client := pb.NewUserCenterClient(m.cli.Conn()) + return client.RetrievePlatformUser(ctx, in, opts...) +} diff --git a/common/kafka/codec.go b/common/kafka/codec.go new file mode 100644 index 0000000..d5933f9 --- /dev/null +++ b/common/kafka/codec.go @@ -0,0 +1,29 @@ +package kafka + +import ( + "errors" + "git.noahlan.cn/northlan/ntools-go/kafka" + "google.golang.org/protobuf/proto" +) + +var _ kafka.Marshaler = (*protobufMarshaler)(nil) +var _ kafka.UnMarshaler = (*protobufMarshaler)(nil) + +var ProtobufMarshaler = &protobufMarshaler{} + +type protobufMarshaler struct { +} + +func (p *protobufMarshaler) Marshal(v interface{}) ([]byte, error) { + if msg, ok := v.(proto.Message); ok { + return proto.Marshal(msg) + } + return nil, errors.New("v must be proto message") +} + +func (p *protobufMarshaler) UnMarshal(data []byte, v interface{}) error { + if msg, ok := v.(proto.Message); ok { + return proto.Unmarshal(data, msg) + } + return errors.New("v must be proto message") +} diff --git a/go.mod b/go.mod index 32bde41..6f84ebf 100644 --- a/go.mod +++ b/go.mod @@ -3,21 +3,85 @@ module live-service go 1.18 require ( + git.noahlan.cn/northlan/ntools-go/kafka v1.0.1 + git.noahlan.cn/northlan/ntools-go/stringn v1.0.0 + git.noahlan.cn/northlan/ntools-go/uuid v1.0.0 + github.com/Shopify/sarama v1.32.0 github.com/pkg/errors v0.9.1 github.com/zeromicro/go-zero v1.3.2 google.golang.org/grpc v1.45.0 + google.golang.org/protobuf v1.27.1 ) require ( + github.com/beorn7/perks v1.0.1 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/coreos/go-semver v0.3.0 // indirect + github.com/coreos/go-systemd/v22 v22.3.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect + github.com/eapache/go-resiliency v1.2.0 // indirect + github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 // indirect + github.com/eapache/queue v1.1.0 // indirect + github.com/go-logr/logr v1.2.2 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/go-redis/redis/v8 v8.11.4 // indirect + github.com/go-sql-driver/mysql v1.6.0 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/mock v1.6.0 // indirect github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/go-cmp v0.5.7 // indirect + github.com/google/gofuzz v1.2.0 // indirect + github.com/googleapis/gnostic v0.4.1 // indirect + github.com/hashicorp/go-uuid v1.0.3 // indirect + github.com/hashicorp/golang-lru v0.5.1 // indirect + github.com/jcmturner/aescts/v2 v2.0.0 // indirect + github.com/jcmturner/dnsutils/v2 v2.0.0 // indirect + github.com/jcmturner/gofork v1.0.0 // indirect + github.com/jcmturner/gokrb5/v8 v8.4.2 // indirect + github.com/jcmturner/rpc/v2 v2.0.3 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/compress v1.15.1 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/openzipkin/zipkin-go v0.4.0 // indirect + github.com/pierrec/lz4 v2.6.1+incompatible // indirect + github.com/prometheus/client_golang v1.11.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.30.0 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/spaolacci/murmur3 v1.1.0 // indirect + go.etcd.io/etcd/api/v3 v3.5.2 // indirect + go.etcd.io/etcd/client/pkg/v3 v3.5.2 // indirect + go.etcd.io/etcd/client/v3 v3.5.2 // indirect go.opentelemetry.io/otel v1.3.0 // indirect + go.opentelemetry.io/otel/exporters/jaeger v1.3.0 // indirect + go.opentelemetry.io/otel/exporters/zipkin v1.3.0 // indirect + go.opentelemetry.io/otel/sdk v1.3.0 // indirect go.opentelemetry.io/otel/trace v1.3.0 // indirect + go.uber.org/atomic v1.9.0 // indirect go.uber.org/automaxprocs v1.4.0 // indirect - golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + go.uber.org/multierr v1.8.0 // indirect + go.uber.org/zap v1.21.0 // indirect + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect + golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 // indirect + golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f // indirect golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect + golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 // indirect + google.golang.org/appengine v1.6.7 // indirect google.golang.org/genproto v0.0.0-20220228195345-15d65a4533f7 // indirect - google.golang.org/protobuf v1.27.1 // indirect + gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect + k8s.io/api v0.20.12 // indirect + k8s.io/apimachinery v0.20.12 // indirect + k8s.io/client-go v0.20.12 // indirect + k8s.io/klog/v2 v2.40.1 // indirect + k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect + sigs.k8s.io/structured-merge-diff/v4 v4.1.2 // indirect + sigs.k8s.io/yaml v1.2.0 // indirect ) diff --git a/go.sum b/go.sum index 9beb47d..17f056d 100644 --- a/go.sum +++ b/go.sum @@ -31,6 +31,12 @@ cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohl cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +git.noahlan.cn/northlan/ntools-go/kafka v1.0.1 h1:SDUwYRzksZ3Vcu7PTZxk+TEMF2f3gBiQEboKOhi1yfI= +git.noahlan.cn/northlan/ntools-go/kafka v1.0.1/go.mod h1:RxX9JSUIr3Gbk+cvUwE5k+i08AgIK3TA9ayDJCMn2n8= +git.noahlan.cn/northlan/ntools-go/stringn v1.0.0 h1:kQlk6JkJSX2JRsxtji6Ht1f3FfwdJiFEJ52k0ehjR8s= +git.noahlan.cn/northlan/ntools-go/stringn v1.0.0/go.mod h1:71TA+fLLhTNGsZvX4Fd/YbV6UeYiliW5hxK+3a9wKko= +git.noahlan.cn/northlan/ntools-go/uuid v1.0.0 h1:C0PazSzG3+e/Hfh2C6Qf8R46sNZmZKTOcWS990yUmrE= +git.noahlan.cn/northlan/ntools-go/uuid v1.0.0/go.mod h1:qTbvG+IYjUYTjIOvo//P3KRBTJOSCt9Z3Sv2xnjlG0w= github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24= github.com/Azure/go-autorest/autorest v0.11.1/go.mod h1:JFgpikqFJ/MleTTxwepExTKnFUKKszPS8UavbQYUMuw= github.com/Azure/go-autorest/autorest/adal v0.9.0/go.mod h1:/c022QCutn2P7uY+/oQWWNcK9YU+MH96NgK+jErpbcg= @@ -43,28 +49,38 @@ github.com/Azure/go-autorest/tracing v0.6.0/go.mod h1:+vhtPC754Xsa23ID7GlGsrdKBp github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ClickHouse/clickhouse-go v1.5.1/go.mod h1:EaI/sW7Azgz9UATzd5ZdZHRUhHgv5+JMS9NSr2smCJI= +github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60= github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/NYTimes/gziphandler v0.0.0-20170623195520-56545f4a5d46/go.mod h1:3wb06e3pkSAbeQ52E9H9iFoQsEEwGN64994WTCIhntQ= github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0= github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE= github.com/Shopify/sarama v1.30.0/go.mod h1:zujlQQx1kzHsh4jfV1USnptCQrHAEZ2Hk8fTKCulPVs= +github.com/Shopify/sarama v1.32.0 h1:P+RUjEaRU0GMMbYexGMDyrMkLhbbBVUVISDywi+IlFU= +github.com/Shopify/sarama v1.32.0/go.mod h1:+EmJJKZWVT/faR9RcOxJerP+LId4iWdQPBGLy1Y1Njs= github.com/Shopify/toxiproxy/v2 v2.1.6-0.20210914104332-15ea381dcdae/go.mod h1:/cvHQkZ1fst0EmZnA5dFtiQdWCNCFYzb+uE2vqVgvx0= +github.com/Shopify/toxiproxy/v2 v2.3.0 h1:62YkpiP4bzdhKMH+6uC5E95y608k3zDwdzuBMsnn3uQ= +github.com/Shopify/toxiproxy/v2 v2.3.0/go.mod h1:KvQTtB6RjCJY4zqNJn7C7JDFgsG5uoHYDirfUfpIm0c= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= 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/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk= github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a/go.mod h1:SGnFV6hVsYE877CKEZ6tDNTjaSXYUk6QqoIK6PrAtcc= +github.com/alicebob/miniredis/v2 v2.17.0 h1:EwLdrIS50uczw71Jc7iVSxZluTKj5nfSP8n7ARRnJy0= github.com/alicebob/miniredis/v2 v2.17.0/go.mod h1:gquAfGbzn92jvtrSC69+6zZnwSODVXVpYDRaGhWaL6I= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/asaskevich/govalidator v0.0.0-20190424111038-f61b66f89f4a/go.mod h1:lB+ZfQJz7igIIfQNfa7Ml4HSf2uFQQRzpGGRXenZAgY= +github.com/benbjohnson/clock v1.1.0 h1:Q92kusRqC1XV2MjkWETPvjJVqKetz1OzxZB7mHJLju8= 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 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= github.com/bkaradzic/go-lz4 v1.0.0/go.mod h1:0YdlkowM3VswSROI7qDxhRvJ3sLhlFrRRwjwegp5jy4= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= @@ -77,7 +93,9 @@ github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XP github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0 h1:wkHLiw0WNATZnSG7epLsujiMCgPAc9xhjJ4tgnAxmfM= 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/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -85,12 +103,16 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs 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= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/docker/spdystream v0.0.0-20160310174837-449fdfce4d96/go.mod h1:Qh8CwZgvJUkLughtfhJv5dyTYa91l1fOUCrgjqmcifM= github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815/go.mod h1:WwZ+bS3ebgob9U8Nd0kOddGdZWjyMGR8Wziv+TBNwSE= github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= +github.com/eapache/go-resiliency v1.2.0 h1:v7g92e/KSN71Rq7vSThKaWIq68fL4YHvWyiUKorFR1Q= github.com/eapache/go-resiliency v1.2.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= +github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21 h1:YEetp8/yCZMuEPMUDHG0CW/brkkEp8mzqk2+ODEitlw= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= +github.com/eapache/queue v1.1.0 h1:YOEu7KNc61ntiQlcEeUIoDTJ2o8mQznoNvUhiigpIqc= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= github.com/elazarl/goproxy v0.0.0-20180725130230-947c36da3153/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= github.com/emicklei/go-restful v0.0.0-20170410110728-ff4f55a20633/go.mod h1:otzb+WCGbkyDHkqmQmT5YD2WR4BBwUdeQoFo8l/7tVs= @@ -104,9 +126,13 @@ github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7 github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk= github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= github.com/form3tech-oss/jwt-go v3.2.2+incompatible/go.mod h1:pbq4aXjuKjdthFRnoDwaVPLA+WlJuPGy+QneDUgJi2k= +github.com/fortytw2/leaktest v1.3.0 h1:u8491cBMTQ8ft8aeV+adlcytMZylmA5nnwwkRZjI8vw= github.com/fortytw2/leaktest v1.3.0/go.mod h1:jDsjWgpAGjm2CA7WthBh/CdZYEPF31XHquHwclZch5g= github.com/frankban/quicktest v1.11.3/go.mod h1:wRf/ReqHper53s+kmmSZizM8NamnL3IM0I9ntUbOk+k= +github.com/frankban/quicktest v1.14.2 h1:SPb1KFFmM+ybpEjPUhCCkZOM5xlovT5UbrMvWnXyBns= +github.com/frankban/quicktest v1.14.2/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps= github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4= github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= github.com/ghodss/yaml v0.0.0-20150909031657-73d445a93680/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= @@ -136,18 +162,22 @@ github.com/go-openapi/jsonreference v0.19.3/go.mod h1:rjx6GuL8TTa9VaixXglHmQmIL9 github.com/go-openapi/spec v0.19.3/go.mod h1:FpwSN1ksY1eteniUU7X0N/BgJ7a4WvBFVA8Lj9mJglo= github.com/go-openapi/swag v0.19.2/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk= +github.com/go-redis/redis/v8 v8.11.4 h1:kHoYkfZP6+pe04aFTnhDH6GDROa5yJdHJVNxV3F46Tg= github.com/go-redis/redis/v8 v8.11.4/go.mod h1:2Z2wHZXdQpCDXEGzqMockDpNyYvi2l4Pxt6RJr792+w= github.com/go-sql-driver/mysql v1.4.0/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= @@ -156,6 +186,7 @@ github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -174,6 +205,7 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= @@ -187,10 +219,12 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.1.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= @@ -204,9 +238,11 @@ github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hf github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I= github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gnostic v0.4.1 h1:DLJCy1n/vrD4HPjOvYcT8aYQXpPIzoRZONaYwyycI+I= github.com/googleapis/gnostic v0.4.1/go.mod h1:LRhVm6pbyptWbWbuZ38d1eyptfvIytN3ir6b65WBswg= github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= github.com/gorilla/securecookie v1.1.1/go.mod h1:ra0sb63/xPlUeL+yeDciTfxMRAA+MP+HVt/4epWDjd4= @@ -214,24 +250,35 @@ github.com/gorilla/sessions v1.2.1/go.mod h1:dk2InVEVJ0sfLlnXv9EAgkf6ecYs/i80K/z github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA= 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= +github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.3 h1:2gKiV6YVmrJ1i2CKKa9obLvRieoRGviZFL26PcT/Co8= +github.com/hashicorp/go-uuid v1.0.3/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/imdario/mergo v0.3.5/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/jcmturner/aescts/v2 v2.0.0 h1:9YKLH6ey7H4eDBXW8khjYslgyqG2xZikXP0EQFKrle8= github.com/jcmturner/aescts/v2 v2.0.0/go.mod h1:AiaICIRyfYg35RUkr8yESTqvSy7csK90qZ5xfvvsoNs= +github.com/jcmturner/dnsutils/v2 v2.0.0 h1:lltnkeZGL0wILNvrNiVCR6Ro5PGU/SeBvVO/8c/iPbo= github.com/jcmturner/dnsutils/v2 v2.0.0/go.mod h1:b0TnjGOvI/n42bZa+hmXL+kFJZsFT7G4t3HTlQ184QM= +github.com/jcmturner/gofork v1.0.0 h1:J7uCkflzTEhUZ64xqKnkDxq3kzc96ajM1Gli5ktUem8= github.com/jcmturner/gofork v1.0.0/go.mod h1:MK8+TM0La+2rjBD4jE12Kj1pCCxK7d2LK/UM3ncEo0o= +github.com/jcmturner/goidentity/v6 v6.0.1 h1:VKnZd2oEIMorCTsFBnJWbExfNN7yZr3EhJAxwOkZg6o= github.com/jcmturner/goidentity/v6 v6.0.1/go.mod h1:X1YW3bgtvwAXju7V3LCIMpY0Gbxyjn/mY9zx4tFonSg= +github.com/jcmturner/gokrb5/v8 v8.4.2 h1:6ZIM6b/JJN0X8UM43ZOM6Z4SJzla+a/u7scXFJzodkA= github.com/jcmturner/gokrb5/v8 v8.4.2/go.mod h1:sb+Xq/fTY5yktf/VxLsE3wlfPqQjp0aWNYyvBVK62bc= +github.com/jcmturner/rpc/v2 v2.0.3 h1:7FXXj8Ti1IaVFpSAziCZWNzbNuZmnvw/i6CqLNdWfZY= github.com/jcmturner/rpc/v2 v2.0.3/go.mod h1:VUJYCIDm3PVOEHw8sgt091/20OJjskO/YJki3ELg/Hc= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= 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/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= @@ -241,13 +288,17 @@ github.com/justinas/alice v1.2.0/go.mod h1:fN5HRH/reO/zrUflLfTN43t3vXvKzvZIENsNE 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.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.14.4/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/klauspost/compress v1.15.1 h1:y9FcTHGyrebwfP0ZZqFiaxTaiDnUrGkJkI+f583BL1A= +github.com/klauspost/compress v1.15.1/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.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= -github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI= 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/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= @@ -263,12 +314,15 @@ github.com/mattn/go-runewidth v0.0.9/go.mod h1:H031xJmbD/WCDINGzjvQ9THkh0rPKHF+m github.com/mattn/go-runewidth v0.0.13/go.mod h1:Jdepj2loyihRzMpdS35Xk/zdY8IAYHsh153qUoGf23w= github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 h1:I0XW9+e1XWDxdcEniV4rQAIOPUGDq67JSCiRCgGCZLI= github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369/go.mod h1:BSXmuO+STAnVfrANrmjBb36TMTDstsz7MSK+HVaYKv4= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= 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/munnerz/goautoneg v0.0.0-20120707110453-a547fc61f48d/go.mod h1:+n7T8mK8HuQTcFwEeznm/DIxMOiR9yIdICNftLE1DvQ= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= @@ -276,6 +330,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -283,16 +338,20 @@ github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+W github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= 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.16.0 h1:6gjqkI8iiRHMvdccRJM8rVKjCWk6ZIm6FTm3ddIe4/c= github.com/onsi/gomega v1.16.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= github.com/openzipkin/zipkin-go v0.3.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= +github.com/openzipkin/zipkin-go v0.4.0 h1:CtfRrOVZtbDj8rt1WXjklw0kqqJQwICrCKmlfUuBUUw= github.com/openzipkin/zipkin-go v0.4.0/go.mod h1:4c3sLeE8xjNqehmF5RpAFLPLJxXscc0R4l6Zg0P1tTQ= github.com/peterbourgon/diskv v2.0.1+incompatible/go.mod h1:uqqh8zWWbv1HBMNONnaR/tNboyR3/BZd58JJSHlUSCU= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= +github.com/pierrec/lz4 v2.6.1+incompatible h1:9UY3+iC23yxF0UfGaYrGplQ+79Rg+h/q9FV9ix19jjM= github.com/pierrec/lz4 v2.6.1+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= @@ -303,25 +362,32 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0 h1:HNkLOAEQMIDv/K+04rukrLx6ch7msSRwf3/SASFAGtQ= github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.30.0 h1:JEkYlQnpzrzQFxi6gnukFPdQ+ac82oRhzMcIduJu/Ug= github.com/prometheus/common v0.30.0/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= 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/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rabbitmq/amqp091-go v1.1.0/go.mod h1:ogQDLSOACsLPsIq0NpbtiifNZi2YOz0VTJ0kHRghqbM= +github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rivo/uniseg v0.2.0/go.mod h1:J6wj4VEh+S6ZtnVlnTBMWIodfgj8LQOQFoIToxlJtxc= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k= +github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= @@ -332,9 +398,11 @@ github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0b github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= github.com/spf13/pflag v0.0.0-20170130214245-9ff6c6923cff/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 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/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -346,17 +414,22 @@ github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI= github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= +github.com/xdg-go/scram v1.1.0/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs= github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM= github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da h1:NimzV1aGyq29m5ukMK0AMWEhFaL/lrEOaephfuoiARg= github.com/yuin/gopher-lua v0.0.0-20200816102855-ee81675732da/go.mod h1:E1AXubJBdNmFERAOucpDIxNzeGfLzg0mYh+UfMWdChA= github.com/zeromicro/go-zero v1.3.2 h1:2HcmceZDEGwZWvofCG+0GXyh+Gtz/wKCW4Fq8Mb7KIg= github.com/zeromicro/go-zero v1.3.2/go.mod h1:DEj3Fwj1Ui1ltsgf6YqwTL9nD4+tYzIRX0c1pWtQo1E= +go.etcd.io/etcd/api/v3 v3.5.2 h1:tXok5yLlKyuQ/SXSjtqHc4uzNaMqZi2XsoSPr/LlJXI= go.etcd.io/etcd/api/v3 v3.5.2/go.mod h1:5GB2vv4A4AOn3yk7MftYGHkUfGtDHnEraIjym4dYz5A= +go.etcd.io/etcd/client/pkg/v3 v3.5.2 h1:4hzqQ6hIb3blLyQ8usCU4h3NghkqcsohEQ3o3VetYxE= go.etcd.io/etcd/client/pkg/v3 v3.5.2/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v3 v3.5.2 h1:WdnejrUtQC4nCxK0/dLTMqKOB+U5TP/2Ya0BJL+1otA= go.etcd.io/etcd/client/v3 v3.5.2/go.mod h1:kOOaWFFgHygyT0WlSmL8TJiXmMysO/nNUlEsSsN6W4o= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= @@ -365,7 +438,9 @@ go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= go.opentelemetry.io/otel v1.3.0 h1:APxLf0eiBwLl+SOXiJJCVYzA1OOJNyAoV8C5RNRyy7Y= go.opentelemetry.io/otel v1.3.0/go.mod h1:PWIKzi6JCp7sM0k9yZ43VX+T345uNbAkDKwHVjb2PTs= +go.opentelemetry.io/otel/exporters/jaeger v1.3.0 h1:HfydzioALdtcB26H5WHc4K47iTETJCdloL7VN579/L0= go.opentelemetry.io/otel/exporters/jaeger v1.3.0/go.mod h1:KoYHi1BtkUPncGSRtCe/eh1ijsnePhSkxwzz07vU0Fc= +go.opentelemetry.io/otel/exporters/zipkin v1.3.0 h1:uOD28dZ7yIKITTcUS6MeAGNHYy3uhP7DTkhcJM6onlQ= go.opentelemetry.io/otel/exporters/zipkin v1.3.0/go.mod h1:LxGGfHIYbvsFnrJtBcazb0yG24xHdDGrT/H6RB9r3+8= go.opentelemetry.io/otel/sdk v1.3.0 h1:3278edCoH89MEJ0Ky8WQXVmDQv3FX4ZJ3Pp+9fJreAI= go.opentelemetry.io/otel/sdk v1.3.0/go.mod h1:rIo4suHNhQwBIPg9axF8V9CA72Wz2mKF1teNrup8yzs= @@ -373,14 +448,18 @@ go.opentelemetry.io/otel/trace v1.3.0 h1:doy8Hzb1RJ+I3yFhtDmwNc7tIyw1tNMOIsyPzp1 go.opentelemetry.io/otel/trace v1.3.0/go.mod h1:c/VDhno8888bvQYmbYLqe41/Ldmr/KKunbvWM4/fEjk= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= 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/automaxprocs v1.4.0 h1:CpDZl6aOlLhReez+8S3eEotD7Jx0Os++lemPlMULQP0= go.uber.org/automaxprocs v1.4.0/go.mod h1:/mTEdr7LvHhs0v7mjdxDreTz1OG5zdZGqgOnhWiR/+Q= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= +go.uber.org/goleak v1.1.12 h1:gZAh5/EyT/HQwlpkCy6wTpqfH9H8Lz8zbm3dZh+OyzA= go.uber.org/goleak v1.1.12/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/multierr v1.8.0 h1:dg6GjLku4EH+249NNmoIciG9N/jURbDG+pFlTkhzIC8= go.uber.org/multierr v1.8.0/go.mod h1:7EAYxJLBy9rStEaz58O2t4Uvip6FSURkq8/ppBp95ak= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +go.uber.org/zap v1.21.0 h1:WefMeulhovoZ2sYXz7st6K0sLj7bBhpiFaud4r4zST8= go.uber.org/zap v1.21.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= @@ -392,6 +471,9 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20201112155050-0c6587e931a9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220214200702-86341886e292/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -462,14 +544,18 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220127200216-cd36cc0744dd/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= +golang.org/x/net v0.0.0-20220421235706-1d1ef9303861 h1:yssD99+7tqHWO5Gwh81phT+67hg+KttniBr6UnEXOY8= +golang.org/x/net v0.0.0-20220421235706-1d1ef9303861/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= 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-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f h1:Qmd2pbz05z7z6lm0DrgQVVPuBm92jqujBKMHMOlOQEw= golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -537,6 +623,7 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9 h1:nhht2DYV/Sn3qOayu8lM+cU1ii9sTLUeBQwQQfUHtrs= golang.org/x/sys v0.0.0-20220227234510-4e6760a101f9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -551,6 +638,7 @@ golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxb golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11 h1:GZokNIeuVkl3aZHJchRrr13WCsols02MLUcz1U9is6M= golang.org/x/time v0.0.0-20211116232009-f0f3c7e86c11/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= 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= @@ -626,6 +714,7 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7 google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -702,8 +791,11 @@ gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EV gopkg.in/cheggaaa/pb.v1 v1.0.28/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= 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/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= +gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc= gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= 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= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= @@ -724,12 +816,16 @@ honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWh honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +k8s.io/api v0.20.12 h1:LfRpmRkJLwPP8eaYehsVVmIIfg1yCBIIUHaSsdqCgHA= k8s.io/api v0.20.12/go.mod h1:A2brwyEkVLM3wQGNnzoAa5JsQRzHK0uoOQ+bsnv7V68= +k8s.io/apimachinery v0.20.12 h1:2c0LIVNMvB8k2Ozstmhl2zGeCEcPazznuLYEwxFdNjM= k8s.io/apimachinery v0.20.12/go.mod h1:uM7hCI0NyBymUwgshMgZyte475lxhr+QH6h3cvdnzEc= +k8s.io/client-go v0.20.12 h1:U75SxTC31BHT9i7CbX/hL4v+U1Wkzy/E1vt5ClDPp3I= k8s.io/client-go v0.20.12/go.mod h1:NBJj6Evp73Xy/4v/O/RDRaH0+3JoxNfjRxkyRgrdbsA= k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0= k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE= k8s.io/klog/v2 v2.4.0/go.mod h1:Od+F08eJP+W3HUb4pSrPpgp9DGU4GzlpG/TmITuYh/Y= +k8s.io/klog/v2 v2.40.1 h1:P4RRucWk/lFOlDdkAr3mc7iWFkgKrZY9qZMAgek06S4= k8s.io/klog/v2 v2.40.1/go.mod h1:y1WjHnz7Dj687irZUWR/WLkLc5N1YHtjLdmgWjndZn0= k8s.io/kube-openapi v0.0.0-20201113171705-d219536bb9fd/go.mod h1:WOJ3KddDSol4tAGcJo0Tvi+dK12EcqSLqcWsryKMpfM= k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw= @@ -738,6 +834,8 @@ rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8 rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= sigs.k8s.io/structured-merge-diff/v4 v4.0.2/go.mod h1:bJZC9H9iH24zzfZ/41RGcq60oK1F7G282QMXDPYydCw= +sigs.k8s.io/structured-merge-diff/v4 v4.1.2 h1:Hr/htKFmJEbtMgS/UD0N+gtgctAqz81t3nu+sPzynno= sigs.k8s.io/structured-merge-diff/v4 v4.1.2/go.mod h1:j/nl6xW8vLS49O8YvXW1ocPhZawJtm+Yrr7PPRQ0Vg4= sigs.k8s.io/yaml v1.1.0/go.mod h1:UJmg0vDUVViEyp3mgSv9WPwZCDxu4rQW1olrI1uml+o= +sigs.k8s.io/yaml v1.2.0 h1:kr/MCeFWJWTwyaHoR9c8EjH9OumOmoF9YGiZd7lFm/Q= sigs.k8s.io/yaml v1.2.0/go.mod h1:yfXDCHCao9+ENCvLSE62v9VSji2MKu5jeNfTrofGhJc=