diff --git a/sqle/api/controller/v1/configuration.go b/sqle/api/controller/v1/configuration.go index a65bc4442..365574dbd 100644 --- a/sqle/api/controller/v1/configuration.go +++ b/sqle/api/controller/v1/configuration.go @@ -403,7 +403,7 @@ type TestCodingConfigurationReqV1 struct { } // TestCodingConfigV1 -// @Summary 测试Coding审批配置 +// @Summary 测试Coding配置 // @Description test coding configuration // @Accept json // @Id testCodingConfigV1 @@ -411,7 +411,7 @@ type TestCodingConfigurationReqV1 struct { // @Param req body v1.TestCodingConfigurationReqV1 true "test coding configuration req" // @Security ApiKeyAuth // @Success 200 {object} v1.TestCodingConfigResV1 -// @router /v1/configurations/coding_audit/test [post] +// @router /v1/configurations/coding/test [post] func TestCodingConfigV1(c echo.Context) error { return testCodingAuditConfigV1(c) } diff --git a/sqle/api/controller/v1/sql_manage.go b/sqle/api/controller/v1/sql_manage.go index 3410e5b74..191d0d5b6 100644 --- a/sqle/api/controller/v1/sql_manage.go +++ b/sqle/api/controller/v1/sql_manage.go @@ -128,11 +128,28 @@ type CodingPriority string const ( CodingPriorityLow CodingPriority = "LOW" - CodingPriorityMedium CodingPriority = "MEDIUM" - CodingPriorityHigh CodingPriority = "HIGH" - CodingPriorityEmergency CodingPriority = "EMERGENCY" + CodingPriorityMedium = "MEDIUM" + CodingPriorityHigh = "HIGH" + CodingPriorityEmergency = "EMERGENCY" ) +func (codingPriority CodingPriority) Weight() string { + weight := "-1" + switch codingPriority { + case CodingPriorityLow: + weight = "0" + case CodingPriorityMedium: + weight = "1" + case CodingPriorityHigh: + weight = "2" + case CodingPriorityEmergency: + weight = "3" + default: + weight = "-1" + } + return weight +} + // BatchUpdateSqlManage batch update sql manage // @Summary 批量更新SQL管控 // @Description batch update sql manage diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 2dc8247be..c3966a9b1 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -238,7 +238,7 @@ var doc = `{ } } }, - "/v1/configurations/coding_audit/test": { + "/v1/configurations/coding/test": { "post": { "security": [ { @@ -252,7 +252,7 @@ var doc = `{ "tags": [ "configuration" ], - "summary": "测试Coding审批配置", + "summary": "测试Coding配置", "operationId": "testCodingConfigV1", "parameters": [ { diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 4787fb572..2443ba905 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -222,7 +222,7 @@ } } }, - "/v1/configurations/coding_audit/test": { + "/v1/configurations/coding/test": { "post": { "security": [ { @@ -236,7 +236,7 @@ "tags": [ "configuration" ], - "summary": "测试Coding审批配置", + "summary": "测试Coding配置", "operationId": "testCodingConfigV1", "parameters": [ { diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index b3a233e68..b3a7951ba 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -6307,7 +6307,7 @@ paths: summary: 添加或更新Coding配置 tags: - configuration - /v1/configurations/coding_audit/test: + /v1/configurations/coding/test: post: consumes: - application/json @@ -6327,7 +6327,7 @@ paths: $ref: '#/definitions/v1.TestCodingConfigResV1' security: - ApiKeyAuth: [] - summary: 测试Coding审批配置 + summary: 测试Coding配置 tags: - configuration /v1/configurations/ding_talk: diff --git a/sqle/model/configuration.go b/sqle/model/configuration.go index b3c4727af..2ae5de566 100644 --- a/sqle/model/configuration.go +++ b/sqle/model/configuration.go @@ -109,6 +109,7 @@ const ( ImTypeDingTalk = "dingTalk" ImTypeFeishuAudit = "feishu_audit" ImTypeWechatAudit = "wechat_audit" + ImTypeCoding = "coding" ) type IM struct {