From 5b8f003464bd55678862534232228f61745ffafe Mon Sep 17 00:00:00 2001
From: liujiandao <274878379@qq.com>
Date: 星期五, 15 十二月 2023 11:05:35 +0800
Subject: [PATCH] 提示信息修改

---
 main.go |   19 +++++++++++--------
 1 files changed, 11 insertions(+), 8 deletions(-)

diff --git a/main.go b/main.go
index 18843c8..bd94e74 100644
--- a/main.go
+++ b/main.go
@@ -6,7 +6,10 @@
 	"aps_crm/initialize"
 	"aps_crm/middleware"
 	"aps_crm/model"
+	"aps_crm/model/grpc_init"
 	"aps_crm/pkg/logx"
+	"aps_crm/proto/client"
+	"aps_crm/proto/crm_aps"
 	"aps_crm/proto/product_inventory"
 	"aps_crm/router"
 	"fmt"
@@ -48,12 +51,10 @@
 		ReadTimeout:  5 * time.Second,
 		WriteTimeout: 5 * time.Second,
 	}
-
 	//鍚姩grpc瀹㈡埛绔�
-	go v1.InitProductServiceConn()
 	go middleware.InitUserConn()
-	go v1.InitCodeServiceConn()
 	go v1.InitProductInventoryServiceConn()
+	go grpc_init.InitCrmApsGrpcServiceConn()
 	//鍚姩grpc鏈嶅姟
 	go func() {
 		ln, err := net.Listen("tcp", ":"+conf.Conf.System.GrpcPort)
@@ -64,15 +65,17 @@
 		s := grpc.NewServer()
 		//todo 娣诲姞鍏蜂綋鏈嶅姟
 		product_inventory.RegisterProductInventoryServiceServer(s, &product_inventory.Server{})
+		crm_aps.RegisterCrmAndApsGrpcServiceServer(s, &crm_aps.Server{})
+		client.RegisterClientServiceServer(s, &client.Server{})
 		err = s.Serve(ln)
 		if err != nil {
 			logx.Errorf("grpc server init error: %v", err.Error())
 			panic(fmt.Sprintf("grpc server init error: %v", err.Error()))
 		}
 	}()
-	//c := cron.New()
-	//c.AddFunc("@every 15s", service.SyncUserInfo) // 姣�15绉掑悓姝ヤ竴娆�
-	//c.Start()
+
+	middleware.InitRefreshUserManager(5, 5, 3600)
+	middleware.RunRefreshUser() ///瀹氭椂瀵规椿璺冪敤鎴锋洿鏂扮敤鎴疯鎯�
 
 	logx.Error(server.ListenAndServe().Error())
 }
@@ -82,10 +85,10 @@
 	signal.Notify(quit, syscall.SIGKILL, syscall.SIGQUIT, syscall.SIGINT, syscall.SIGTERM)
 	<-quit
 
-	v1.CloseProductServiceConn()
-	v1.CloseCodeServiceConn()
+	middleware.StopRefreshUser()
 	v1.CloseProductInventoryServiceConn()
 	middleware.CloseUserConn()
+	grpc_init.CloseCrmApsGrpcServiceConn()
 
 	logx.Infof("aps-crm exited...")
 	os.Exit(0)

--
Gitblit v1.8.0