Skip to content

Commit 4ac8ecf

Browse files
authored
Merge pull request #607 from actiontech/feature/issue-603
[feature](SqlAudit): Support git branch field
2 parents 2eb918a + 8359602 commit 4ac8ecf

File tree

18 files changed

+986
-20
lines changed

18 files changed

+986
-20
lines changed

packages/shared/lib/api/base/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ export { default as CBOperationLogsService } from './service/CBOperationLogs';
33
export { default as CloudBeaverService } from './service/CloudBeaver';
44
export { default as CompanyNoticeService } from './service/CompanyNotice';
55
export { default as ConfigurationService } from './service/Configuration';
6+
export { default as DataExportTaskService } from './service/DataExportTask';
7+
export { default as DataExportWorkflowsService } from './service/DataExportWorkflows';
68
export { default as DBServiceService } from './service/DBService';
79
export { default as DBServiceSyncTaskService } from './service/DBServiceSyncTask';
810
export { default as DMSPluginService } from './service/DMSPlugin';
911
export { default as DMSProxyService } from './service/DMSProxy';
10-
export { default as DataExportTaskService } from './service/DataExportTask';
11-
export { default as DataExportWorkflowsService } from './service/DataExportWorkflows';
1212
export { default as MaskingService } from './service/Masking';
1313
export { default as MemberService } from './service/Member';
1414
export { default as MemberGroupService } from './service/MemberGroup';
@@ -17,8 +17,8 @@ export { default as OAuth2Service } from './service/OAuth2';
1717
export { default as OpPermissionService } from './service/OpPermission';
1818
export { default as ProjectService } from './service/Project';
1919
export { default as RoleService } from './service/Role';
20-
export { default as SMSService } from './service/SMS';
2120
export { default as SessionService } from './service/Session';
21+
export { default as SMSService } from './service/SMS';
2222
export { default as UserService } from './service/User';
2323
export { default as UserGroupService } from './service/UserGroup';
2424
export { default as WebhookService } from './service/Webhook';

packages/shared/lib/api/sqle/index.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
export { default as OperationRecordService } from './service/OperationRecord';
2-
export { default as ReportPushConfigService } from './service/ReportPushConfig';
3-
export { default as SqlDEVRecordService } from './service/SqlDEVRecord';
4-
export { default as SqlManageService } from './service/SqlManage';
51
export { default as AuditPlanService } from './service/audit_plan';
62
export { default as AuditWhitelistService } from './service/audit_whitelist';
73
export { default as BlacklistService } from './service/blacklist';
@@ -13,8 +9,12 @@ export { default as InstanceService } from './service/instance';
139
export { default as InstanceAuditPlanService } from './service/instance_audit_plan';
1410
export { default as KnowledgeBaseService } from './service/knowledge_base';
1511
export { default as OperationService } from './service/operation';
12+
export { default as OperationRecordService } from './service/OperationRecord';
1613
export { default as PipelineService } from './service/pipeline';
14+
export { default as ReportPushConfigService } from './service/ReportPushConfig';
1715
export { default as RuleTemplateService } from './service/rule_template';
16+
export { default as SqlDEVRecordService } from './service/SqlDEVRecord';
17+
export { default as SqlManageService } from './service/SqlManage';
1818
export { default as SqlAnalysisService } from './service/sql_analysis';
1919
export { default as SqlAuditService } from './service/sql_audit';
2020
export { default as SqlAuditRecordService } from './service/sql_audit_record';

packages/shared/lib/api/sqle/service/common.d.ts

+24
Original file line numberDiff line numberDiff line change
@@ -3301,6 +3301,30 @@ export interface ITestFeishuConfigurationReqV1 {
33013301
account_type?: TestFeishuConfigurationReqV1AccountTypeEnum;
33023302
}
33033303

