| | |
| | | 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" |
| | |
| | | ) |
| | | |
| | | type Group struct { |
| | | ServiceContractTypeRouter |
| | | ServiceContractStatusRouter |
| | | OrderTypeRouter |
| | | ReportSourceRouter |
| | | CurrencyRouter |
| | | QuotationStatusRouter |
| | | RepositoryRouter |
| | | SalesReturnStatusRouter |
| | | AccountIdRouter |
| | | IsInvoiceRouter |
| | | RefundMethodRouter |
| | | ServiceContractTypeRouter |
| | | ServiceContractStatusRouter |
| | | OrderTypeRouter |
| | | ReportSourceRouter |
| | | IsVisitRouter |
| | | SolveRateRouter |
| | | TimelyRateRouter |
| | |
| | | DataRouter |
| | | DepartmentRouter |
| | | SatisfactionRouter |
| | | AssignRouter |
| | | CollectionProjectionRouter |
| | | ContactInformationRouter |
| | | } |
| | | |
| | | func InitRouter() *gin.Engine { |
| | |
| | | |
| | | routerGroup := new(Group) |
| | | PublicGroup := Router.Group("api") |
| | | |
| | | { |
| | | // 健康监测 |
| | | PublicGroup.GET("/health", func(c *gin.Context) { |
| | |
| | | |
| | | 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.InitTimelyRateRouter(PrivateGroup) |
| | | routerGroup.InitSolveRateRouter(PrivateGroup) |
| | | routerGroup.InitIsVisitRouter(PrivateGroup) |
| | | routerGroup.InitReportSourceRouter(PrivateGroup) |
| | | routerGroup.InitOrderTypeRouter(PrivateGroup) |
| | | routerGroup.InitServiceContractStatusRouter(PrivateGroup) |
| | | routerGroup.InitServiceContractTypeRouter(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 |
| | | } |
| | | } |