From ddb3cd3e5c84bfd2bc56843eec7b291fd754fc96 Mon Sep 17 00:00:00 2001 From: Rzy <465386466@qq.com> Date: Wed, 19 Jun 2024 18:35:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=9D=E8=AF=95=E8=A7=A3=E5=AF=86=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/api/internal/svc/serviceContext.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cmd/api/internal/svc/serviceContext.go b/cmd/api/internal/svc/serviceContext.go index 0fbadae..6339c76 100755 --- a/cmd/api/internal/svc/serviceContext.go +++ b/cmd/api/internal/svc/serviceContext.go @@ -3,9 +3,11 @@ package svc import ( "github.com/zeromicro/go-zero/core/stores/sqlx" "github.com/zeromicro/go-zero/rest" + "github.com/zeromicro/go-zero/zrpc" "rs/cmd/api/internal/config" "rs/cmd/api/internal/types" "rs/genModel" + "rs/rpc/transferClient" ) type ServiceContext struct { @@ -14,15 +16,15 @@ type ServiceContext struct { } func NewServiceContext(c config.Config) *ServiceContext { - //conn := zrpc.MustNewClient(zrpc.RpcClientConf{ - // Target: c.Nacos.Target, - //}) + conn := zrpc.MustNewClient(zrpc.RpcClientConf{ + Target: c.Nacos.Target, + }) sqlConn := sqlx.NewMysql(c.DB.Coupon.DataSource) - //client := transferClient.NewTransfer(conn) + client := transferClient.NewTransfer(conn) base := types.BaseServiceContext{ - Config: c, - //TransferRpc: client, + Config: c, + TransferRpc: client, ProductRedirectConf: genModel.NewProductRedirectConfModel(sqlConn, c.Cache), Merchant: genModel.NewMerchantModel(sqlConn, c.Cache), }