From c76451788c63ceeac15f4ff78250c978367091af Mon Sep 17 00:00:00 2001 From: liangzai <2440983361@qq.com> Date: Tue, 15 Oct 2024 17:19:23 +0800 Subject: [PATCH] new --- apps/api/api.api | 3 + apps/api/internal/common/crypt.go | 6 + .../internal/handler/YYSY/yysy4b21handler.go | 31 + apps/api/internal/handler/routes.go | 5 + apps/api/internal/logic/FLXG/flxg970flogic.go | 2 +- apps/api/internal/logic/QYGL/qygl2acdlogic.go | 2 +- apps/api/internal/logic/QYGL/qygl45bdlogic.go | 2 +- apps/api/internal/logic/QYGL/qyglb4c0logic.go | 2 +- apps/api/internal/logic/YYSY/yysy4b21logic.go | 103 +++ apps/api/internal/validator/structs.go | 5 +- apps/api/internal/validator/validator.go | 2 +- apps/api/internal/westmodel/fieldMapping.go | 3 + apps/gateway/gateway.api | 29 +- apps/gateway/internal/handler/routes.go | 19 +- .../internal/handler/topup/toplisthandler.go | 30 + .../logic/topup/alitopupcallbacklogic.go | 6 +- .../internal/logic/topup/toplistlogic.go | 59 ++ apps/gateway/internal/svc/servicecontext.go | 4 + apps/gateway/internal/types/types.go | 21 + apps/sentinel/etc/sentinel.dev.yaml | 15 +- apps/sentinel/etc/sentinel.yaml | 13 +- apps/sentinel/internal/config/config.go | 4 + .../internal/logic/topup/alitopuplogic.go | 6 +- .../logic/topup/alitopupnotifylogic.go | 16 +- apps/sentinel/internal/svc/servicecontext.go | 6 + apps/sentinel/sentinel.go | 2 + .../apirequestservice/apirequestservice.go | 5 + apps/user/client/auth/auth.go | 5 + apps/user/client/enterprise/enterprise.go | 5 + apps/user/client/user/user.go | 5 + .../client/walletservice/walletservice.go | 21 + .../walletservice/getrechargelistlogic.go | 48 + .../walletservice/rechargewalletlogic.go | 80 ++ apps/user/internal/model/rechargemodel.go | 74 ++ apps/user/internal/model/rechargemodel_gen.go | 177 ++++ .../walletservice/walletserviceserver.go | 12 + apps/user/internal/svc/servicecontext.go | 2 + apps/user/user.proto | 39 +- apps/user/user.sql | 12 + apps/user/user/user.pb.go | 861 +++++++++++++----- apps/user/user/user_grpc.pb.go | 80 ++ westDex/westDex.go | 15 + 42 files changed, 1600 insertions(+), 237 deletions(-) create mode 100644 apps/api/internal/handler/YYSY/yysy4b21handler.go create mode 100644 apps/api/internal/logic/YYSY/yysy4b21logic.go create mode 100644 apps/gateway/internal/handler/topup/toplisthandler.go create mode 100644 apps/gateway/internal/logic/topup/toplistlogic.go create mode 100644 apps/user/internal/logic/walletservice/getrechargelistlogic.go create mode 100644 apps/user/internal/logic/walletservice/rechargewalletlogic.go create mode 100644 apps/user/internal/model/rechargemodel.go create mode 100644 apps/user/internal/model/rechargemodel_gen.go create mode 100644 westDex/westDex.go diff --git a/apps/api/api.api b/apps/api/api.api index 1521a58..e74fb6c 100644 --- a/apps/api/api.api +++ b/apps/api/api.api @@ -118,6 +118,9 @@ service api-api { @handler YYSY4B37 post /YYSY4B37 (request) returns (string) + + @handler YYSY4B21 + post /YYSY4B21 (request) returns (string) } @server ( diff --git a/apps/api/internal/common/crypt.go b/apps/api/internal/common/crypt.go index 2380714..f320e27 100644 --- a/apps/api/internal/common/crypt.go +++ b/apps/api/internal/common/crypt.go @@ -22,6 +22,12 @@ func EncryptStructFields(inputStruct interface{}, key string) (map[string]interf field := v.Type().Field(i) fieldValue := v.Field(i) + // 检查字段的 encrypt 标签是否为 "false" + encryptTag := field.Tag.Get("encrypt") + if encryptTag == "false" { + continue + } + // 如果字段为空值,跳过 if fieldValue.IsZero() { continue diff --git a/apps/api/internal/handler/YYSY/yysy4b21handler.go b/apps/api/internal/handler/YYSY/yysy4b21handler.go new file mode 100644 index 0000000..314ce89 --- /dev/null +++ b/apps/api/internal/handler/YYSY/yysy4b21handler.go @@ -0,0 +1,31 @@ +package YYSY + +import ( + "net/http" + "tianyuan-api/pkg/response" + + "github.com/zeromicro/go-zero/rest/httpx" + "tianyuan-api/apps/api/internal/logic/YYSY" + "tianyuan-api/apps/api/internal/svc" + "tianyuan-api/apps/api/internal/types" + + xhttp "github.com/zeromicro/x/http" +) + +func YYSY4B21Handler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.Request + if err := httpx.Parse(r, &req); err != nil { + xhttp.JsonBaseResponseCtx(r.Context(), w, err) + return + } + + l := YYSY.NewYYSY4B21Logic(r.Context(), svcCtx) + resp, err := l.YYSY4B21(&req) + if err != nil { + response.Fail(r.Context(), w, err) + } else { + response.Success(r.Context(), w, resp) + } + } +} diff --git a/apps/api/internal/handler/routes.go b/apps/api/internal/handler/routes.go index a194362..75b9c36 100644 --- a/apps/api/internal/handler/routes.go +++ b/apps/api/internal/handler/routes.go @@ -187,6 +187,11 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Path: "/YYSY09CD", Handler: YYSY.YYSY09CDHandler(serverCtx), }, + { + Method: http.MethodPost, + Path: "/YYSY4B21", + Handler: YYSY.YYSY4B21Handler(serverCtx), + }, { Method: http.MethodPost, Path: "/YYSY4B37", diff --git a/apps/api/internal/logic/FLXG/flxg970flogic.go b/apps/api/internal/logic/FLXG/flxg970flogic.go index f462fbb..0cc0009 100644 --- a/apps/api/internal/logic/FLXG/flxg970flogic.go +++ b/apps/api/internal/logic/FLXG/flxg970flogic.go @@ -88,7 +88,7 @@ func (l *FLXG970FLogic) FLXG970F(req *types.Request) (resp string, err *errs.App // 4、发送请求到西部 logx.Infof("交易号:%s", transactionID) - apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.FLXG970FFieldMapping, "") + apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.FLXG970FFieldMapping, "data") westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("WEST00028", apiRequest) if callAPIErr != nil { diff --git a/apps/api/internal/logic/QYGL/qygl2acdlogic.go b/apps/api/internal/logic/QYGL/qygl2acdlogic.go index 56663b6..6864a60 100644 --- a/apps/api/internal/logic/QYGL/qygl2acdlogic.go +++ b/apps/api/internal/logic/QYGL/qygl2acdlogic.go @@ -88,7 +88,7 @@ func (l *QYGL2ACDLogic) QYGL2ACD(req *types.Request) (resp string, err *errs.App // 4、发送请求到西部 logx.Infof("交易号:%s", transactionID) - apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGL2ACDFieldMapping, "") + apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGL2ACDFieldMapping, "data") westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("WEST00022", apiRequest) if callAPIErr != nil { diff --git a/apps/api/internal/logic/QYGL/qygl45bdlogic.go b/apps/api/internal/logic/QYGL/qygl45bdlogic.go index fe7343c..abd0a1d 100644 --- a/apps/api/internal/logic/QYGL/qygl45bdlogic.go +++ b/apps/api/internal/logic/QYGL/qygl45bdlogic.go @@ -88,7 +88,7 @@ func (l *QYGL45BDLogic) QYGL45BD(req *types.Request) (resp string, err *errs.App // 4、发送请求到西部 logx.Infof("交易号:%s", transactionID) - apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGL45BDFieldMapping, "") + apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGL45BDFieldMapping, "data") westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("WEST00021", apiRequest) if callAPIErr != nil { diff --git a/apps/api/internal/logic/QYGL/qyglb4c0logic.go b/apps/api/internal/logic/QYGL/qyglb4c0logic.go index bf69ed9..d915230 100644 --- a/apps/api/internal/logic/QYGL/qyglb4c0logic.go +++ b/apps/api/internal/logic/QYGL/qyglb4c0logic.go @@ -88,7 +88,7 @@ func (l *QYGLB4C0Logic) QYGLB4C0(req *types.Request) (resp string, err *errs.App // 4、发送请求到西部 logx.Infof("交易号:%s", transactionID) - apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGLB4C0FieldMapping, "") + apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.QYGLB4C0FieldMapping, "data") westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("G05HZ01", apiRequest) if callAPIErr != nil { diff --git a/apps/api/internal/logic/YYSY/yysy4b21logic.go b/apps/api/internal/logic/YYSY/yysy4b21logic.go new file mode 100644 index 0000000..cee7762 --- /dev/null +++ b/apps/api/internal/logic/YYSY/yysy4b21logic.go @@ -0,0 +1,103 @@ +package YYSY + +import ( + "context" + "encoding/hex" + "tianyuan-api/apps/api/internal/common" + "tianyuan-api/apps/api/internal/validator" + "tianyuan-api/apps/api/internal/westmodel" + "tianyuan-api/pkg/crypto" + "tianyuan-api/pkg/errs" + + "tianyuan-api/apps/api/internal/svc" + "tianyuan-api/apps/api/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type YYSY4B21Logic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewYYSY4B21Logic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSY4B21Logic { + return &YYSY4B21Logic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *YYSY4B21Logic) YYSY4B21(req *types.Request) (resp string, err *errs.AppError) { + var status string + var charges bool + var remark = "" + secretKey, ok := l.ctx.Value("secretKey").(string) + if !ok { + return "", errs.ErrSystem + } + transactionID, ok := l.ctx.Value("transactionID").(string) + if !ok { + return "", errs.ErrSystem + } + userId, userIdOk := l.ctx.Value("userId").(int64) + if !userIdOk { + return "", errs.ErrSystem + } + productCode, productCodeOk := l.ctx.Value("productCode").(string) + if !productCodeOk || productCode == "" { + return "", errs.ErrSystem + } + defer func() { + if err != nil { + status = "failed" + charges = false + } else { + status = "success" + charges = true + } + sendApiRequestMessageErr := l.svcCtx.ApiRequestMqsService.SendApiRequestMessage(l.ctx, transactionID, userId, productCode, status, charges, remark) + if sendApiRequestMessageErr != nil { + logx.Errorf("发送 API 请求消息失败: %v", err) + } + }() + // 1、解密 + key, decodeErr := hex.DecodeString(secretKey) + if decodeErr != nil { + return "", errs.ErrSystem + } + decryptData, aesDecryptErr := crypto.AesDecrypt(req.Data, key) + if aesDecryptErr != nil || len(decryptData) == 0 { + return "", errs.ErrParamDecryption + } + + // 2、校验 + var data validator.YYSY4B21Request + if validatorErr := validator.ValidateAndParse(decryptData, &data); validatorErr != nil { + return "", errs.ErrParamValidation + } + + // 3、西部加密 + westConfig := l.svcCtx.Config.WestConfig + encryptedFields, encryptStructFieldsErr := common.EncryptStructFields(data, westConfig.Key) + if encryptStructFieldsErr != nil { + logx.Errorf("西部加密错误:%v", encryptStructFieldsErr) + return "", errs.ErrSystem + } + + // 4、发送请求到西部 + logx.Infof("交易号:%s", transactionID) + apiRequest := common.MapStructToAPIRequest(encryptedFields, westmodel.YYSY4B21FieldMapping, "data") + + westResp, callAPIErr := l.svcCtx.WestDexService.CallAPI("G25BJ02", apiRequest) + if callAPIErr != nil { + return "", errs.ErrSystem + } + + encryptData, aesEncrypt := crypto.AesEncrypt(westResp, key) + if aesEncrypt != nil { + return "", errs.ErrSystem + } + return encryptData, nil +} diff --git a/apps/api/internal/validator/structs.go b/apps/api/internal/validator/structs.go index 2b85d5f..8a2dd5d 100644 --- a/apps/api/internal/validator/structs.go +++ b/apps/api/internal/validator/structs.go @@ -117,6 +117,9 @@ type QYGLB4C0Request struct { type YYSY4B37Request struct { MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"` } +type YYSY4B21Request struct { + MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"` +} type YYSY6F2ERequest struct { MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"` MobileType string `json:"mobile_type" validate:"omitempty,validMobileType"` @@ -139,5 +142,5 @@ type YYSYD50FRequest struct { } type YYSYF7DBRequest struct { MobileNo string `json:"mobile_no" validate:"required,min=11,max=11,validMobileNo"` - StartDate string `json:"start_date" validate:"required,validDate"` + StartDate string `json:"start_date" validate:"required,validDate" encrypt:"false"` } diff --git a/apps/api/internal/validator/validator.go b/apps/api/internal/validator/validator.go index 142e61c..0fcad7f 100644 --- a/apps/api/internal/validator/validator.go +++ b/apps/api/internal/validator/validator.go @@ -105,7 +105,7 @@ func validDate(fl validator.FieldLevel) bool { // 自定义身份证校验 func validIDCard(fl validator.FieldLevel) bool { id := fl.Field().String() - validIDPattern := `^\d{15}$|^\d{18}$|^\d{17}(\d|X|x)$` // 匹配15位或18位身份证 + validIDPattern := `^\d{17}(\d|X|x)$` // 匹配18位身份证号码 matched, _ := regexp.MatchString(validIDPattern, id) return matched } diff --git a/apps/api/internal/westmodel/fieldMapping.go b/apps/api/internal/westmodel/fieldMapping.go index f8265c8..2747453 100644 --- a/apps/api/internal/westmodel/fieldMapping.go +++ b/apps/api/internal/westmodel/fieldMapping.go @@ -101,6 +101,9 @@ var QYGLB4C0FieldMapping = map[string]string{ var YYSY4B37FieldMapping = map[string]string{ "MobileNo": "phone", } +var YYSY4B21FieldMapping = map[string]string{ + "MobileNo": "phone", +} var YYSY6F2EFieldMapping = map[string]string{ "IDCard": "idNo", "Name": "name", diff --git a/apps/gateway/gateway.api b/apps/gateway/gateway.api index 389cf65..3a6250c 100644 --- a/apps/gateway/gateway.api +++ b/apps/gateway/gateway.api @@ -258,17 +258,44 @@ type ( AliTopUpResponse { payUrl string `json:"payUrl"` } + GetTopUpListReq { + Page int64 `form:"page"` + PageSize int64 `form:"pageSize"` + } + GetTopUpListResp { + Total int64 `json:"total"` + List []TopUpItem `json:"list"` + } + TopUpItem { + Id int64 `json:"id"` // 主键ID + UserId int64 `json:"user_id"` // 用户ID + TransactionId string `json:"transaction_id"` // 交易ID + OutTradeNo string `json:"out_trade_no"` // 外部订单号 + Amount float64 `json:"amount"` // 充值金额 + PaymentMethod int64 `json:"payment_method"` // 支付方式 + CreatedAt string `json:"created_at"` // 创建时间 + UpdatedAt string `json:"updated_at"` // 更新时间 + } ) @server ( group: topup - prefix: /api/console/topupfmghnjx + prefix: /api/console/topup middleware: AuthInterceptor,EntAuthInterceptor ) service gateway-api { @handler aliTopUp post /aliTopUp (AliTopUpRequest) returns (AliTopUpResponse) + @handler topList + get /topUpList (GetTopUpListReq) returns (GetTopUpListResp) +} + +@server ( + group: topup + prefix: /api/console/topup +) +service gateway-api { @handler aliTopUpCallback post /aliTopUpCallback } diff --git a/apps/gateway/internal/handler/routes.go b/apps/gateway/internal/handler/routes.go index dfdcdc1..687e77b 100644 --- a/apps/gateway/internal/handler/routes.go +++ b/apps/gateway/internal/handler/routes.go @@ -90,13 +90,24 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) { Handler: topup.AliTopUpHandler(serverCtx), }, { - Method: http.MethodPost, - Path: "/aliTopUpCallback", - Handler: topup.AliTopUpCallbackHandler(serverCtx), + Method: http.MethodGet, + Path: "/topUpList", + Handler: topup.TopListHandler(serverCtx), }, }..., ), - rest.WithPrefix("/api/console/topupfmghnjx"), + rest.WithPrefix("/api/console/topup"), + ) + + server.AddRoutes( + []rest.Route{ + { + Method: http.MethodPost, + Path: "/aliTopUpCallback", + Handler: topup.AliTopUpCallbackHandler(serverCtx), + }, + }, + rest.WithPrefix("/api/console/topup"), ) server.AddRoutes( diff --git a/apps/gateway/internal/handler/topup/toplisthandler.go b/apps/gateway/internal/handler/topup/toplisthandler.go new file mode 100644 index 0000000..32f2633 --- /dev/null +++ b/apps/gateway/internal/handler/topup/toplisthandler.go @@ -0,0 +1,30 @@ +package topup + +import ( + "net/http" + + "github.com/zeromicro/go-zero/rest/httpx" + "tianyuan-api/apps/gateway/internal/logic/topup" + "tianyuan-api/apps/gateway/internal/svc" + "tianyuan-api/apps/gateway/internal/types" + + xhttp "github.com/zeromicro/x/http" +) + +func TopListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc { + return func(w http.ResponseWriter, r *http.Request) { + var req types.GetTopUpListReq + if err := httpx.Parse(r, &req); err != nil { + xhttp.JsonBaseResponseCtx(r.Context(), w, err) + return + } + + l := topup.NewTopListLogic(r.Context(), svcCtx) + resp, err := l.TopList(&req) + if err != nil { + xhttp.JsonBaseResponseCtx(r.Context(), w, err) + } else { + xhttp.JsonBaseResponseCtx(r.Context(), w, resp) + } + } +} diff --git a/apps/gateway/internal/logic/topup/alitopupcallbacklogic.go b/apps/gateway/internal/logic/topup/alitopupcallbacklogic.go index a5e6380..f393b33 100644 --- a/apps/gateway/internal/logic/topup/alitopupcallbacklogic.go +++ b/apps/gateway/internal/logic/topup/alitopupcallbacklogic.go @@ -24,7 +24,11 @@ func NewAliTopUpCallbackLogic(ctx context.Context, svcCtx *svc.ServiceContext) * } func (l *AliTopUpCallbackLogic) AliTopUpCallback(r *http.Request) error { - _, err := l.svcCtx.TopUpRpc.AliTopUpNotify(l.ctx, &sentinel.AliTopUpNotifyRequest{ + err := r.ParseForm() + if err != nil { + return err + } + _, err = l.svcCtx.TopUpRpc.AliTopUpNotify(l.ctx, &sentinel.AliTopUpNotifyRequest{ RawForm: r.Form.Encode(), }) if err != nil { diff --git a/apps/gateway/internal/logic/topup/toplistlogic.go b/apps/gateway/internal/logic/topup/toplistlogic.go new file mode 100644 index 0000000..35c93c9 --- /dev/null +++ b/apps/gateway/internal/logic/topup/toplistlogic.go @@ -0,0 +1,59 @@ +package topup + +import ( + "context" + "errors" + "tianyuan-api/apps/user/user" + + "tianyuan-api/apps/gateway/internal/svc" + "tianyuan-api/apps/gateway/internal/types" + + "github.com/zeromicro/go-zero/core/logx" +) + +type TopListLogic struct { + logx.Logger + ctx context.Context + svcCtx *svc.ServiceContext +} + +func NewTopListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *TopListLogic { + return &TopListLogic{ + Logger: logx.WithContext(ctx), + ctx: ctx, + svcCtx: svcCtx, + } +} + +func (l *TopListLogic) TopList(req *types.GetTopUpListReq) (resp *types.GetTopUpListResp, err error) { + userId, ok := l.ctx.Value("userId").(int64) + if !ok { + return nil, errors.New("无法获取 userId") + } + list, err := l.svcCtx.Wallets.GetRechargeList(l.ctx, &user.RechargeRequest{ + UserId: userId, + Page: req.Page, + PageSize: req.PageSize, + }) + if err != nil { + return nil, err + } + var topUpItemList []types.TopUpItem + + for _, p := range list.List { + topUpItemList = append(topUpItemList, types.TopUpItem{ + Id: p.Id, + UserId: p.UserId, + TransactionId: p.TransactionId, + OutTradeNo: p.OutTradeNo, + Amount: float64(p.Amount), + PaymentMethod: p.PaymentMethod, + CreatedAt: p.CreatedAt, + UpdatedAt: p.UpdatedAt, + }) + } + return &types.GetTopUpListResp{ + Total: list.Total, + List: topUpItemList, + }, nil +} diff --git a/apps/gateway/internal/svc/servicecontext.go b/apps/gateway/internal/svc/servicecontext.go index 454ccfc..3e41263 100644 --- a/apps/gateway/internal/svc/servicecontext.go +++ b/apps/gateway/internal/svc/servicecontext.go @@ -18,6 +18,7 @@ type ServiceContext struct { AuthRpc user.AuthClient EntRpc user.EnterpriseClient UserRpc user.UserClient + Wallets user.WalletServiceClient ProductRpc sentinel.ProductClient UserProductRpc sentinel.UserProductClient WhitelistRpc sentinel.WhitelistClient @@ -37,11 +38,13 @@ func NewServiceContext(c config.Config) *ServiceContext { authRpc := user.NewAuthClient(zrpc.MustNewClient(c.UserRpc).Conn()) entRpc := user.NewEnterpriseClient(zrpc.MustNewClient(c.UserRpc).Conn()) userRpc := user.NewUserClient(zrpc.MustNewClient(c.UserRpc).Conn()) + wallets := user.NewWalletServiceClient(zrpc.MustNewClient(c.UserRpc).Conn()) productRpc := sentinel.NewProductClient(zrpc.MustNewClient(c.SentinelRpc).Conn()) userProductRpc := sentinel.NewUserProductClient(zrpc.MustNewClient(c.SentinelRpc).Conn()) whitelistRpc := sentinel.NewWhitelistClient(zrpc.MustNewClient(c.SentinelRpc).Conn()) secretRpc := sentinel.NewSecretClient(zrpc.MustNewClient(c.SentinelRpc).Conn()) topUpRpc := sentinel.NewTopUpClient(zrpc.MustNewClient(c.SentinelRpc).Conn()) + return &ServiceContext{ Config: c, AuthInterceptor: middleware.NewAuthInterceptorMiddleware(c).Handle, @@ -55,5 +58,6 @@ func NewServiceContext(c config.Config) *ServiceContext { WhitelistRpc: whitelistRpc, SecretRpc: secretRpc, TopUpRpc: topUpRpc, + Wallets: wallets, } } diff --git a/apps/gateway/internal/types/types.go b/apps/gateway/internal/types/types.go index d8bd316..55d2caf 100644 --- a/apps/gateway/internal/types/types.go +++ b/apps/gateway/internal/types/types.go @@ -45,6 +45,16 @@ type GetProductListResp struct { List []ProductItem `json:"list"` } +type GetTopUpListReq struct { + Page int64 `form:"page"` + PageSize int64 `form:"pageSize"` +} + +type GetTopUpListResp struct { + Total int64 `json:"total"` + List []TopUpItem `json:"list"` +} + type GetUserProductListReq struct { Page int64 `form:"page"` PageSize int64 `form:"pageSize"` @@ -95,6 +105,17 @@ type RegisterReq struct { Code string `json:"code"` } +type TopUpItem struct { + Id int64 `json:"id"` // 主键ID + UserId int64 `json:"user_id"` // 用户ID + TransactionId string `json:"transaction_id"` // 交易ID + OutTradeNo string `json:"out_trade_no"` // 外部订单号 + Amount float64 `json:"amount"` // 充值金额 + PaymentMethod int64 `json:"payment_method"` // 支付方式 + CreatedAt string `json:"created_at"` // 创建时间 + UpdatedAt string `json:"updated_at"` // 更新时间 +} + type UploadBusinessLicenseResp struct { Url string `json:"url"` EnterpriseName string `json:"enterpriseName"` diff --git a/apps/sentinel/etc/sentinel.dev.yaml b/apps/sentinel/etc/sentinel.dev.yaml index c773e73..05ccf47 100644 --- a/apps/sentinel/etc/sentinel.dev.yaml +++ b/apps/sentinel/etc/sentinel.dev.yaml @@ -13,11 +13,14 @@ Alipay: AppID: "2021004181633376" PrivateKey: "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCC2GNEWrQUg6FVHBdlDcgL1SA1KmRI8IHgSJGvXEsgfo3g62aa5usFXHVz5bMzpIcDu0N+jGtZQIBuuq7TxGwhDvWBygEDXN17p00uwqik/3TsyFvJ4FfbkaS7pRIGfeO/cBTzjqznanPUdHJZ9L39QmTqTefIQQvGOCvgntKxPa/LdS24+ZLA2RNh3TsRzbSxOOJPmUrwvCX8U13F9jH250hvf+Tewz4hyG8CkiMM4d1UpGMndQNr8oTY0vwFbWAG0ZDGgkxjg0iRJ02fgxwShQS1TgY5NxPhpKBiN5C/WG15qCqEw0F3GlpfWZwzUhv1uMiy+xbZ2bGLo1YCtwUtAgMBAAECggEAQ8uk25T3u61cWYH9qTGT1nWug32ciqJ7WN+hBLCYiJSqJMEz380INzXp8Ywx5u83ubo8xYQyVwNxyG3YCge7UwGyOXaWQczLQbe06SaZRSzLw6gozxf7zdvP9B4akdyGtfl4EZ56fkmNDKbtXSjPjDrrmO+Wyg7R7/nI2lDQsF6dXTKD0YiHtTKz40amKgbIYX+qc3yVS0slkVjcfnRczr+PKM5RMsV3Jk2pr6IYeq3E24LnbuVtV76priTqJN3hVSy2Y6JqmAYkI0HCoCuaFGE8ud3J859jjMcUXTRFJyDsKKooa+FZCoEx2ToVMqnb4vjfr1gZifUrw4ZNd5cPoQKBgQC4v/fNTXuA21pb+l4fnqK0o3wFhiNJh920yIlF4Vd0Nsi2/TwqFK6cVhrUFAmKr88hTzY1vkOhd/HLlkWjNDR5OGx1K1BKUAZjWIfProv8lDSckADEI29lro9WzFGy0o4szlEJ2uuUfO/j9Qn2lmx5oFPsz0TI+HoSNFE0q/SlxQKBgQC1ToMLuh0OkucZm1SL6xcjudBX7U0ElZ/TIxRzfxQ/sN911/BRlxrSdCcDMXNuuFpV2ACjDNWWLJM1sRVsOWNA/oXzZf6VTvUDIAv8XrNUt/B87genBVuMTZ2RYmMWCrgW0PE1OrpKGuQCKVsn242B2Xpmee9OnHhBF2uTASDASQKBgBALvD38iMl8Q7DRYfNlF8SQnmjsaYwtXLgi4qlLFQlm6K/b9qnA+hlh8RqSUvHUqyy9cHvidoVDoaCJAKtYEWal2+WhSWvq32MpgUIsasQZKyid6TMf0MEIFDL5s+7QEsEZejhc5zESWNN3qNHd5rX5ktBygArkadXC7XqhpLHxAoGBAJ0dJEKNTZDLjKiMCoAVgT/cTcdkRFGst4tn4tkTTqDCzWJ5di++Geg173i86aMQ7ndlb2fcP1qb1hW5Fy9pq7Eu3zVFNZB9k6TZqIlSJ2VK4IPiYY9C/UpgGCNcdzEqqMxc1Cmkcrq1AtE8tVmc0Mutgnw7Pj2JKkx91yLU32TBAoGAKxssUdTLuf5Z5oFgzpoSES9qwc1h6jlMfsouDzHcZf0aYintD6Vby7SVul5540qYkDkNs0YZ3uZu74LHfoBaWJjYIIVAMSMX+3AtBpQUyYluex64V/g60t+0sFuDWqMvSPU7mZcv6+KIP6vW56GeYdhHf4JqttdIHm9SgkoJjjY=" AlipayPublicKey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2CqoCp95w/JV3RT/gzF4/8QmVT1HQNaeW7yUp+mA7x9AbjvlTW/+eRn6oGAL/XhZLjvHD0XjKLVKX0MJVS1aUQHEHEbOJN4Eu8II45OavD4iZISa7Kp9V6AM+i4qTyaeV2wNDnGxHQBaLVUGCfMR+56EK2YpORdE1H9uy72SSQseVb3bmpsV9EW/IJNmcVL/ut3uA1JWAoRmzlQ7ekxg7p8AYXzYPEHQr1tl7W+M4zv9wO9GKZCxIqMA8U3RP5npPfRaCfIRGzXzCqFEEUvWuidOB7frsvN4jiPD07qpL2Bi9LM1X/ee2kC/oM8Uhd7ERZhG8MbZfijZKxgrsDKBcwIDAQAB" - IsProduction: false # 是否是生产环境,true为生产环境,false为沙箱环境 + IsProduction: true # 是否是生产环境,true为生产环境,false为沙箱环境 TopUp: MaxTopUpAmount: 100000 -Domain: - Front: "https://console.tianyuanapi.com" - Backend: "https://console.tianyuanapi.com" - NotifyURL: "https://6m4685017o.goho.co/api/console/" - ReturnURL: "http://127.0.0.1:5173" \ No newline at end of file + Subject: "天远数据API使用额度" + NotifyURL: "https://6m4685017o.goho.co/api/console/topup/aliTopUpCallback" + ReturnURL: "http://127.0.0.1:5173/charge/recharge" +UserRpc: + Etcd: + Hosts: + - 127.0.0.1:2379 + Key: user.rpc \ No newline at end of file diff --git a/apps/sentinel/etc/sentinel.yaml b/apps/sentinel/etc/sentinel.yaml index b500506..f397f1d 100644 --- a/apps/sentinel/etc/sentinel.yaml +++ b/apps/sentinel/etc/sentinel.yaml @@ -16,8 +16,11 @@ Alipay: IsProduction: true # 是否是生产环境,true为生产环境,false为沙箱环境 TopUp: MaxTopUpAmount: 100000 -Domain: - Front: "https://console.tianyuanapi.com" - Backend: "https://console.tianyuanapi.com" - NotifyURL: "http://console.tianyuanapi.com/api/console/" - ReturnURL: "https://console.tianyuanapi.com/charge/recharge" \ No newline at end of file + Subject: "天远数据API使用额度" + NotifyURL: "http://console.tianyuanapi.com/api/console/topup/aliTopUpCallback" + ReturnURL: "https://console.tianyuanapi.com/charge/recharge" +UserRpc: + Etcd: + Hosts: + - tyapi_etcd:2379 + Key: user.rpc \ No newline at end of file diff --git a/apps/sentinel/internal/config/config.go b/apps/sentinel/internal/config/config.go index f93e86d..0602282 100644 --- a/apps/sentinel/internal/config/config.go +++ b/apps/sentinel/internal/config/config.go @@ -11,6 +11,7 @@ type Config struct { CacheRedis cache.CacheConf // 缓存配置,使用 go-zero 自带的缓存配置结构体 Alipay AlipayConfig TopUp TopUpConfig + UserRpc zrpc.RpcClientConf } type AlipayConfig struct { AppID string @@ -20,4 +21,7 @@ type AlipayConfig struct { } type TopUpConfig struct { MaxTopUpAmount int64 + Subject string + NotifyURL string + ReturnURL string } diff --git a/apps/sentinel/internal/logic/topup/alitopuplogic.go b/apps/sentinel/internal/logic/topup/alitopuplogic.go index f8d0600..17b95d2 100644 --- a/apps/sentinel/internal/logic/topup/alitopuplogic.go +++ b/apps/sentinel/internal/logic/topup/alitopuplogic.go @@ -37,12 +37,12 @@ func (l *AliTopUpLogic) AliTopUp(in *sentinel.AliTopUpRequest) (*sentinel.AliTop // 构造支付请求 var p = alipay.TradePagePay{ Trade: alipay.Trade{ - Subject: "天远数据API使用额度", + Subject: l.svcCtx.Config.TopUp.Subject, OutTradeNo: outTradeNo, TotalAmount: totalAmount, ProductCode: "FAST_INSTANT_TRADE_PAY", - NotifyURL: "https://console.tianyuanapi.com/api/console/", // 异步回调通知地址 - ReturnURL: "https://console.tianyuanapi.com/charge/recharge", // 支付成功后的跳转地址 + NotifyURL: l.svcCtx.Config.TopUp.NotifyURL, // 异步回调通知地址 + ReturnURL: l.svcCtx.Config.TopUp.ReturnURL, // 支付成功后的跳转地址 }, } _, inserErr := l.svcCtx.PayOrderModel.Insert(l.ctx, &model.PayOrder{ diff --git a/apps/sentinel/internal/logic/topup/alitopupnotifylogic.go b/apps/sentinel/internal/logic/topup/alitopupnotifylogic.go index 9270ad9..0cd6d01 100644 --- a/apps/sentinel/internal/logic/topup/alitopupnotifylogic.go +++ b/apps/sentinel/internal/logic/topup/alitopupnotifylogic.go @@ -7,6 +7,7 @@ import ( "math" "net/url" "strconv" + "tianyuan-api/apps/user/user" "tianyuan-api/apps/sentinel/internal/svc" "tianyuan-api/apps/sentinel/sentinel" @@ -63,7 +64,20 @@ func (l *AliTopUpNotifyLogic) AliTopUpNotify(in *sentinel.AliTopUpNotifyRequest) logx.Infof("回调金额:%v,订单金额%v", notify.TotalAmount, payOrder.Amount) // 比较支付宝返回的金额与数据库存储的金额 if math.Abs(notifyAmount-payOrder.Amount) < 1e-6 { - // 金额匹配,继续处理 + payOrder.Status = 1 + updateErr := l.svcCtx.PayOrderModel.Update(l.ctx, payOrder) + if updateErr != nil { + return nil, globalErr + } + _, rechargeWallet := l.svcCtx.WalletRpc.RechargeWallet(l.ctx, &user.RechargeWalletRequest{ + UserId: payOrder.UserId, + OutTradeNo: payOrder.OutTradeNo, + Amount: int64(payOrder.Amount), + PaymentMethod: 0, + }) + if rechargeWallet != nil { + return nil, globalErr + } } else { return nil, globalErr } diff --git a/apps/sentinel/internal/svc/servicecontext.go b/apps/sentinel/internal/svc/servicecontext.go index 413276a..d5f07cc 100644 --- a/apps/sentinel/internal/svc/servicecontext.go +++ b/apps/sentinel/internal/svc/servicecontext.go @@ -5,8 +5,10 @@ import ( "github.com/smartwalle/alipay/v3" "github.com/zeromicro/go-zero/core/stores/redis" "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/zrpc" "tianyuan-api/apps/sentinel/internal/config" "tianyuan-api/apps/sentinel/internal/model" + "tianyuan-api/apps/user/user" ) type ServiceContext struct { @@ -18,6 +20,7 @@ type ServiceContext struct { ProductsModel model.ProductsModel UserProductsModel model.UserProductsModel PayOrderModel model.PayOrderModel + WalletRpc user.WalletServiceClient } func NewServiceContext(c config.Config) *ServiceContext { @@ -41,6 +44,8 @@ func NewServiceContext(c config.Config) *ServiceContext { if err != nil { panic(fmt.Sprintf("加载支付宝公钥失败: %v", err)) } + + walletRpc := user.NewWalletServiceClient(zrpc.MustNewClient(c.UserRpc).Conn()) return &ServiceContext{ Config: c, Redis: rds, @@ -50,5 +55,6 @@ func NewServiceContext(c config.Config) *ServiceContext { ProductsModel: model.NewProductsModel(db, c.CacheRedis), UserProductsModel: model.NewUserProductsModel(rds, db, c.CacheRedis), PayOrderModel: model.NewPayOrderModel(db, c.CacheRedis), + WalletRpc: walletRpc, } } diff --git a/apps/sentinel/sentinel.go b/apps/sentinel/sentinel.go index 8c7f502..5647e3c 100644 --- a/apps/sentinel/sentinel.go +++ b/apps/sentinel/sentinel.go @@ -6,6 +6,7 @@ import ( "os" "tianyuan-api/apps/sentinel/internal/config" + TopUpServer "tianyuan-api/apps/sentinel/internal/server/TopUp" productServer "tianyuan-api/apps/sentinel/internal/server/product" secretServer "tianyuan-api/apps/sentinel/internal/server/secret" userproductServer "tianyuan-api/apps/sentinel/internal/server/userproduct" @@ -48,6 +49,7 @@ func main() { sentinel.RegisterSecretServer(grpcServer, secretServer.NewSecretServer(ctx)) sentinel.RegisterProductServer(grpcServer, productServer.NewProductServer(ctx)) sentinel.RegisterUserProductServer(grpcServer, userproductServer.NewUserProductServer(ctx)) + sentinel.RegisterTopUpServer(grpcServer, TopUpServer.NewTopUpServer(ctx)) if c.Mode == service.DevMode || c.Mode == service.TestMode { reflection.Register(grpcServer) diff --git a/apps/user/client/apirequestservice/apirequestservice.go b/apps/user/client/apirequestservice/apirequestservice.go index c129921..1cb0b88 100644 --- a/apps/user/client/apirequestservice/apirequestservice.go +++ b/apps/user/client/apirequestservice/apirequestservice.go @@ -39,6 +39,11 @@ type ( LoginReq = user.LoginReq LoginResp = user.LoginResp PhoneLoginReq = user.PhoneLoginReq + RechargeItem = user.RechargeItem + RechargeRequest = user.RechargeRequest + RechargeResponse = user.RechargeResponse + RechargeWalletRequest = user.RechargeWalletRequest + RechargeWalletResponse = user.RechargeWalletResponse RegisterReq = user.RegisterReq ReviewEnterpriseReq = user.ReviewEnterpriseReq UpdateWalletRequest = user.UpdateWalletRequest diff --git a/apps/user/client/auth/auth.go b/apps/user/client/auth/auth.go index 62e238c..61debe4 100644 --- a/apps/user/client/auth/auth.go +++ b/apps/user/client/auth/auth.go @@ -39,6 +39,11 @@ type ( LoginReq = user.LoginReq LoginResp = user.LoginResp PhoneLoginReq = user.PhoneLoginReq + RechargeItem = user.RechargeItem + RechargeRequest = user.RechargeRequest + RechargeResponse = user.RechargeResponse + RechargeWalletRequest = user.RechargeWalletRequest + RechargeWalletResponse = user.RechargeWalletResponse RegisterReq = user.RegisterReq ReviewEnterpriseReq = user.ReviewEnterpriseReq UpdateWalletRequest = user.UpdateWalletRequest diff --git a/apps/user/client/enterprise/enterprise.go b/apps/user/client/enterprise/enterprise.go index 1497e93..0a57196 100644 --- a/apps/user/client/enterprise/enterprise.go +++ b/apps/user/client/enterprise/enterprise.go @@ -39,6 +39,11 @@ type ( LoginReq = user.LoginReq LoginResp = user.LoginResp PhoneLoginReq = user.PhoneLoginReq + RechargeItem = user.RechargeItem + RechargeRequest = user.RechargeRequest + RechargeResponse = user.RechargeResponse + RechargeWalletRequest = user.RechargeWalletRequest + RechargeWalletResponse = user.RechargeWalletResponse RegisterReq = user.RegisterReq ReviewEnterpriseReq = user.ReviewEnterpriseReq UpdateWalletRequest = user.UpdateWalletRequest diff --git a/apps/user/client/user/user.go b/apps/user/client/user/user.go index 04506d1..d896f8d 100644 --- a/apps/user/client/user/user.go +++ b/apps/user/client/user/user.go @@ -39,6 +39,11 @@ type ( LoginReq = user.LoginReq LoginResp = user.LoginResp PhoneLoginReq = user.PhoneLoginReq + RechargeItem = user.RechargeItem + RechargeRequest = user.RechargeRequest + RechargeResponse = user.RechargeResponse + RechargeWalletRequest = user.RechargeWalletRequest + RechargeWalletResponse = user.RechargeWalletResponse RegisterReq = user.RegisterReq ReviewEnterpriseReq = user.ReviewEnterpriseReq UpdateWalletRequest = user.UpdateWalletRequest diff --git a/apps/user/client/walletservice/walletservice.go b/apps/user/client/walletservice/walletservice.go index 77b3e27..e4f6dfa 100644 --- a/apps/user/client/walletservice/walletservice.go +++ b/apps/user/client/walletservice/walletservice.go @@ -39,6 +39,11 @@ type ( LoginReq = user.LoginReq LoginResp = user.LoginResp PhoneLoginReq = user.PhoneLoginReq + RechargeItem = user.RechargeItem + RechargeRequest = user.RechargeRequest + RechargeResponse = user.RechargeResponse + RechargeWalletRequest = user.RechargeWalletRequest + RechargeWalletResponse = user.RechargeWalletResponse RegisterReq = user.RegisterReq ReviewEnterpriseReq = user.ReviewEnterpriseReq UpdateWalletRequest = user.UpdateWalletRequest @@ -54,6 +59,10 @@ type ( // 查询扣款记录 GetDeductions(ctx context.Context, in *GetDeductionsRequest, opts ...grpc.CallOption) (*GetDeductionsResponse, error) GetDeductionByTransactionId(ctx context.Context, in *GetDeductionByTransactionIdRequest, opts ...grpc.CallOption) (*GetDeductionByTransactionIdResponse, error) + // 定义充值请求接口 + RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error) + // 充值记录列表篇 + GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error) } defaultWalletService struct { @@ -89,3 +98,15 @@ func (m *defaultWalletService) GetDeductionByTransactionId(ctx context.Context, client := user.NewWalletServiceClient(m.cli.Conn()) return client.GetDeductionByTransactionId(ctx, in, opts...) } + +// 定义充值请求接口 +func (m *defaultWalletService) RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error) { + client := user.NewWalletServiceClient(m.cli.Conn()) + return client.RechargeWallet(ctx, in, opts...) +} + +// 充值记录列表篇 +func (m *defaultWalletService) GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error) { + client := user.NewWalletServiceClient(m.cli.Conn()) + return client.GetRechargeList(ctx, in, opts...) +} diff --git a/apps/user/internal/logic/walletservice/getrechargelistlogic.go b/apps/user/internal/logic/walletservice/getrechargelistlogic.go new file mode 100644 index 0000000..b3b232a --- /dev/null +++ b/apps/user/internal/logic/walletservice/getrechargelistlogic.go @@ -0,0 +1,48 @@ +package walletservicelogic + +import ( + "context" + "tianyuan-api/apps/user/internal/svc" + "tianyuan-api/apps/user/user" + + "github.com/zeromicro/go-zero/core/logx" +) + +type GetRechargeListLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewGetRechargeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetRechargeListLogic { + return &GetRechargeListLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// 充值记录列表篇 +func (l *GetRechargeListLogic) GetRechargeList(in *user.RechargeRequest) (*user.RechargeResponse, error) { + list, total, err := l.svcCtx.RechargeModel.FindRechargeListByUserId(l.ctx, in.UserId, in.Page, in.PageSize) + if err != nil { + return nil, err + } + var rechargeItemList []*user.RechargeItem + for _, w := range list { + rechargeItemList = append(rechargeItemList, &user.RechargeItem{ + Id: w.Id, + UserId: w.UserId, + TransactionId: w.TransactionId, + OutTradeNo: w.OutTradeNo, + Amount: float32(w.Amount), + PaymentMethod: w.PaymentMethod, + CreatedAt: w.CreatedAt.Format("2006-01-02 15:04:05"), + UpdatedAt: w.UpdatedAt.Format("2006-01-02 15:04:05"), + }) + } + return &user.RechargeResponse{ + List: rechargeItemList, + Total: total, + }, nil +} diff --git a/apps/user/internal/logic/walletservice/rechargewalletlogic.go b/apps/user/internal/logic/walletservice/rechargewalletlogic.go new file mode 100644 index 0000000..0c3a14b --- /dev/null +++ b/apps/user/internal/logic/walletservice/rechargewalletlogic.go @@ -0,0 +1,80 @@ +package walletservicelogic + +import ( + "context" + "errors" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "tianyuan-api/apps/user/internal/model" + "tianyuan-api/pkg/generate" + "time" + + "tianyuan-api/apps/user/internal/svc" + "tianyuan-api/apps/user/user" + + "github.com/zeromicro/go-zero/core/logx" +) + +type RechargeWalletLogic struct { + ctx context.Context + svcCtx *svc.ServiceContext + logx.Logger +} + +func NewRechargeWalletLogic(ctx context.Context, svcCtx *svc.ServiceContext) *RechargeWalletLogic { + return &RechargeWalletLogic{ + ctx: ctx, + svcCtx: svcCtx, + Logger: logx.WithContext(ctx), + } +} + +// 定义充值请求接口 +func (l *RechargeWalletLogic) RechargeWallet(in *user.RechargeWalletRequest) (*user.RechargeWalletResponse, error) { + if in.Amount <= 0 { + return nil, errors.New("金额不能小于0") + } + // 启动事务 + err := l.svcCtx.WalletsModel.TransCtx(l.ctx, func(ctx context.Context, session sqlx.Session) error { + var err error + // 更新余额(充值金额是正数,增加余额) + for i := 0; i < maxRetries; i++ { + err = l.svcCtx.WalletsModel.UpdateBalance(session, l.ctx, in.UserId, float64(in.Amount)) + if err == nil { + // 成功,退出循环 + break + } + if errors.Is(err, model.ErrVersionMismatch) { + // 版本号不匹配,重试 + time.Sleep(100 * time.Millisecond) // 重试前的延迟 + continue + } else { + // 其他错误,直接返回 + return err + } + } + + if err != nil { + return err + } + // 生成交易单号 + TransactionId := generate.GenerateTransactionID() + // 更新余额成功后,插入充值记录 + _, err = l.svcCtx.RechargeModel.InsertRechargeTrans(ctx, &model.Recharge{ + TransactionId: TransactionId, + OutTradeNo: in.OutTradeNo, + UserId: in.UserId, + Amount: float64(in.Amount), + }, session) + if err != nil { + return err + } + return nil + }) + + if err != nil { + return nil, err + } + + // 返回成功的充值响应 + return &user.RechargeWalletResponse{}, nil +} diff --git a/apps/user/internal/model/rechargemodel.go b/apps/user/internal/model/rechargemodel.go new file mode 100644 index 0000000..6fb54c2 --- /dev/null +++ b/apps/user/internal/model/rechargemodel.go @@ -0,0 +1,74 @@ +package model + +import ( + "context" + "database/sql" + "fmt" + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlx" +) + +var _ RechargeModel = (*customRechargeModel)(nil) + +type ( + // RechargeModel is an interface to be customized, add more methods here, + // and implement the added methods in customRechargeModel. + RechargeModel interface { + rechargeModel + InsertRechargeTrans(ctx context.Context, data *Recharge, session sqlx.Session) (sql.Result, error) + FindRechargeListByUserId(ctx context.Context, userId, page, pageSize int64) ([]*Recharge, int64, error) + } + + customRechargeModel struct { + *defaultRechargeModel + } +) + +// NewRechargeModel returns a model for the database table. +func NewRechargeModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) RechargeModel { + return &customRechargeModel{ + defaultRechargeModel: newRechargeModel(conn, c, opts...), + } +} +func (m *customRechargeModel) InsertRechargeTrans(ctx context.Context, data *Recharge, session sqlx.Session) (sql.Result, error) { + rechargeOutTradeNoKey := fmt.Sprintf("%s%v", cacheRechargeOutTradeNoPrefix, data.OutTradeNo) + rechargeTransactionIdKey := fmt.Sprintf("%s%v", cacheRechargeTransactionIdPrefix, data.TransactionId) + query := fmt.Sprintf("INSERT INTO %s (%s) VALUES (?, ?, ?, ?, ?)", m.table, rechargeRowsExpectAutoSet) + ret, err := session.ExecCtx(ctx, query, data.UserId, data.TransactionId, data.OutTradeNo, data.Amount, data.PaymentMethod) + if err != nil { + return nil, err + } + // 2. 更新缓存,保证所有缓存操作成功 + cacheKeys := []string{rechargeOutTradeNoKey, rechargeTransactionIdKey} + cacheErrors := make([]error, len(cacheKeys)) + + cacheErrors[0] = m.DelCacheCtx(ctx, rechargeOutTradeNoKey) + cacheErrors[1] = m.DelCacheCtx(ctx, rechargeTransactionIdKey) + // 3. 检查缓存操作是否全部成功 + for _, cacheErr := range cacheErrors { + if cacheErr != nil { + return nil, cacheErr // 返回第一个缓存更新失败的错误 + } + } + return ret, err +} +func (m *customRechargeModel) FindRechargeListByUserId(ctx context.Context, userId, page, pageSize int64) ([]*Recharge, int64, error) { + offset := (page - 1) * pageSize + query := fmt.Sprintf("SELECT * FROM recharge WHERE user_id = ? ORDER BY created_at DESC LIMIT ? OFFSET ?") + + var recharges []*Recharge + err := m.QueryRowsNoCacheCtx(ctx, &recharges, query, userId, pageSize, offset) + if err != nil { + return nil, 0, err + } + + // 获取总记录数 + var total int64 + countQuery := "SELECT COUNT(1) FROM recharge WHERE user_id = ?" + err = m.QueryRowNoCacheCtx(ctx, &total, countQuery, userId) + if err != nil { + return nil, 0, err + } + + return recharges, total, nil +} diff --git a/apps/user/internal/model/rechargemodel_gen.go b/apps/user/internal/model/rechargemodel_gen.go new file mode 100644 index 0000000..949bed3 --- /dev/null +++ b/apps/user/internal/model/rechargemodel_gen.go @@ -0,0 +1,177 @@ +// Code generated by goctl. DO NOT EDIT. +// versions: +// goctl version: 1.7.2 + +package model + +import ( + "context" + "database/sql" + "fmt" + "strings" + "time" + + "github.com/zeromicro/go-zero/core/stores/builder" + "github.com/zeromicro/go-zero/core/stores/cache" + "github.com/zeromicro/go-zero/core/stores/sqlc" + "github.com/zeromicro/go-zero/core/stores/sqlx" + "github.com/zeromicro/go-zero/core/stringx" +) + +var ( + rechargeFieldNames = builder.RawFieldNames(&Recharge{}) + rechargeRows = strings.Join(rechargeFieldNames, ",") + rechargeRowsExpectAutoSet = strings.Join(stringx.Remove(rechargeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), ",") + rechargeRowsWithPlaceHolder = strings.Join(stringx.Remove(rechargeFieldNames, "`id`", "`create_at`", "`create_time`", "`created_at`", "`update_at`", "`update_time`", "`updated_at`"), "=?,") + "=?" + + cacheRechargeIdPrefix = "cache:recharge:id:" + cacheRechargeOutTradeNoPrefix = "cache:recharge:outTradeNo:" + cacheRechargeTransactionIdPrefix = "cache:recharge:transactionId:" +) + +type ( + rechargeModel interface { + Insert(ctx context.Context, data *Recharge) (sql.Result, error) + FindOne(ctx context.Context, id int64) (*Recharge, error) + FindOneByOutTradeNo(ctx context.Context, outTradeNo string) (*Recharge, error) + FindOneByTransactionId(ctx context.Context, transactionId string) (*Recharge, error) + Update(ctx context.Context, data *Recharge) error + Delete(ctx context.Context, id int64) error + } + + defaultRechargeModel struct { + sqlc.CachedConn + table string + } + + Recharge struct { + Id int64 `db:"id"` // 主键 + UserId int64 `db:"user_id"` // 用户ID + TransactionId string `db:"transaction_id"` // 交易ID,唯一 + OutTradeNo string `db:"out_trade_no"` // 外部订单号,唯一 + Amount float64 `db:"amount"` // 充值金额 + PaymentMethod int64 `db:"payment_method"` // 充值方式 1-支付宝在线支付, 2-对公转账 + CreatedAt time.Time `db:"created_at"` // 创建时间 + UpdatedAt time.Time `db:"updated_at"` // 更新时间 + } +) + +func newRechargeModel(conn sqlx.SqlConn, c cache.CacheConf, opts ...cache.Option) *defaultRechargeModel { + return &defaultRechargeModel{ + CachedConn: sqlc.NewConn(conn, c, opts...), + table: "`recharge`", + } +} + +func (m *defaultRechargeModel) Delete(ctx context.Context, id int64) error { + data, err := m.FindOne(ctx, id) + if err != nil { + return err + } + + rechargeIdKey := fmt.Sprintf("%s%v", cacheRechargeIdPrefix, id) + rechargeOutTradeNoKey := fmt.Sprintf("%s%v", cacheRechargeOutTradeNoPrefix, data.OutTradeNo) + rechargeTransactionIdKey := fmt.Sprintf("%s%v", cacheRechargeTransactionIdPrefix, data.TransactionId) + _, err = m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("delete from %s where `id` = ?", m.table) + return conn.ExecCtx(ctx, query, id) + }, rechargeIdKey, rechargeOutTradeNoKey, rechargeTransactionIdKey) + return err +} + +func (m *defaultRechargeModel) FindOne(ctx context.Context, id int64) (*Recharge, error) { + rechargeIdKey := fmt.Sprintf("%s%v", cacheRechargeIdPrefix, id) + var resp Recharge + err := m.QueryRowCtx(ctx, &resp, rechargeIdKey, func(ctx context.Context, conn sqlx.SqlConn, v any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", rechargeRows, m.table) + return conn.QueryRowCtx(ctx, v, query, id) + }) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultRechargeModel) FindOneByOutTradeNo(ctx context.Context, outTradeNo string) (*Recharge, error) { + rechargeOutTradeNoKey := fmt.Sprintf("%s%v", cacheRechargeOutTradeNoPrefix, outTradeNo) + var resp Recharge + err := m.QueryRowIndexCtx(ctx, &resp, rechargeOutTradeNoKey, m.formatPrimary, func(ctx context.Context, conn sqlx.SqlConn, v any) (i any, e error) { + query := fmt.Sprintf("select %s from %s where `out_trade_no` = ? limit 1", rechargeRows, m.table) + if err := conn.QueryRowCtx(ctx, &resp, query, outTradeNo); err != nil { + return nil, err + } + return resp.Id, nil + }, m.queryPrimary) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultRechargeModel) FindOneByTransactionId(ctx context.Context, transactionId string) (*Recharge, error) { + rechargeTransactionIdKey := fmt.Sprintf("%s%v", cacheRechargeTransactionIdPrefix, transactionId) + var resp Recharge + err := m.QueryRowIndexCtx(ctx, &resp, rechargeTransactionIdKey, m.formatPrimary, func(ctx context.Context, conn sqlx.SqlConn, v any) (i any, e error) { + query := fmt.Sprintf("select %s from %s where `transaction_id` = ? limit 1", rechargeRows, m.table) + if err := conn.QueryRowCtx(ctx, &resp, query, transactionId); err != nil { + return nil, err + } + return resp.Id, nil + }, m.queryPrimary) + switch err { + case nil: + return &resp, nil + case sqlc.ErrNotFound: + return nil, ErrNotFound + default: + return nil, err + } +} + +func (m *defaultRechargeModel) Insert(ctx context.Context, data *Recharge) (sql.Result, error) { + rechargeIdKey := fmt.Sprintf("%s%v", cacheRechargeIdPrefix, data.Id) + rechargeOutTradeNoKey := fmt.Sprintf("%s%v", cacheRechargeOutTradeNoPrefix, data.OutTradeNo) + rechargeTransactionIdKey := fmt.Sprintf("%s%v", cacheRechargeTransactionIdPrefix, data.TransactionId) + ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("insert into %s (%s) values (?, ?, ?, ?, ?)", m.table, rechargeRowsExpectAutoSet) + return conn.ExecCtx(ctx, query, data.UserId, data.TransactionId, data.OutTradeNo, data.Amount, data.PaymentMethod) + }, rechargeIdKey, rechargeOutTradeNoKey, rechargeTransactionIdKey) + return ret, err +} + +func (m *defaultRechargeModel) Update(ctx context.Context, newData *Recharge) error { + data, err := m.FindOne(ctx, newData.Id) + if err != nil { + return err + } + + rechargeIdKey := fmt.Sprintf("%s%v", cacheRechargeIdPrefix, data.Id) + rechargeOutTradeNoKey := fmt.Sprintf("%s%v", cacheRechargeOutTradeNoPrefix, data.OutTradeNo) + rechargeTransactionIdKey := fmt.Sprintf("%s%v", cacheRechargeTransactionIdPrefix, data.TransactionId) + _, err = m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) { + query := fmt.Sprintf("update %s set %s where `id` = ?", m.table, rechargeRowsWithPlaceHolder) + return conn.ExecCtx(ctx, query, newData.UserId, newData.TransactionId, newData.OutTradeNo, newData.Amount, newData.PaymentMethod, newData.Id) + }, rechargeIdKey, rechargeOutTradeNoKey, rechargeTransactionIdKey) + return err +} + +func (m *defaultRechargeModel) formatPrimary(primary any) string { + return fmt.Sprintf("%s%v", cacheRechargeIdPrefix, primary) +} + +func (m *defaultRechargeModel) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary any) error { + query := fmt.Sprintf("select %s from %s where `id` = ? limit 1", rechargeRows, m.table) + return conn.QueryRowCtx(ctx, v, query, primary) +} + +func (m *defaultRechargeModel) tableName() string { + return m.table +} diff --git a/apps/user/internal/server/walletservice/walletserviceserver.go b/apps/user/internal/server/walletservice/walletserviceserver.go index a46ffdd..c06afdf 100644 --- a/apps/user/internal/server/walletservice/walletserviceserver.go +++ b/apps/user/internal/server/walletservice/walletserviceserver.go @@ -45,3 +45,15 @@ func (s *WalletServiceServer) GetDeductionByTransactionId(ctx context.Context, i l := walletservicelogic.NewGetDeductionByTransactionIdLogic(ctx, s.svcCtx) return l.GetDeductionByTransactionId(in) } + +// 定义充值请求接口 +func (s *WalletServiceServer) RechargeWallet(ctx context.Context, in *user.RechargeWalletRequest) (*user.RechargeWalletResponse, error) { + l := walletservicelogic.NewRechargeWalletLogic(ctx, s.svcCtx) + return l.RechargeWallet(in) +} + +// 充值记录列表篇 +func (s *WalletServiceServer) GetRechargeList(ctx context.Context, in *user.RechargeRequest) (*user.RechargeResponse, error) { + l := walletservicelogic.NewGetRechargeListLogic(ctx, s.svcCtx) + return l.GetRechargeList(in) +} diff --git a/apps/user/internal/svc/servicecontext.go b/apps/user/internal/svc/servicecontext.go index b1f55dc..cfed8a8 100644 --- a/apps/user/internal/svc/servicecontext.go +++ b/apps/user/internal/svc/servicecontext.go @@ -18,6 +18,7 @@ type ServiceContext struct { WalletsModel model.WalletsModel DeductionsModel model.DeductionsModel ApiRequestsModel model.ApiRequestsModel + RechargeModel model.RechargeModel SecretRpc sentinel.SecretClient ProductRpc sentinel.ProductClient } @@ -41,6 +42,7 @@ func NewServiceContext(c config.Config) *ServiceContext { WalletsModel: model.NewWalletsModel(db, c.CacheRedis), DeductionsModel: model.NewDeductionsModel(db, c.CacheRedis), ApiRequestsModel: model.NewApiRequestsModel(db, c.CacheRedis), + RechargeModel: model.NewRechargeModel(db, c.CacheRedis), SecretRpc: sentinel.NewSecretClient(zrpc.MustNewClient(c.SentinelRpc).Conn()), ProductRpc: sentinel.NewProductClient(zrpc.MustNewClient(c.SentinelRpc).Conn()), } diff --git a/apps/user/user.proto b/apps/user/user.proto index 41d21ec..b2a8c7a 100644 --- a/apps/user/user.proto +++ b/apps/user/user.proto @@ -139,8 +139,6 @@ service User { // 定义钱包服务 service WalletService { - - // 修改钱包余额 rpc UpdateWallet (UpdateWalletRequest) returns (UpdateWalletResponse); @@ -151,6 +149,12 @@ service WalletService { rpc GetDeductions (GetDeductionsRequest) returns (GetDeductionsResponse); rpc GetDeductionByTransactionId (GetDeductionByTransactionIdRequest) returns (GetDeductionByTransactionIdResponse); + + // 定义充值请求接口 + rpc RechargeWallet (RechargeWalletRequest) returns (RechargeWalletResponse); + + // 充值记录列表篇 + rpc GetRechargeList(RechargeRequest) returns (RechargeResponse); } // 更新钱包余额 @@ -206,6 +210,37 @@ message Deduction { string created_at = 5; } +message RechargeWalletRequest { + int64 user_id = 1; // 用户ID + string out_trade_no = 2; // 订单号 + int64 amount = 3; // 充值金额 + int64 payment_method = 4; // 充值方式(1-支付宝在线支付, 2-对公转账) +} + +message RechargeWalletResponse { + +} +message RechargeRequest { + int64 user_id = 1; // 用户ID + int64 page = 2; // 分页页码 + int64 page_size = 3; // 每页大小 +} + +message RechargeResponse { + repeated RechargeItem list = 1; // 充值记录列表 + int64 total = 2; // 总记录数 +} + +message RechargeItem { + int64 id = 1; // 主键ID + int64 user_id = 2; // 用户ID + string transaction_id = 3; // 交易ID + string out_trade_no = 4; // 外部订单号 + float amount = 5; // 充值金额 + int64 payment_method = 6; // 支付方式 + string created_at = 7; // 创建时间 + string updated_at = 8; // 更新时间 +} service ApiRequestService { // 添加API请求记录 diff --git a/apps/user/user.sql b/apps/user/user.sql index 8860e52..09c1131 100644 --- a/apps/user/user.sql +++ b/apps/user/user.sql @@ -70,3 +70,15 @@ CREATE TABLE api_requests ( timestamp DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '请求时间', PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='API请求记录表,存储API请求的相关信息'; + +CREATE TABLE `recharge` ( + id INT(11) NOT NULL AUTO_INCREMENT COMMENT '主键', + user_id INT(11) NOT NULL COMMENT '用户ID', + `transaction_id` VARCHAR(64) NOT NULL UNIQUE COMMENT '交易ID,唯一', + `out_trade_no` VARCHAR(64) NOT NULL UNIQUE COMMENT '外部订单号,唯一', + `amount` DECIMAL(10, 2) NOT NULL COMMENT '充值金额', + `payment_method` TINYINT NOT NULL COMMENT '充值方式 1-支付宝在线支付, 2-对公转账', + created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', + updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间', + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='充值记录表'; \ No newline at end of file diff --git a/apps/user/user/user.pb.go b/apps/user/user/user.pb.go index d9b7d84..ded1e61 100644 --- a/apps/user/user/user.pb.go +++ b/apps/user/user/user.pb.go @@ -1542,6 +1542,336 @@ func (x *Deduction) GetCreatedAt() string { return "" } +type RechargeWalletRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户ID + OutTradeNo string `protobuf:"bytes,2,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` // 订单号 + Amount int64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` // 充值金额 + PaymentMethod int64 `protobuf:"varint,4,opt,name=payment_method,json=paymentMethod,proto3" json:"payment_method,omitempty"` // 充值方式(1-支付宝在线支付, 2-对公转账) +} + +func (x *RechargeWalletRequest) Reset() { + *x = RechargeWalletRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[24] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RechargeWalletRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RechargeWalletRequest) ProtoMessage() {} + +func (x *RechargeWalletRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_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 RechargeWalletRequest.ProtoReflect.Descriptor instead. +func (*RechargeWalletRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{24} +} + +func (x *RechargeWalletRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *RechargeWalletRequest) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *RechargeWalletRequest) GetAmount() int64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *RechargeWalletRequest) GetPaymentMethod() int64 { + if x != nil { + return x.PaymentMethod + } + return 0 +} + +type RechargeWalletResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RechargeWalletResponse) Reset() { + *x = RechargeWalletResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[25] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RechargeWalletResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RechargeWalletResponse) ProtoMessage() {} + +func (x *RechargeWalletResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_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 RechargeWalletResponse.ProtoReflect.Descriptor instead. +func (*RechargeWalletResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{25} +} + +type RechargeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + UserId int64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户ID + Page int64 `protobuf:"varint,2,opt,name=page,proto3" json:"page,omitempty"` // 分页页码 + PageSize int64 `protobuf:"varint,3,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"` // 每页大小 +} + +func (x *RechargeRequest) Reset() { + *x = RechargeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[26] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RechargeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RechargeRequest) ProtoMessage() {} + +func (x *RechargeRequest) ProtoReflect() protoreflect.Message { + mi := &file_user_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 RechargeRequest.ProtoReflect.Descriptor instead. +func (*RechargeRequest) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{26} +} + +func (x *RechargeRequest) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *RechargeRequest) GetPage() int64 { + if x != nil { + return x.Page + } + return 0 +} + +func (x *RechargeRequest) GetPageSize() int64 { + if x != nil { + return x.PageSize + } + return 0 +} + +type RechargeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + List []*RechargeItem `protobuf:"bytes,1,rep,name=list,proto3" json:"list,omitempty"` // 充值记录列表 + Total int64 `protobuf:"varint,2,opt,name=total,proto3" json:"total,omitempty"` // 总记录数 +} + +func (x *RechargeResponse) Reset() { + *x = RechargeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[27] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RechargeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RechargeResponse) ProtoMessage() {} + +func (x *RechargeResponse) ProtoReflect() protoreflect.Message { + mi := &file_user_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 RechargeResponse.ProtoReflect.Descriptor instead. +func (*RechargeResponse) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{27} +} + +func (x *RechargeResponse) GetList() []*RechargeItem { + if x != nil { + return x.List + } + return nil +} + +func (x *RechargeResponse) GetTotal() int64 { + if x != nil { + return x.Total + } + return 0 +} + +type RechargeItem struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Id int64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // 主键ID + UserId int64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` // 用户ID + TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"` // 交易ID + OutTradeNo string `protobuf:"bytes,4,opt,name=out_trade_no,json=outTradeNo,proto3" json:"out_trade_no,omitempty"` // 外部订单号 + Amount float32 `protobuf:"fixed32,5,opt,name=amount,proto3" json:"amount,omitempty"` // 充值金额 + PaymentMethod int64 `protobuf:"varint,6,opt,name=payment_method,json=paymentMethod,proto3" json:"payment_method,omitempty"` // 支付方式 + CreatedAt string `protobuf:"bytes,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"` // 创建时间 + UpdatedAt string `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,proto3" json:"updated_at,omitempty"` // 更新时间 +} + +func (x *RechargeItem) Reset() { + *x = RechargeItem{} + if protoimpl.UnsafeEnabled { + mi := &file_user_proto_msgTypes[28] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RechargeItem) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RechargeItem) ProtoMessage() {} + +func (x *RechargeItem) ProtoReflect() protoreflect.Message { + mi := &file_user_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 RechargeItem.ProtoReflect.Descriptor instead. +func (*RechargeItem) Descriptor() ([]byte, []int) { + return file_user_proto_rawDescGZIP(), []int{28} +} + +func (x *RechargeItem) GetId() int64 { + if x != nil { + return x.Id + } + return 0 +} + +func (x *RechargeItem) GetUserId() int64 { + if x != nil { + return x.UserId + } + return 0 +} + +func (x *RechargeItem) GetTransactionId() string { + if x != nil { + return x.TransactionId + } + return "" +} + +func (x *RechargeItem) GetOutTradeNo() string { + if x != nil { + return x.OutTradeNo + } + return "" +} + +func (x *RechargeItem) GetAmount() float32 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *RechargeItem) GetPaymentMethod() int64 { + if x != nil { + return x.PaymentMethod + } + return 0 +} + +func (x *RechargeItem) GetCreatedAt() string { + if x != nil { + return x.CreatedAt + } + return "" +} + +func (x *RechargeItem) GetUpdatedAt() string { + if x != nil { + return x.UpdatedAt + } + return "" +} + // 添加API请求记录 type AddApiRequestRequest struct { state protoimpl.MessageState @@ -1560,7 +1890,7 @@ type AddApiRequestRequest struct { func (x *AddApiRequestRequest) Reset() { *x = AddApiRequestRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[24] + mi := &file_user_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1573,7 +1903,7 @@ func (x *AddApiRequestRequest) String() string { func (*AddApiRequestRequest) ProtoMessage() {} func (x *AddApiRequestRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[24] + mi := &file_user_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1586,7 +1916,7 @@ func (x *AddApiRequestRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddApiRequestRequest.ProtoReflect.Descriptor instead. func (*AddApiRequestRequest) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{24} + return file_user_proto_rawDescGZIP(), []int{29} } func (x *AddApiRequestRequest) GetTransactionId() string { @@ -1649,7 +1979,7 @@ type AddApiRequestResponse struct { func (x *AddApiRequestResponse) Reset() { *x = AddApiRequestResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[25] + mi := &file_user_proto_msgTypes[30] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1662,7 +1992,7 @@ func (x *AddApiRequestResponse) String() string { func (*AddApiRequestResponse) ProtoMessage() {} func (x *AddApiRequestResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[25] + mi := &file_user_proto_msgTypes[30] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1675,7 +2005,7 @@ func (x *AddApiRequestResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddApiRequestResponse.ProtoReflect.Descriptor instead. func (*AddApiRequestResponse) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{25} + return file_user_proto_rawDescGZIP(), []int{30} } func (x *AddApiRequestResponse) GetSuccess() bool { @@ -1699,7 +2029,7 @@ type GetApiRequestsRequest struct { func (x *GetApiRequestsRequest) Reset() { *x = GetApiRequestsRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[26] + mi := &file_user_proto_msgTypes[31] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1712,7 +2042,7 @@ func (x *GetApiRequestsRequest) String() string { func (*GetApiRequestsRequest) ProtoMessage() {} func (x *GetApiRequestsRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[26] + mi := &file_user_proto_msgTypes[31] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1725,7 +2055,7 @@ func (x *GetApiRequestsRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetApiRequestsRequest.ProtoReflect.Descriptor instead. func (*GetApiRequestsRequest) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{26} + return file_user_proto_rawDescGZIP(), []int{31} } func (x *GetApiRequestsRequest) GetUserId() int64 { @@ -1760,7 +2090,7 @@ type GetApiRequestsResponse struct { func (x *GetApiRequestsResponse) Reset() { *x = GetApiRequestsResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[27] + mi := &file_user_proto_msgTypes[32] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1773,7 +2103,7 @@ func (x *GetApiRequestsResponse) String() string { func (*GetApiRequestsResponse) ProtoMessage() {} func (x *GetApiRequestsResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[27] + mi := &file_user_proto_msgTypes[32] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1786,7 +2116,7 @@ func (x *GetApiRequestsResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetApiRequestsResponse.ProtoReflect.Descriptor instead. func (*GetApiRequestsResponse) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{27} + return file_user_proto_rawDescGZIP(), []int{32} } func (x *GetApiRequestsResponse) GetApiRequests() []*ApiRequest { @@ -1814,7 +2144,7 @@ type ApiRequest struct { func (x *ApiRequest) Reset() { *x = ApiRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[28] + mi := &file_user_proto_msgTypes[33] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1827,7 +2157,7 @@ func (x *ApiRequest) String() string { func (*ApiRequest) ProtoMessage() {} func (x *ApiRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[28] + mi := &file_user_proto_msgTypes[33] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1840,7 +2170,7 @@ func (x *ApiRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ApiRequest.ProtoReflect.Descriptor instead. func (*ApiRequest) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{28} + return file_user_proto_rawDescGZIP(), []int{33} } func (x *ApiRequest) GetId() int64 { @@ -1911,7 +2241,7 @@ type GetApiRequestByTransactionIdRequest struct { func (x *GetApiRequestByTransactionIdRequest) Reset() { *x = GetApiRequestByTransactionIdRequest{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[29] + mi := &file_user_proto_msgTypes[34] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1924,7 +2254,7 @@ func (x *GetApiRequestByTransactionIdRequest) String() string { func (*GetApiRequestByTransactionIdRequest) ProtoMessage() {} func (x *GetApiRequestByTransactionIdRequest) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[29] + mi := &file_user_proto_msgTypes[34] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1937,7 +2267,7 @@ func (x *GetApiRequestByTransactionIdRequest) ProtoReflect() protoreflect.Messag // Deprecated: Use GetApiRequestByTransactionIdRequest.ProtoReflect.Descriptor instead. func (*GetApiRequestByTransactionIdRequest) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{29} + return file_user_proto_rawDescGZIP(), []int{34} } func (x *GetApiRequestByTransactionIdRequest) GetTransactionId() string { @@ -1965,7 +2295,7 @@ type GetApiRequestByTransactionIdResponse struct { func (x *GetApiRequestByTransactionIdResponse) Reset() { *x = GetApiRequestByTransactionIdResponse{} if protoimpl.UnsafeEnabled { - mi := &file_user_proto_msgTypes[30] + mi := &file_user_proto_msgTypes[35] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1978,7 +2308,7 @@ func (x *GetApiRequestByTransactionIdResponse) String() string { func (*GetApiRequestByTransactionIdResponse) ProtoMessage() {} func (x *GetApiRequestByTransactionIdResponse) ProtoReflect() protoreflect.Message { - mi := &file_user_proto_msgTypes[30] + mi := &file_user_proto_msgTypes[35] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1991,7 +2321,7 @@ func (x *GetApiRequestByTransactionIdResponse) ProtoReflect() protoreflect.Messa // Deprecated: Use GetApiRequestByTransactionIdResponse.ProtoReflect.Descriptor instead. func (*GetApiRequestByTransactionIdResponse) Descriptor() ([]byte, []int) { - return file_user_proto_rawDescGZIP(), []int{30} + return file_user_proto_rawDescGZIP(), []int{35} } func (x *GetApiRequestByTransactionIdResponse) GetId() int64 { @@ -2219,140 +2549,185 @@ var file_user_proto_rawDesc = []byte{ 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xe1, 0x01, - 0x0a, 0x14, 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, - 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, - 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, - 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, - 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, - 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, - 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x22, 0x31, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, - 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, - 0x63, 0x65, 0x73, 0x73, 0x22, 0x58, 0x0a, 0x15, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, - 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, - 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x48, - 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x0c, 0x61, 0x70, 0x69, 0x5f, - 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, - 0x2e, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0b, 0x61, 0x70, 0x69, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x22, 0xe7, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, - 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, - 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, - 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, - 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, - 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, - 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, - 0x6d, 0x70, 0x22, 0x4c, 0x0a, 0x23, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x22, 0x81, 0x02, 0x0a, 0x24, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, - 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, - 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, - 0x64, 0x75, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x18, - 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x12, 0x16, - 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, - 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x32, 0xcf, 0x01, 0x0a, 0x0a, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, - 0x69, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x14, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, - 0x67, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x47, 0x65, - 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, - 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, - 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x38, 0x0a, 0x10, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, - 0x72, 0x69, 0x73, 0x65, 0x12, 0x14, 0x2e, 0x52, 0x65, 0x76, 0x69, 0x65, 0x77, 0x45, 0x6e, 0x74, - 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x14, 0x43, 0x72, - 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, - 0x74, 0x68, 0x12, 0x12, 0x2e, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, - 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x86, 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, - 0x2c, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, - 0x0c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, - 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, - 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x09, 0x2e, 0x4c, 0x6f, 0x67, - 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x2c, 0x0a, 0x0e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, - 0x73, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x50, 0x68, 0x6f, 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, - 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, - 0xb4, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x27, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, - 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, - 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, - 0x12, 0x0c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x10, - 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, - 0x12, 0x54, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, - 0x65, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x47, 0x65, - 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x53, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, - 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0xaa, 0x02, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3b, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, - 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x14, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, - 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, - 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x15, 0x2e, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x68, 0x0a, 0x1b, 0x47, 0x65, 0x74, - 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, - 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x23, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, - 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, - 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x32, 0x83, 0x02, 0x0a, 0x11, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x41, 0x64, 0x64, - 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, 0x41, 0x64, 0x64, - 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x16, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x47, 0x65, 0x74, - 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x16, 0x2e, 0x47, 0x65, - 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6b, 0x0a, 0x1c, - 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x24, 0x2e, 0x47, - 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x5a, 0x06, 0x2e, 0x2f, 0x75, - 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0x91, 0x01, + 0x0a, 0x15, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, + 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, + 0x4e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, + 0x64, 0x22, 0x18, 0x0a, 0x16, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x57, 0x61, 0x6c, + 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5b, 0x0a, 0x0f, 0x52, + 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, + 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, + 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, 0x67, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x70, + 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, + 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x4b, 0x0a, 0x10, 0x52, 0x65, 0x63, 0x68, + 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x04, + 0x6c, 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x52, 0x65, 0x63, + 0x68, 0x61, 0x72, 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x04, 0x6c, 0x69, 0x73, 0x74, 0x12, + 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, + 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x22, 0xfd, 0x01, 0x0a, 0x0c, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, + 0x67, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x20, 0x0a, 0x0c, 0x6f, 0x75, 0x74, 0x5f, 0x74, 0x72, + 0x61, 0x64, 0x65, 0x5f, 0x6e, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x75, + 0x74, 0x54, 0x72, 0x61, 0x64, 0x65, 0x4e, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, + 0x12, 0x25, 0x0a, 0x0e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x74, 0x68, + 0x6f, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, + 0x74, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, + 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x64, 0x41, 0x74, 0x22, 0xe1, 0x01, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, + 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x21, + 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, 0x64, + 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, 0x61, + 0x72, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x63, 0x68, 0x61, 0x72, + 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x74, + 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x31, 0x0a, 0x15, 0x41, 0x64, 0x64, + 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x22, 0x58, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x12, + 0x0a, 0x04, 0x70, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x04, 0x70, 0x61, + 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x48, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x2e, 0x0a, 0x0c, 0x61, 0x70, 0x69, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0b, 0x2e, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x52, 0x0b, 0x61, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, + 0x22, 0xe7, 0x01, 0x0a, 0x0a, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, 0x64, 0x12, + 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, + 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, + 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, + 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x64, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x6f, + 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x63, 0x68, + 0x61, 0x72, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, + 0x72, 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x18, 0x07, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1c, 0x0a, 0x09, + 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0x4c, 0x0a, 0x23, 0x47, 0x65, + 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x81, 0x02, 0x0a, 0x24, 0x47, 0x65, 0x74, + 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x02, 0x69, + 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, + 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, + 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x63, 0x6f, 0x64, + 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, + 0x43, 0x6f, 0x64, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18, 0x0a, 0x07, + 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x01, 0x52, 0x07, 0x63, + 0x68, 0x61, 0x72, 0x67, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x61, 0x72, 0x6b, 0x12, 0x1c, + 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x32, 0xcf, 0x01, 0x0a, + 0x0a, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x14, 0x47, + 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x73, 0x65, 0x12, 0x18, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x19, 0x2e, + 0x47, 0x65, 0x74, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, + 0x72, 0x69, 0x73, 0x65, 0x52, 0x65, 0x73, 0x70, 0x12, 0x38, 0x0a, 0x10, 0x52, 0x65, 0x76, 0x69, + 0x65, 0x77, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x12, 0x14, 0x2e, 0x52, + 0x65, 0x76, 0x69, 0x65, 0x77, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x52, + 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x45, 0x6e, 0x74, 0x65, + 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x12, 0x12, 0x2e, 0x45, 0x6e, 0x74, + 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x52, 0x65, 0x71, 0x1a, 0x0e, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x86, + 0x01, 0x0a, 0x04, 0x41, 0x75, 0x74, 0x68, 0x12, 0x2c, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, + 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0c, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, + 0x65, 0x72, 0x52, 0x65, 0x71, 0x1a, 0x0e, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x09, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, + 0x65, 0x72, 0x12, 0x09, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, + 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2c, 0x0a, 0x0e, 0x50, 0x68, 0x6f, + 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x2e, 0x50, 0x68, + 0x6f, 0x6e, 0x65, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x1a, 0x0a, 0x2e, 0x4c, 0x6f, + 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x32, 0xb4, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, + 0x12, 0x27, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, 0x55, + 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x0d, 0x2e, 0x55, 0x73, 0x65, + 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x2d, 0x0a, 0x0b, 0x47, 0x65, 0x74, + 0x55, 0x73, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0c, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x1a, 0x10, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x54, 0x0a, 0x17, 0x47, 0x65, 0x74, 0x45, + 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, + 0x69, 0x73, 0x65, 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, + 0x1a, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x72, 0x69, 0x73, 0x65, + 0x41, 0x75, 0x74, 0x68, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x32, 0xa5, + 0x03, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, + 0x12, 0x3b, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, + 0x12, 0x14, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x09, 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x11, 0x2e, 0x47, 0x65, 0x74, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x12, 0x2e, + 0x47, 0x65, 0x74, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x3e, 0x0a, 0x0d, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x12, 0x15, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x47, 0x65, 0x74, 0x44, + 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x68, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, + 0x12, 0x23, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x47, 0x65, 0x74, 0x44, 0x65, 0x64, 0x75, 0x63, + 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, + 0x6e, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x52, + 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x16, 0x2e, + 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, + 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, + 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x4c, 0x69, 0x73, + 0x74, 0x12, 0x10, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x52, 0x65, 0x63, 0x68, 0x61, 0x72, 0x67, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x83, 0x02, 0x0a, 0x11, 0x41, 0x70, 0x69, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x0d, + 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x2e, + 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x41, 0x64, 0x64, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x12, 0x16, + 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x6b, 0x0a, 0x1c, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, + 0x24, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, + 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x47, 0x65, 0x74, 0x41, 0x70, 0x69, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x79, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x49, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0x08, 0x5a, 0x06, + 0x2e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2367,7 +2742,7 @@ func file_user_proto_rawDescGZIP() []byte { return file_user_proto_rawDescData } -var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 31) +var file_user_proto_msgTypes = make([]protoimpl.MessageInfo, 36) var file_user_proto_goTypes = []any{ (*EmptyResponse)(nil), // 0: EmptyResponse (*GetPendingEnterpriseReq)(nil), // 1: GetPendingEnterpriseReq @@ -2393,55 +2768,65 @@ var file_user_proto_goTypes = []any{ (*GetDeductionByTransactionIdRequest)(nil), // 21: GetDeductionByTransactionIdRequest (*GetDeductionByTransactionIdResponse)(nil), // 22: GetDeductionByTransactionIdResponse (*Deduction)(nil), // 23: Deduction - (*AddApiRequestRequest)(nil), // 24: AddApiRequestRequest - (*AddApiRequestResponse)(nil), // 25: AddApiRequestResponse - (*GetApiRequestsRequest)(nil), // 26: GetApiRequestsRequest - (*GetApiRequestsResponse)(nil), // 27: GetApiRequestsResponse - (*ApiRequest)(nil), // 28: ApiRequest - (*GetApiRequestByTransactionIdRequest)(nil), // 29: GetApiRequestByTransactionIdRequest - (*GetApiRequestByTransactionIdResponse)(nil), // 30: GetApiRequestByTransactionIdResponse + (*RechargeWalletRequest)(nil), // 24: RechargeWalletRequest + (*RechargeWalletResponse)(nil), // 25: RechargeWalletResponse + (*RechargeRequest)(nil), // 26: RechargeRequest + (*RechargeResponse)(nil), // 27: RechargeResponse + (*RechargeItem)(nil), // 28: RechargeItem + (*AddApiRequestRequest)(nil), // 29: AddApiRequestRequest + (*AddApiRequestResponse)(nil), // 30: AddApiRequestResponse + (*GetApiRequestsRequest)(nil), // 31: GetApiRequestsRequest + (*GetApiRequestsResponse)(nil), // 32: GetApiRequestsResponse + (*ApiRequest)(nil), // 33: ApiRequest + (*GetApiRequestByTransactionIdRequest)(nil), // 34: GetApiRequestByTransactionIdRequest + (*GetApiRequestByTransactionIdResponse)(nil), // 35: GetApiRequestByTransactionIdResponse } var file_user_proto_depIdxs = []int32{ 2, // 0: GetPendingEnterpriseResp.list:type_name -> EnterpriseItem 23, // 1: GetDeductionsResponse.deductions:type_name -> Deduction - 28, // 2: GetApiRequestsResponse.api_requests:type_name -> ApiRequest - 1, // 3: Enterprise.GetPendingEnterprise:input_type -> GetPendingEnterpriseReq - 4, // 4: Enterprise.ReviewEnterprise:input_type -> ReviewEnterpriseReq - 5, // 5: Enterprise.CreateEnterpriseAuth:input_type -> EnterpriseAuthReq - 6, // 6: Auth.RegisterUser:input_type -> RegisterReq - 7, // 7: Auth.LoginUser:input_type -> LoginReq - 8, // 8: Auth.PhoneLoginUser:input_type -> PhoneLoginReq - 10, // 9: User.UserInfo:input_type -> UserInfoReq - 10, // 10: User.GetUserInfo:input_type -> UserInfoReq - 13, // 11: User.GetEnterpriseAuthStatus:input_type -> GetEnterpriseAuthStatusReq - 15, // 12: WalletService.UpdateWallet:input_type -> UpdateWalletRequest - 17, // 13: WalletService.GetWallet:input_type -> GetWalletRequest - 19, // 14: WalletService.GetDeductions:input_type -> GetDeductionsRequest - 21, // 15: WalletService.GetDeductionByTransactionId:input_type -> GetDeductionByTransactionIdRequest - 24, // 16: ApiRequestService.AddApiRequest:input_type -> AddApiRequestRequest - 26, // 17: ApiRequestService.GetApiRequests:input_type -> GetApiRequestsRequest - 29, // 18: ApiRequestService.GetApiRequestByTransactionId:input_type -> GetApiRequestByTransactionIdRequest - 3, // 19: Enterprise.GetPendingEnterprise:output_type -> GetPendingEnterpriseResp - 0, // 20: Enterprise.ReviewEnterprise:output_type -> EmptyResponse - 0, // 21: Enterprise.CreateEnterpriseAuth:output_type -> EmptyResponse - 0, // 22: Auth.RegisterUser:output_type -> EmptyResponse - 9, // 23: Auth.LoginUser:output_type -> LoginResp - 9, // 24: Auth.PhoneLoginUser:output_type -> LoginResp - 11, // 25: User.UserInfo:output_type -> UserInfoResp - 12, // 26: User.GetUserInfo:output_type -> GetUserInfoResp - 14, // 27: User.GetEnterpriseAuthStatus:output_type -> GetEnterpriseAuthStatusResp - 16, // 28: WalletService.UpdateWallet:output_type -> UpdateWalletResponse - 18, // 29: WalletService.GetWallet:output_type -> GetWalletResponse - 20, // 30: WalletService.GetDeductions:output_type -> GetDeductionsResponse - 22, // 31: WalletService.GetDeductionByTransactionId:output_type -> GetDeductionByTransactionIdResponse - 25, // 32: ApiRequestService.AddApiRequest:output_type -> AddApiRequestResponse - 27, // 33: ApiRequestService.GetApiRequests:output_type -> GetApiRequestsResponse - 30, // 34: ApiRequestService.GetApiRequestByTransactionId:output_type -> GetApiRequestByTransactionIdResponse - 19, // [19:35] is the sub-list for method output_type - 3, // [3:19] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 28, // 2: RechargeResponse.list:type_name -> RechargeItem + 33, // 3: GetApiRequestsResponse.api_requests:type_name -> ApiRequest + 1, // 4: Enterprise.GetPendingEnterprise:input_type -> GetPendingEnterpriseReq + 4, // 5: Enterprise.ReviewEnterprise:input_type -> ReviewEnterpriseReq + 5, // 6: Enterprise.CreateEnterpriseAuth:input_type -> EnterpriseAuthReq + 6, // 7: Auth.RegisterUser:input_type -> RegisterReq + 7, // 8: Auth.LoginUser:input_type -> LoginReq + 8, // 9: Auth.PhoneLoginUser:input_type -> PhoneLoginReq + 10, // 10: User.UserInfo:input_type -> UserInfoReq + 10, // 11: User.GetUserInfo:input_type -> UserInfoReq + 13, // 12: User.GetEnterpriseAuthStatus:input_type -> GetEnterpriseAuthStatusReq + 15, // 13: WalletService.UpdateWallet:input_type -> UpdateWalletRequest + 17, // 14: WalletService.GetWallet:input_type -> GetWalletRequest + 19, // 15: WalletService.GetDeductions:input_type -> GetDeductionsRequest + 21, // 16: WalletService.GetDeductionByTransactionId:input_type -> GetDeductionByTransactionIdRequest + 24, // 17: WalletService.RechargeWallet:input_type -> RechargeWalletRequest + 26, // 18: WalletService.GetRechargeList:input_type -> RechargeRequest + 29, // 19: ApiRequestService.AddApiRequest:input_type -> AddApiRequestRequest + 31, // 20: ApiRequestService.GetApiRequests:input_type -> GetApiRequestsRequest + 34, // 21: ApiRequestService.GetApiRequestByTransactionId:input_type -> GetApiRequestByTransactionIdRequest + 3, // 22: Enterprise.GetPendingEnterprise:output_type -> GetPendingEnterpriseResp + 0, // 23: Enterprise.ReviewEnterprise:output_type -> EmptyResponse + 0, // 24: Enterprise.CreateEnterpriseAuth:output_type -> EmptyResponse + 0, // 25: Auth.RegisterUser:output_type -> EmptyResponse + 9, // 26: Auth.LoginUser:output_type -> LoginResp + 9, // 27: Auth.PhoneLoginUser:output_type -> LoginResp + 11, // 28: User.UserInfo:output_type -> UserInfoResp + 12, // 29: User.GetUserInfo:output_type -> GetUserInfoResp + 14, // 30: User.GetEnterpriseAuthStatus:output_type -> GetEnterpriseAuthStatusResp + 16, // 31: WalletService.UpdateWallet:output_type -> UpdateWalletResponse + 18, // 32: WalletService.GetWallet:output_type -> GetWalletResponse + 20, // 33: WalletService.GetDeductions:output_type -> GetDeductionsResponse + 22, // 34: WalletService.GetDeductionByTransactionId:output_type -> GetDeductionByTransactionIdResponse + 25, // 35: WalletService.RechargeWallet:output_type -> RechargeWalletResponse + 27, // 36: WalletService.GetRechargeList:output_type -> RechargeResponse + 30, // 37: ApiRequestService.AddApiRequest:output_type -> AddApiRequestResponse + 32, // 38: ApiRequestService.GetApiRequests:output_type -> GetApiRequestsResponse + 35, // 39: ApiRequestService.GetApiRequestByTransactionId:output_type -> GetApiRequestByTransactionIdResponse + 22, // [22:40] is the sub-list for method output_type + 4, // [4:22] is the sub-list for method input_type + 4, // [4:4] is the sub-list for extension type_name + 4, // [4:4] is the sub-list for extension extendee + 0, // [0:4] is the sub-list for field type_name } func init() { file_user_proto_init() } @@ -2739,7 +3124,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[24].Exporter = func(v any, i int) any { - switch v := v.(*AddApiRequestRequest); i { + switch v := v.(*RechargeWalletRequest); i { case 0: return &v.state case 1: @@ -2751,7 +3136,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[25].Exporter = func(v any, i int) any { - switch v := v.(*AddApiRequestResponse); i { + switch v := v.(*RechargeWalletResponse); i { case 0: return &v.state case 1: @@ -2763,7 +3148,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[26].Exporter = func(v any, i int) any { - switch v := v.(*GetApiRequestsRequest); i { + switch v := v.(*RechargeRequest); i { case 0: return &v.state case 1: @@ -2775,7 +3160,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[27].Exporter = func(v any, i int) any { - switch v := v.(*GetApiRequestsResponse); i { + switch v := v.(*RechargeResponse); i { case 0: return &v.state case 1: @@ -2787,7 +3172,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[28].Exporter = func(v any, i int) any { - switch v := v.(*ApiRequest); i { + switch v := v.(*RechargeItem); i { case 0: return &v.state case 1: @@ -2799,7 +3184,7 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[29].Exporter = func(v any, i int) any { - switch v := v.(*GetApiRequestByTransactionIdRequest); i { + switch v := v.(*AddApiRequestRequest); i { case 0: return &v.state case 1: @@ -2811,6 +3196,66 @@ func file_user_proto_init() { } } file_user_proto_msgTypes[30].Exporter = func(v any, i int) any { + switch v := v.(*AddApiRequestResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[31].Exporter = func(v any, i int) any { + switch v := v.(*GetApiRequestsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[32].Exporter = func(v any, i int) any { + switch v := v.(*GetApiRequestsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[33].Exporter = func(v any, i int) any { + switch v := v.(*ApiRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[34].Exporter = func(v any, i int) any { + switch v := v.(*GetApiRequestByTransactionIdRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_user_proto_msgTypes[35].Exporter = func(v any, i int) any { switch v := v.(*GetApiRequestByTransactionIdResponse); i { case 0: return &v.state @@ -2829,7 +3274,7 @@ func file_user_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_user_proto_rawDesc, NumEnums: 0, - NumMessages: 31, + NumMessages: 36, NumExtensions: 0, NumServices: 5, }, diff --git a/apps/user/user/user_grpc.pb.go b/apps/user/user/user_grpc.pb.go index 2b6d2f0..837a500 100644 --- a/apps/user/user/user_grpc.pb.go +++ b/apps/user/user/user_grpc.pb.go @@ -546,6 +546,8 @@ const ( WalletService_GetWallet_FullMethodName = "/WalletService/GetWallet" WalletService_GetDeductions_FullMethodName = "/WalletService/GetDeductions" WalletService_GetDeductionByTransactionId_FullMethodName = "/WalletService/GetDeductionByTransactionId" + WalletService_RechargeWallet_FullMethodName = "/WalletService/RechargeWallet" + WalletService_GetRechargeList_FullMethodName = "/WalletService/GetRechargeList" ) // WalletServiceClient is the client API for WalletService service. @@ -561,6 +563,10 @@ type WalletServiceClient interface { // 查询扣款记录 GetDeductions(ctx context.Context, in *GetDeductionsRequest, opts ...grpc.CallOption) (*GetDeductionsResponse, error) GetDeductionByTransactionId(ctx context.Context, in *GetDeductionByTransactionIdRequest, opts ...grpc.CallOption) (*GetDeductionByTransactionIdResponse, error) + // 定义充值请求接口 + RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error) + // 充值记录列表篇 + GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error) } type walletServiceClient struct { @@ -611,6 +617,26 @@ func (c *walletServiceClient) GetDeductionByTransactionId(ctx context.Context, i return out, nil } +func (c *walletServiceClient) RechargeWallet(ctx context.Context, in *RechargeWalletRequest, opts ...grpc.CallOption) (*RechargeWalletResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RechargeWalletResponse) + err := c.cc.Invoke(ctx, WalletService_RechargeWallet_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletServiceClient) GetRechargeList(ctx context.Context, in *RechargeRequest, opts ...grpc.CallOption) (*RechargeResponse, error) { + cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) + out := new(RechargeResponse) + err := c.cc.Invoke(ctx, WalletService_GetRechargeList_FullMethodName, in, out, cOpts...) + if err != nil { + return nil, err + } + return out, nil +} + // WalletServiceServer is the server API for WalletService service. // All implementations must embed UnimplementedWalletServiceServer // for forward compatibility @@ -624,6 +650,10 @@ type WalletServiceServer interface { // 查询扣款记录 GetDeductions(context.Context, *GetDeductionsRequest) (*GetDeductionsResponse, error) GetDeductionByTransactionId(context.Context, *GetDeductionByTransactionIdRequest) (*GetDeductionByTransactionIdResponse, error) + // 定义充值请求接口 + RechargeWallet(context.Context, *RechargeWalletRequest) (*RechargeWalletResponse, error) + // 充值记录列表篇 + GetRechargeList(context.Context, *RechargeRequest) (*RechargeResponse, error) mustEmbedUnimplementedWalletServiceServer() } @@ -643,6 +673,12 @@ func (UnimplementedWalletServiceServer) GetDeductions(context.Context, *GetDeduc func (UnimplementedWalletServiceServer) GetDeductionByTransactionId(context.Context, *GetDeductionByTransactionIdRequest) (*GetDeductionByTransactionIdResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetDeductionByTransactionId not implemented") } +func (UnimplementedWalletServiceServer) RechargeWallet(context.Context, *RechargeWalletRequest) (*RechargeWalletResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RechargeWallet not implemented") +} +func (UnimplementedWalletServiceServer) GetRechargeList(context.Context, *RechargeRequest) (*RechargeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRechargeList not implemented") +} func (UnimplementedWalletServiceServer) mustEmbedUnimplementedWalletServiceServer() {} // UnsafeWalletServiceServer may be embedded to opt out of forward compatibility for this service. @@ -728,6 +764,42 @@ func _WalletService_GetDeductionByTransactionId_Handler(srv interface{}, ctx con return interceptor(ctx, in, info, handler) } +func _WalletService_RechargeWallet_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RechargeWalletRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletServiceServer).RechargeWallet(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WalletService_RechargeWallet_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletServiceServer).RechargeWallet(ctx, req.(*RechargeWalletRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _WalletService_GetRechargeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(RechargeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletServiceServer).GetRechargeList(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: WalletService_GetRechargeList_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletServiceServer).GetRechargeList(ctx, req.(*RechargeRequest)) + } + return interceptor(ctx, in, info, handler) +} + // WalletService_ServiceDesc is the grpc.ServiceDesc for WalletService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -751,6 +823,14 @@ var WalletService_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetDeductionByTransactionId", Handler: _WalletService_GetDeductionByTransactionId_Handler, }, + { + MethodName: "RechargeWallet", + Handler: _WalletService_RechargeWallet_Handler, + }, + { + MethodName: "GetRechargeList", + Handler: _WalletService_GetRechargeList_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "user.proto", diff --git a/westDex/westDex.go b/westDex/westDex.go new file mode 100644 index 0000000..5cf2406 --- /dev/null +++ b/westDex/westDex.go @@ -0,0 +1,15 @@ +package main + +import ( + "fmt" + "tianyuan-api/pkg/crypto" +) + +func main() { + data := "GBymoxlPVETbdHlL6lI20qG6i006C3WkVM/m4AVpD9G7YE3rvAELhTrgcP7XTF0kgJ8sr9PVmiX0AdLyceIzYHzeGRGQFr1k9YbcSCzhwEBnsybVGunurX7RnhPNpCzKI0k1FUWaIkH3UXl5DNPly+fH822K7IUGiYDpKKDb8Rl5xMmIuRuO7D5CvhNhT3wgIVzHcdpoSDQ9eTREyODC2Q==" + decrypt, err := crypto.WestDexDecrypt(data, "121a1e41fc1690dd6b90afbcacd80cf4") + if err != nil { + return + } + fmt.Println(string(decrypt)) +}