route.go 648 B

123456789101112131415161718192021222324252627282930
  1. package route
  2. import "github.com/gin-gonic/gin"
  3. // HTTPServerRoute 核心 App 服务 HTTP 路由
  4. func HTTPServerRoute(opts ...func(engine *gin.Engine)) func(s *gin.Engine) {
  5. routes := []func(s *gin.Engine){
  6. Root(opts...),
  7. SystemAPI(opts...),
  8. PastureManageAPI(opts...),
  9. ConfigAPI(opts...),
  10. EventAPI(opts...),
  11. CowAPI(opts...),
  12. GoodsManageAPI(opts...),
  13. AnalysisAPI(opts...),
  14. DashboardApi(opts...),
  15. WorkOrderAPI(opts...),
  16. FilesManageAPI(opts...),
  17. MilkManageAPI(opts...),
  18. WarningAPI(opts...),
  19. TestAPI(opts...),
  20. FeedingAPI(opts...),
  21. }
  22. return func(s *gin.Engine) {
  23. for _, route := range routes {
  24. route(s)
  25. }
  26. }
  27. }