fuweng11 commented on code in PR #8424:
URL: https://github.com/apache/inlong/pull/8424#discussion_r1255767566


##########
inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql:
##########
@@ -846,6 +846,29 @@ VALUES ('audit_sdk_collect', 'SDK', 0, '1'),
        ('audit_sort_postgres_input', 'POSTGRESQL', 0, '27'),
        ('audit_sort_postgres_output', 'POSTGRESQL', 1, '28');
 
+-- ----------------------------
+-- Table structure for audit_source
+-- ----------------------------
+CREATE TABLE IF NOT EXISTS `audit_source`
+(
+    `id`          int(11)      NOT NULL AUTO_INCREMENT,
+    `source_type` varchar(256) NOT NULL COMMENT 'Source type, including: 
MYSQL, CLICKHOUSE, ELASTICSEARCH',
+    `source_url`  varchar(256) NOT NULL COMMENT 'Source URL, for MYSQL or 
CLICKHOUSE, is jdbcUrl, and for ELASTICSEARCH is the access URL with 
hostname:port',
+    `auth_enable` tinyint(1)            DEFAULT '1' COMMENT 'Enable auth or 
not, 0: disable, 1: enable',
+    `username`    varchar(256) NOT NULL COMMENT 'Source username, needed if 
auth_enable is 1' ,
+    `password`    varchar(256) NOT NULL COMMENT 'Source password, needed if 
auth_enable is 1',
+    `status`      smallint(4)  NOT NULL DEFAULT '0' COMMENT 'Whether the audit 
source is online or offline, 0: offline, 1: online' ,
+    `creator`     varchar(256) NOT NULL COMMENT 'Creator',
+    `create_time` timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 
'Create time',
+    `modifier`    varchar(256) NOT NULL COMMENT 'Modifier',
+    `modify_time` timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE 
CURRENT_TIMESTAMP COMMENT 'Modify time',
+    `is_deleted`  tinyint(1)   NOT NULL DEFAULT '0' COMMENT 'Is this audit 
source deleted, 0: no, 1: yes',
+    `version`     int(11)      NOT NULL DEFAULT '1' COMMENT 'Version number, 
which will be incremented by 1 after modification',
+    PRIMARY KEY (`id`),
+    UNIQUE KEY `unique_source_url` (`source_url`, `is_deleted`)
+    ) ENGINE = InnoDB
+    DEFAULT CHARSET = utf8mb4 COMMENT ='Audit source table';

Review Comment:
   ```suggestion
       );
   ```



##########
inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/AuditController.java:
##########
@@ -59,4 +62,17 @@ public Response<Boolean> refreshCache() {
         return Response.success(auditService.refreshBaseItemCache());
     }
 
+    @ApiOperation(value = "Offline the old audit source and online the new 
audit source")
+    @PostMapping(value = "/audit/updateSource")
+    public Response<Boolean> updateAuditQuerySource(@RequestBody 
AuditSourceRequest request) {
+        return Response.success(

Review Comment:
   ```suggestion
           return 
Response.success(auditService.updateAuditQuerySource(request));
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to