diff --git a/sqle/api/controller/v1/sql_manage.go b/sqle/api/controller/v1/sql_manage.go index 0253d739bc..6047e93af5 100644 --- a/sqle/api/controller/v1/sql_manage.go +++ b/sqle/api/controller/v1/sql_manage.go @@ -61,7 +61,9 @@ type Source struct { SqlAuditRecordIds []string `json:"sql_audit_record_ids"` } +// todo : 该接口已废弃,后续会删除 // GetSqlManageList +// @Deprecated // @Summary 获取管控sql列表 // @Description get sql manage list // @Tags SqlManage diff --git a/sqle/api/controller/v2/sql_manage_ce.go b/sqle/api/controller/v2/sql_manage_ce.go new file mode 100644 index 0000000000..f9533eb69d --- /dev/null +++ b/sqle/api/controller/v2/sql_manage_ce.go @@ -0,0 +1,13 @@ +//go:build !enterprise +// +build !enterprise + +package v2 + +import ( + v1 "github.com/actiontech/sqle/sqle/api/controller/v1" + "github.com/labstack/echo/v4" +) + +func getSqlManageList(c echo.Context) error { + return v1.ErrCommunityEditionNotSupportSqlManage +} diff --git a/sqle/api/controller/v2/sql_manager_ce.go b/sqle/api/controller/v2/sql_manager_ce.go deleted file mode 100644 index 6a4c35ddff..0000000000 --- a/sqle/api/controller/v2/sql_manager_ce.go +++ /dev/null @@ -1,7 +0,0 @@ -package v2 - -import "github.com/labstack/echo/v4" - -func getSqlManageList(c echo.Context) error { - return nil -} diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index f57e1968f4..2c4b48e57e 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -4736,6 +4736,7 @@ var doc = `{ ], "summary": "获取管控sql列表", "operationId": "GetSqlManageList", + "deprecated": true, "parameters": [ { "type": "string", diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 7a923b0115..612ab90dd1 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -4720,6 +4720,7 @@ ], "summary": "获取管控sql列表", "operationId": "GetSqlManageList", + "deprecated": true, "parameters": [ { "type": "string", diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index b9eb05f490..0bf41cbc32 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -8162,6 +8162,7 @@ paths: - sql_audit_record /v1/projects/{project_name}/sql_manages: get: + deprecated: true description: get sql manage list operationId: GetSqlManageList parameters: diff --git a/sqle/model/sql_manage.go b/sqle/model/sql_manage.go index f49bdb4f0c..f01cebbffc 100644 --- a/sqle/model/sql_manage.go +++ b/sqle/model/sql_manage.go @@ -37,3 +37,13 @@ type SqlManageSqlAuditRecord struct { func (sm SqlManageSqlAuditRecord) TableName() string { return "sql_manage_sql_audit_records" } + +type SqlManageEndpoint struct { + Model + ProjFpSourceInstSchemaMd5 string `json:"proj_fp_source_inst_schema_md5" gorm:"unique_index:uniq_md5_endpoint;"` + Endpoint string `json:"endpoint" gorm:"unique_index:uniq_md5_endpoint;"` +} + +func (sm SqlManageEndpoint) TableName() string { + return "sql_manage_endpoints" +} diff --git a/sqle/model/utils.go b/sqle/model/utils.go index 0247be059b..c58480b9ea 100644 --- a/sqle/model/utils.go +++ b/sqle/model/utils.go @@ -158,6 +158,7 @@ var autoMigrateList = []interface{}{ &SqlManageSqlAuditRecord{}, &BlackListAuditPlanSQL{}, &CompanyNotice{}, + &SqlManageEndpoint{}, } func (s *Storage) AutoMigrate() error {