3 Star 3 Fork 1

三三物联网 / ssiot-core

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
contextdb.go 230 Bytes
一键复制 编辑 原始数据 按行查看 历史
三三物联网 提交于 2023-04-03 00:22 . 重构
package middleware
import (
"gitee.com/sansaniot/ssiot-core/facade/runtime"
"github.com/gin-gonic/gin"
)
func WithContextDb(c *gin.Context) {
c.Set("db", runtime.Runtime.GetDbByKey(c.Request.Host).WithContext(c))
c.Next()
}
1
https://gitee.com/sansaniot/ssiot-core.git
git@gitee.com:sansaniot/ssiot-core.git
sansaniot
ssiot-core
ssiot-core
v1.7.7

搜索帮助