update:
- pgsql 获取表名, 获取表字段(todo), 获取数据库名 refactor: - 自动化代码与自动化代码历史 代码规范化 - mysql 获取表名, 获取表字段, 获取数据库名 - enter 代码优化
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/global"
|
||||
"github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
|
||||
)
|
||||
|
||||
type Database interface {
|
||||
GetDB() (data []response.Db, err error)
|
||||
GetTables(dbName string) (data []response.Table, err error)
|
||||
GetColumn(tableName string, dbName string) (data []response.Column, err error)
|
||||
}
|
||||
|
||||
func (autoCodeService *AutoCodeService) Database() Database {
|
||||
switch global.GVA_CONFIG.System.DbType {
|
||||
case "mysql":
|
||||
return AutoCodeMysql
|
||||
case "pgsql":
|
||||
return AutoCodePgsql
|
||||
default:
|
||||
return AutoCodeMysql
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user