| 12345678910111213141516 |
- package functions
-
- import (
- "github.com/gin-gonic/gin"
-
- "git.x2erp.com/qdy/go-base/types"
- "git.x2erp.com/qdy/go-db/factory"
- )
-
- // 执行查询,返回JSON格式数据
- func QueryToJSON(dbFactory *factory.DBFactory) func(c *gin.Context, req types.QueryRequest) {
- return func(c *gin.Context, req types.QueryRequest) {
- result := dbFactory.QueryToJSON(req.SQL)
- c.JSON(200, result)
- }
- }
|