- package middleware
- import (
- "github.com/gin-gonic/gin"
- "gogs.baozhida.cn/zoie/OAuth-core/sdk"
- "gogs.baozhida.cn/zoie/OAuth-core/sdk/config"
- )
- func WithContextDb(c *gin.Context) {
- c.Set("db", sdk.Runtime.GetDbByKey(config.ApplicationConfig.Host).WithContext(c))
- c.Next()
- }
|