fix
wangpengfei
2023-08-30 0b785160190dd5746a26a8508eeda3ae18a10871
router/index.go
@@ -3,6 +3,7 @@
import (
   "aps_crm/conf"
   _ "aps_crm/docs"
   "aps_crm/middleware"
   "github.com/gin-contrib/cors"
   "github.com/gin-gonic/gin"
   swaggerFiles "github.com/swaggo/files"
@@ -11,6 +12,20 @@
)
type Group struct {
   CurrencyRouter
   QuotationStatusRouter
   RepositoryRouter
   SalesReturnStatusRouter
   AccountIdRouter
   IsInvoiceRouter
   RefundMethodRouter
   ServiceContractTypeRouter
   ServiceContractStatusRouter
   OrderTypeRouter
   ReportSourceRouter
   IsVisitRouter
   SolveRateRouter
   TimelyRateRouter
   BaseRouter
   UserRouter
   JwtRouter
@@ -31,6 +46,33 @@
   SalesLeadsRouter
   SalesSourcesRouter
   FollowRecordRouter
   SaleChanceRouter
   SaleStageRouter
   SaleTypeRouter
   RegularCustomersRouter
   PossibilityRouter
   StatusRouter
   QuotationRouter
   MasterOrderRouter
   SubOrderRouter
   SalesDetailsRouter
   SalesReturnRouter
   SalesRefundRouter
   ContractRouter
   PlanRouter
   ServiceContractRouter
   OrderManageRouter
   ServiceFollowupRouter
   CustomerServiceSheetRouter
   ServiceFeeManageRouter
   AuthorityRouter
   MenuRouter
   DataRouter
   DepartmentRouter
   SatisfactionRouter
   AssignRouter
   CollectionProjectionRouter
   ContactInformationRouter
}
func InitRouter() *gin.Engine {
@@ -46,6 +88,7 @@
   routerGroup := new(Group)
   PublicGroup := Router.Group("api")
   {
      // 健康监测
      PublicGroup.GET("/health", func(c *gin.Context) {
@@ -58,27 +101,87 @@
   }
   PrivateGroup := Router.Group("api")
   //PrivateGroup.Use(middleware.JWTAuth())
   //PrivateGroup.Use(middleware.JWTAuth()).Use(middleware.CasbinHandler())
   PrivateGroup.Use(middleware.JWTAuth2())
   //PrivateGroup.Use(middleware.CasbinHandler())
   {
      routerGroup.InitJwtRouter(PrivateGroup)               // jwt相关路由
      routerGroup.InitUserRouter(PrivateGroup)              // 注册用户路由
      routerGroup.InitCountryRouter(PrivateGroup)           // 注册country路由
      routerGroup.InitProvinceRouter(PrivateGroup)          // 注册province路由
      routerGroup.InitCityRouter(PrivateGroup)              // 注册city路由
      routerGroup.InitRegionRouter(PrivateGroup)            // 注册region路由
      routerGroup.InitContactRouter(PrivateGroup)           // 注册contact路由
      routerGroup.InitClientRouter(PrivateGroup)            // 注册client路由
      routerGroup.InitClientStatusRouter(PrivateGroup)      // 注册clientStatus路由
      routerGroup.InitClientTypeRouter(PrivateGroup)        // 注册clientType路由
      routerGroup.InitClientOriginRouter(PrivateGroup)      // 注册clientOrigin路由
      routerGroup.InitClientLevelRouter(PrivateGroup)       // 注册clientLevel路由
      routerGroup.InitIndustryRouter(PrivateGroup)          // 注册industry路由
      routerGroup.InitEnterpriseNatureRouter(PrivateGroup)  // 注册enterpriseNature路由
      routerGroup.InitRegisteredCapitalRouter(PrivateGroup) // 注册registeredCapital路由
      routerGroup.InitEnterpriseScaleRouter(PrivateGroup)   // 注册enterpriseScale路由
      routerGroup.InitSalesLeadsRouter(PrivateGroup)        // 注册salesLeads路由
      routerGroup.InitSalesSourcesRouter(PrivateGroup)      // 注册salesSources路由
      routerGroup.InitFollowRecordRouter(PrivateGroup)      // 注册followRecord路由
      routerGroup.InitJwtRouter(PrivateGroup)                  // jwt相关路由
      routerGroup.InitUserRouter(PrivateGroup)                 // 注册用户路由
      routerGroup.InitCountryRouter(PrivateGroup)              // 注册country路由
      routerGroup.InitProvinceRouter(PrivateGroup)             // 注册province路由
      routerGroup.InitCityRouter(PrivateGroup)                 // 注册city路由
      routerGroup.InitRegionRouter(PrivateGroup)               // 注册region路由
      routerGroup.InitContactRouter(PrivateGroup)              // 注册contact路由
      routerGroup.InitClientRouter(PrivateGroup)               // 注册client路由
      routerGroup.InitClientStatusRouter(PrivateGroup)         // 注册clientStatus路由
      routerGroup.InitClientTypeRouter(PrivateGroup)           // 注册clientType路由
      routerGroup.InitClientOriginRouter(PrivateGroup)         // 注册clientOrigin路由
      routerGroup.InitClientLevelRouter(PrivateGroup)          // 注册clientLevel路由
      routerGroup.InitIndustryRouter(PrivateGroup)             // 注册industry路由
      routerGroup.InitEnterpriseNatureRouter(PrivateGroup)     // 注册enterpriseNature路由
      routerGroup.InitRegisteredCapitalRouter(PrivateGroup)    // 注册registeredCapital路由
      routerGroup.InitEnterpriseScaleRouter(PrivateGroup)      // 注册enterpriseScale路由
      routerGroup.InitSalesLeadsRouter(PrivateGroup)           // 注册salesLeads路由
      routerGroup.InitSalesSourcesRouter(PrivateGroup)         // 注册salesSources路由
      routerGroup.InitFollowRecordRouter(PrivateGroup)         // 注册followRecord路由
      routerGroup.InitSaleChanceRouter(PrivateGroup)           // 注册saleChance路由
      routerGroup.InitSaleStageRouter(PrivateGroup)            // 注册saleStage路由
      routerGroup.InitSaleTypeRouter(PrivateGroup)             // 注册saleType路由
      routerGroup.InitRegularCustomersRouter(PrivateGroup)     // 注册regularCustomers路由
      routerGroup.InitPossibilityRouter(PrivateGroup)          // 注册possibility路由
      routerGroup.InitStatusRouter(PrivateGroup)               // 注册status路由
      routerGroup.InitQuotationRouter(PrivateGroup)            // 注册quotation路由
      routerGroup.InitMasterOrderRouter(PrivateGroup)          // 注册masterOrder路由
      routerGroup.InitSubOrderRouter(PrivateGroup)             // 注册subOrder路由
      routerGroup.InitSalesDetailsRouter(PrivateGroup)         // 注册salesDetails路由
      routerGroup.InitSalesReturnRouter(PrivateGroup)          // 注册salesReturn路由
      routerGroup.InitSalesRefundRouter(PrivateGroup)          // 注册salesRefund路由
      routerGroup.InitContractRouter(PrivateGroup)             // 注册contract路由
      routerGroup.InitPlanRouter(PrivateGroup)                 // 注册plan路由
      routerGroup.InitServiceContractRouter(PrivateGroup)      // 注册serviceContract路由
      routerGroup.InitOrderManageRouter(PrivateGroup)          // 注册orderManage路由
      routerGroup.InitServiceFollowupRouter(PrivateGroup)      // 注册serviceFollowup路由
      routerGroup.InitCustomerServiceSheetRouter(PrivateGroup) // 注册customerServiceSheet路由
      routerGroup.InitServiceFeeManageRouter(PrivateGroup)     // 注册serviceFeeManage路由
      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
}