Skip to content

Commit 41937b6

Browse files
committed
feat: add SQLType field to AuditSQLResV2 and update task conversion functions
1 parent 31f38fc commit 41937b6

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

sqle/api/controller/v2/sql_audit.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ type AuditSQLResV2 struct {
3838
ExecSQL string `json:"exec_sql"`
3939
AuditResult []AuditResult `json:"audit_result"`
4040
AuditLevel string `json:"audit_level"`
41+
SQLType string `json:"sql_type"`
4142
}
4243

4344
type DirectAuditResV2 struct {
@@ -91,6 +92,7 @@ func convertTaskResultToAuditResV2(ctx context.Context, task *model.Task) *Audit
9192
ExecSQL: sql.Content,
9293
AuditResult: convertAuditResultToAuditResV2(ctx, sql.AuditResults),
9394
AuditLevel: sql.AuditLevel,
95+
SQLType: sql.SQLType,
9496
}
9597

9698
}
@@ -212,6 +214,7 @@ func convertFileAuditTaskResultToAuditResV2(ctx context.Context, task *model.Tas
212214
ExecSQL: sql.Content,
213215
AuditResult: convertAuditResultToAuditResV2(ctx, sql.AuditResults),
214216
AuditLevel: sql.AuditLevel,
217+
SQLType: sql.SQLType,
215218
}
216219

217220
}

sqle/server/audit.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ func convertSQLsToTask(sql string, p driver.Plugin) (*model.Task, error) {
126126
BaseSQL: model.BaseSQL{
127127
Number: uint(n + 1),
128128
Content: node.Text,
129+
SQLType: node.Type,
129130
},
130131
})
131132
}

0 commit comments

Comments
 (0)