mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-21 10:13:01 +00:00
feat: Interception of sqlite and pgsql database types in code generation
This commit is contained in:
@@ -5,6 +5,7 @@ import (
|
||||
"go-admin/models/tools"
|
||||
tools2 "go-admin/tools"
|
||||
"go-admin/tools/app"
|
||||
"go-admin/tools/config"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -22,11 +23,11 @@ func GetDBTableList(c *gin.Context) {
|
||||
var err error
|
||||
var pageSize = 10
|
||||
var pageIndex = 1
|
||||
//if config2.DatabaseConfig.Driver=="sqlite3"{
|
||||
// res.Msg="对不起,sqlite3 暂不支持代码生成!"
|
||||
// c.JSON(http.StatusOK, res.ReturnError(500))
|
||||
// return
|
||||
//}
|
||||
if config.DatabaseConfig.Driver == "sqlite3" || config.DatabaseConfig.Driver == "postgres" {
|
||||
res.Msg = "对不起,sqlite3 或 postgres 不支持代码生成!"
|
||||
c.JSON(http.StatusOK, res.ReturnError(500))
|
||||
return
|
||||
}
|
||||
|
||||
if size := c.Request.FormValue("pageSize"); size != "" {
|
||||
pageSize = tools2.StrToInt(err, size)
|
||||
@@ -46,7 +47,6 @@ func GetDBTableList(c *gin.Context) {
|
||||
mp["pageIndex"] = pageIndex
|
||||
mp["pageSize"] = pageSize
|
||||
|
||||
|
||||
res.Data = mp
|
||||
|
||||
c.JSON(http.StatusOK, res.ReturnOK())
|
||||
|
||||
Reference in New Issue
Block a user