From 5f815df137f6edaaaddf869097b7e2718324acc6 Mon Sep 17 00:00:00 2001
From: zhangqian <zhangqian@123.com>
Date: 星期五, 13 十月 2023 13:53:22 +0800
Subject: [PATCH] 跟进记录简单数据权限

---
 router/index.go |   84 +++++++++++++++++++++++++++++++++++++----
 1 files changed, 75 insertions(+), 9 deletions(-)

diff --git a/router/index.go b/router/index.go
index cfe067d..9bccebb 100644
--- a/router/index.go
+++ b/router/index.go
@@ -3,6 +3,8 @@
 import (
 	"aps_crm/conf"
 	_ "aps_crm/docs"
+	"aps_crm/middleware"
+	"fmt"
 	"github.com/gin-contrib/cors"
 	"github.com/gin-gonic/gin"
 	swaggerFiles "github.com/swaggo/files"
@@ -11,8 +13,22 @@
 )
 
 type Group struct {
-	BaseRouter
-	UserRouter
+	CurrencyRouter
+	QuotationStatusRouter
+	RepositoryRouter
+	SalesReturnStatusRouter
+	AccountIdRouter
+	IsInvoiceRouter
+	RefundMethodRouter
+	ServiceContractTypeRouter
+	ServiceContractStatusRouter
+	OrderTypeRouter
+	ReportSourceRouter
+	IsVisitRouter
+	SolveRateRouter
+	TimelyRateRouter
+	//BaseRouter
+	//UserRouter
 	JwtRouter
 	CountryRouter
 	ProvinceRouter
@@ -53,6 +69,11 @@
 	AuthorityRouter
 	MenuRouter
 	DataRouter
+	DepartmentRouter
+	SatisfactionRouter
+	AssignRouter
+	CollectionProjectionRouter
+	ContactInformationRouter
 }
 
 func InitRouter() *gin.Engine {
@@ -66,26 +87,35 @@
 	Router.Use(cors.Default())
 	Router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
 
+	//鑾峰彇鎵�鏈夎矾鐢� //todo
+	Router.GET("getRouters", func(c *gin.Context) {
+		routers := Router.Routes()
+		for _, v := range routers {
+			fmt.Printf("\"%v\" : 1,\n", v.Path)
+		}
+	})
+
 	routerGroup := new(Group)
 	PublicGroup := Router.Group("api")
+
 	{
 		// 鍋ュ悍鐩戞祴
 		PublicGroup.GET("/health", func(c *gin.Context) {
 			c.JSON(http.StatusOK, "ok")
 		})
 	}
-	{
-		routerGroup.InitBaseRouter(PublicGroup)  // 娉ㄥ唽鍩虹鍔熻兘璺敱 涓嶅仛閴存潈
-		routerGroup.InitImageRouter(PublicGroup) // 鍥惧儚鍔熻兘璺敱
-	}
+	//{
+	//	routerGroup.InitBaseRouter(PublicGroup)  // 娉ㄥ唽鍩虹鍔熻兘璺敱 涓嶅仛閴存潈
+	//	routerGroup.InitImageRouter(PublicGroup) // 鍥惧儚鍔熻兘璺敱
+	//}
 
 	PrivateGroup := Router.Group("api")
 	//PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
-	//PrivateGroup.Use(middleware.JWTAuth())
+	PrivateGroup.Use(middleware.JWTAuth2())
 	//PrivateGroup.Use(middleware.CasbinHandler())
 	{
-		routerGroup.InitJwtRouter(PrivateGroup)                  // jwt鐩稿叧璺敱
-		routerGroup.InitUserRouter(PrivateGroup)                 // 娉ㄥ唽鐢ㄦ埛璺敱
+		routerGroup.InitJwtRouter(PrivateGroup) // jwt鐩稿叧璺敱
+		//routerGroup.InitUserRouter(PrivateGroup)                 // 娉ㄥ唽鐢ㄦ埛璺敱
 		routerGroup.InitCountryRouter(PrivateGroup)              // 娉ㄥ唽country璺敱
 		routerGroup.InitProvinceRouter(PrivateGroup)             // 娉ㄥ唽province璺敱
 		routerGroup.InitCityRouter(PrivateGroup)                 // 娉ㄥ唽city璺敱
@@ -125,6 +155,42 @@
 		routerGroup.InitAuthorityRouter(PrivateGroup)            // 娉ㄥ唽authority璺敱
 		routerGroup.InitMenuRouter(PrivateGroup)                 // 娉ㄥ唽menu璺敱
 		routerGroup.InitDataRouter(PrivateGroup)                 // 娉ㄥ唽data璺敱
+		routerGroup.InitDepartmentRouter(PrivateGroup)           // 娉ㄥ唽department璺敱
+		routerGroup.InitSatisfactionRouter(PrivateGroup)         // 娉ㄥ唽satisfaction璺敱
+		routerGroup.InitTimelyRateRouter(PrivateGroup)
+		routerGroup.InitSolveRateRouter(PrivateGroup)
+		routerGroup.InitIsVisitRouter(PrivateGroup)
+		routerGroup.InitReportSourceRouter(PrivateGroup)
+		routerGroup.InitOrderTypeRouter(PrivateGroup)
+		routerGroup.InitServiceContractStatusRouter(PrivateGroup)
+		routerGroup.InitServiceContractTypeRouter(PrivateGroup)
+		routerGroup.InitRefundMethodRouter(PrivateGroup)
+		routerGroup.InitIsInvoiceRouter(PrivateGroup)
+		routerGroup.InitAccountIdRouter(PrivateGroup)
+		routerGroup.InitSalesReturnStatusRouter(PrivateGroup)
+		routerGroup.InitRepositoryRouter(PrivateGroup)
+		routerGroup.InitQuotationStatusRouter(PrivateGroup)
+		routerGroup.InitCurrencyRouter(PrivateGroup)
+		routerGroup.InitAssignRouter(PrivateGroup)
+		InitServiceOrderRouter(PrivateGroup)
+		InitFaqRouter(PrivateGroup)
+		InitPriorityLevelRouter(PrivateGroup)
+		InitServiceTypeRouter(PrivateGroup)
+		InitSeverityRouter(PrivateGroup)
+		InitTimeSpentRouter(PrivateGroup)
+		InitFaultTypeRouter(PrivateGroup)
+		InitServiceCollectionPlanRouter(PrivateGroup)
+		InitReceiptRouter(PrivateGroup)
+		InitBankAccountRouter(PrivateGroup)
+		InitPaymentTypeRouter(PrivateGroup)
+		InitFileRouter(PrivateGroup)
+		InitInvoiceRouter(PrivateGroup)
+		InitInvoiceStatusRouter(PrivateGroup)
+		InitInvoiceTypeRouter(PrivateGroup)
+		InitCourierCompanyRouter(PrivateGroup)
+		InitProductRouter(PrivateGroup)
+		routerGroup.InitCollectionProjectionRouter(PrivateGroup)
+		routerGroup.InitContactInformationRouter(PrivateGroup)
 	}
 	return Router
 }

--
Gitblit v1.8.0