Skip to content

Commit

Permalink
Merge pull request #2816 from actiontech/fix_coding_feat
Browse files Browse the repository at this point in the history
fix: update test coding url coding priority
  • Loading branch information
LordofAvernus authored Dec 11, 2024
2 parents 7dac52b + 8cfed16 commit 28f30c7
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
4 changes: 2 additions & 2 deletions sqle/api/controller/v1/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -403,15 +403,15 @@ type TestCodingConfigurationReqV1 struct {
}

// TestCodingConfigV1
// @Summary 测试Coding审批配置
// @Summary 测试Coding配置
// @Description test coding configuration
// @Accept json
// @Id testCodingConfigV1
// @Tags configuration
// @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)
}
Expand Down
23 changes: 20 additions & 3 deletions sqle/api/controller/v1/sql_manage.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ var doc = `{
}
}
},
"/v1/configurations/coding_audit/test": {
"/v1/configurations/coding/test": {
"post": {
"security": [
{
Expand All @@ -252,7 +252,7 @@ var doc = `{
"tags": [
"configuration"
],
"summary": "测试Coding审批配置",
"summary": "测试Coding配置",
"operationId": "testCodingConfigV1",
"parameters": [
{
Expand Down
4 changes: 2 additions & 2 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@
}
}
},
"/v1/configurations/coding_audit/test": {
"/v1/configurations/coding/test": {
"post": {
"security": [
{
Expand All @@ -236,7 +236,7 @@
"tags": [
"configuration"
],
"summary": "测试Coding审批配置",
"summary": "测试Coding配置",
"operationId": "testCodingConfigV1",
"parameters": [
{
Expand Down
4 changes: 2 additions & 2 deletions sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6307,7 +6307,7 @@ paths:
summary: 添加或更新Coding配置
tags:
- configuration
/v1/configurations/coding_audit/test:
/v1/configurations/coding/test:
post:
consumes:
- application/json
Expand All @@ -6327,7 +6327,7 @@ paths:
$ref: '#/definitions/v1.TestCodingConfigResV1'
security:
- ApiKeyAuth: []
summary: 测试Coding审批配置
summary: 测试Coding配置
tags:
- configuration
/v1/configurations/ding_talk:
Expand Down
1 change: 1 addition & 0 deletions sqle/model/configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ const (
ImTypeDingTalk = "dingTalk"
ImTypeFeishuAudit = "feishu_audit"
ImTypeWechatAudit = "wechat_audit"
ImTypeCoding = "coding"
)

type IM struct {
Expand Down

0 comments on commit 28f30c7

Please sign in to comment.