From a6a6045065169ab56c7d44ea32dce743d940e840 Mon Sep 17 00:00:00 2001
From: jiangshuai <291802688@qq.com>
Date: 星期五, 08 十二月 2023 11:15:19 +0800
Subject: [PATCH] collection改为固定12345
---
controllers/code.go | 42 ++++++++++++++++++++----------------------
1 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/controllers/code.go b/controllers/code.go
index f293bb3..f539fc4 100644
--- a/controllers/code.go
+++ b/controllers/code.go
@@ -3,38 +3,36 @@
import (
"github.com/gin-gonic/gin"
"github.com/spf13/cast"
- "google.golang.org/grpc"
- "google.golang.org/grpc/credentials/insecure"
- "wms/conf"
cd "wms/extend/code"
"wms/extend/util"
"wms/models"
"wms/pkg/contextx"
"wms/pkg/logx"
"wms/proto/code"
+ "wms/proto/init_client"
"wms/request"
)
type CodeApi struct{}
-var (
- codeServiceConn *grpc.ClientConn
-)
-
-func InitCodeServiceConn() {
- var err error
- codeServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
- if err != nil {
- logx.Errorf("grpc dial product service error: %v", err.Error())
- return
- }
-}
-
-func CloseCodeServiceConn() {
- if codeServiceConn != nil {
- codeServiceConn.Close()
- }
-}
+//var (
+// codeServiceConn *grpc.ClientConn
+//)
+//
+//func InitCodeServiceConn() {
+// var err error
+// codeServiceConn, err = grpc.Dial(conf.GrpcServerConf.ApsAddr, grpc.WithTransportCredentials(insecure.NewCredentials()))
+// if err != nil {
+// logx.Errorf("grpc dial product service error: %v", err.Error())
+// return
+// }
+//}
+//
+//func CloseCodeServiceConn() {
+// if codeServiceConn != nil {
+// codeServiceConn.Close()
+// }
+//}
// GetCodeList
//
@@ -54,7 +52,7 @@
params.CodeStandID = c.Query("codeStandID")
params.Name = c.Query("name")
params.Type = c.Query("type")
- client := code.NewCodeServiceClient(codeServiceConn)
+ client := code.NewCodeServiceClient(init_client.ApsConn)
list, err := client.GetCodeList(ctx.GetCtx(), &code.GetCodeListRequest{
Page: cast.ToInt32(params.Page),
PageSize: cast.ToInt32(params.PageSize),
--
Gitblit v1.8.0