From 8a439141c04ee485d250f5a5bc3cead74f3a0156 Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期五, 01 十二月 2023 14:12:19 +0800
Subject: [PATCH] 修改aps物料申请状态

---
 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