3304+
export interface ITestGitConnectionReqV1 {
3305+
git_http_url?: string;
3306+
3307+
git_user_name?: string;
3308+
3309+
git_user_password?: string;
3310+
}
3311+
3312+
export interface ITestGitConnectionResDataV1 {
3313+
branches?: string[];
3314+
3315+
error_message?: string;
3316+
3317+
is_connected_success?: boolean;
3318+
}
3319+
3320+
export interface ITestGitConnectionResV1 {
3321+
code?: number;
3322+
3323+
data?: ITestGitConnectionResDataV1;
3324+
3325+
message?: string;
3326+
}
3327+
33043328
export interface ITestWechatConfigResDataV1 {
33053329
error_message?: string;
33063330

packages/shared/lib/api/sqle/service/configuration/index.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
IUpdateFeishuConfigurationReqV1,
1313
ITestFeishuConfigurationReqV1,
1414
ITestFeishuConfigResV1,
15+
ITestGitConnectionReqV1,
16+
ITestGitConnectionResV1,
1517
IGetLicenseResV1,
1618
ICheckLicenseResV1,
1719
IGetSystemVariablesResV1,
@@ -62,6 +64,10 @@ export interface ITestFeishuAuditConfigV1Params
6264
export interface ITestFeishuAuditConfigV1Return
6365
extends ITestFeishuConfigResV1 {}
6466

67+
export interface ITestGitConnectionV1Params extends ITestGitConnectionReqV1 {}
68+
69+
export interface ITestGitConnectionV1Return extends ITestGitConnectionResV1 {}
70+
6571
export interface IGetSQLELicenseV1Return extends IGetLicenseResV1 {}
6672

6773
export interface ISetSQLELicenseV1Params {

packages/shared/lib/api/sqle/service/configuration/index.ts

+14
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ import {
2222
IUpdateFeishuAuditConfigurationV1Return,
2323
ITestFeishuAuditConfigV1Params,
2424
ITestFeishuAuditConfigV1Return,
25+
ITestGitConnectionV1Params,
26+
ITestGitConnectionV1Return,
2527
IGetSQLELicenseV1Return,
2628
ISetSQLELicenseV1Params,
2729
ISetSQLELicenseV1Return,
@@ -139,6 +141,18 @@ class ConfigurationService extends ServiceBase {
139141
);
140142
}
141143

144+
public TestGitConnectionV1(
145+
params: ITestGitConnectionV1Params,
146+
options?: AxiosRequestConfig
147+
) {
148+
const paramsData = this.cloneDeep(params);
149+
return this.post<ITestGitConnectionV1Return>(
150+
'/v1/configurations/git/test',
151+
paramsData,
152+
options
153+
);
154+
}
155+
142156
public getSQLELicenseV1(options?: AxiosRequestConfig) {
143157
return this.get<IGetSQLELicenseV1Return>(
144158
'/v1/configurations/license',

packages/shared/lib/api/sqle/service/sql_audit_record/index.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ export interface ICreateSQLAuditRecordV1Params {
5454

5555
git_user_name?: string;
5656

57+
git_branch_name?: string;
58+
5759
git_user_password?: string;
5860
}
5961

packages/shared/lib/api/sqle/service/sql_audit_record/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ class SqlAuditRecordService extends ServiceBase {
9292
paramsData.append('git_user_name', params.git_user_name as any);
9393
}
9494

95+
if (params.git_branch_name != undefined) {
96+
paramsData.append('git_branch_name', params.git_branch_name as any);
97+
}
98+
9599
if (params.git_user_password != undefined) {
96100
paramsData.append('git_user_password', params.git_user_password as any);
97101
}

packages/sqle/src/locale/zh-CN/sqlAudit.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ export default {
8686
zipFile: 'ZIP文件',
8787
gitUrl: 'GIT地址',
8888
gitUrlTips:
89-
'请输入git仓库的HTTP(S)克隆地址,若为私有GIT仓库,则必须输入有读权限的账号密码'
89+
'请输入git仓库的HTTP(S)克隆地址,若为私有GIT仓库,则必须输入有读权限的账号密码',
90+
gitBranch: '代码分支',
91+
verifyConnection: '验证连接',
92+
connectSuccess: '连接成功',
93+
pleaseVerifyConnection: '请先验证仓库连通性'
9094
},
9195
uploadFileTip: {
9296
sqlFile: '点击选择SQL文件或将文件拖拽到此区域',

packages/sqle/src/page/SqlAudit/Create/SQLInfoForm/index.type.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export type SQLInfoFormFields = {
3434
gitHttpUrl: string;
3535
gitUserName: string;
3636
gitUserPassword: string;
37+
gitBranch: string;
3738
};
3839

3940
export type SQLInfoFormProps = {

0 commit comments

Comments
 (0)