You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
586 B

  1. package system
  2. import (
  3. "github.com/flipped-aurora/gin-vue-admin/server/global"
  4. "github.com/flipped-aurora/gin-vue-admin/server/model/system/response"
  5. )
  6. type Database interface {
  7. GetDB() (data []response.Db, err error)
  8. GetTables(dbName string) (data []response.Table, err error)
  9. GetColumn(tableName string, dbName string) (data []response.Column, err error)
  10. }
  11. func (autoCodeService *AutoCodeService) Database() Database {
  12. switch global.GVA_CONFIG.System.DbType {
  13. case "mysql":
  14. return AutoCodeMysql
  15. case "pgsql":
  16. return AutoCodePgsql
  17. default:
  18. return AutoCodeMysql
  19. }
  20. }