route.go 400 B

1234567891011121314151617181920
  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. DebugAPI(opts...),
  9. OpsAPI(opts...),
  10. PastureAPI(opts...),
  11. }
  12. return func(s *gin.Engine) {
  13. for _, route := range routes {
  14. route(s)
  15. }
  16. }
  17. }