Some checks failed
Build / build (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled
build / Build (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitee (push) Has been cancelled
GitHub Actions Mirror / mirror_to_gitlab (push) Has been cancelled
Issue Close Require / issue-close-require (push) Has been cancelled
Issue Check Inactive / issue-check-inactive (push) Has been cancelled
12 lines
223 B
Go
12 lines
223 B
Go
package middleware
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/go-admin-team/go-admin-core/sdk"
|
|
)
|
|
|
|
func WithContextDb(c *gin.Context) {
|
|
c.Set("db", sdk.Runtime.GetDbByKey(c.Request.Host).WithContext(c))
|
|
c.Next()
|
|
}
|