route.go 355 B

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