|
package middleware
|
|
|
|
import (
|
|
"modelRT/config"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
// ConfigMiddleware 将全局配置注入到Gin上下文中
|
|
func ConfigMiddleware(modelRTConfig config.ModelRTConfig) gin.HandlerFunc {
|
|
return func(c *gin.Context) {
|
|
c.Set("config", modelRTConfig)
|
|
c.Next()
|
|
}
|
|
} |