github.com/OrigamiWang/msd/micro@v0.0.0-20240229032328-b62246268db9/framework/ginweb.go (about)

     1  package framework
     2  
     3  import (
     4  	"github.com/OrigamiWang/msd/micro/model"
     5  	"github.com/gin-gonic/gin"
     6  )
     7  
     8  func New() *gin.Engine {
     9  	gin.SetMode(gin.DebugMode)
    10  	g := gin.New()
    11  	g.Use(gin.Logger())
    12  	g.Use(gin.Recovery())
    13  	// FIXME: add customized middleware
    14  	// g.Use(TraceExtractor())
    15  	// g.Use(Trace())
    16  	// g.Use(AccessLog())
    17  	return g
    18  }
    19  
    20  func NewGinWeb() *model.Ginweb {
    21  	return &model.Ginweb{New()}
    22  }