healchow commented on code in PR #8424:
URL: https://github.com/apache/inlong/pull/8424#discussion_r1254024474
##########
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 = "insert a source and connect to the source")
+ @PostMapping(value = "/audit/updateSource")
+ public Response<Boolean> updateAuditQuerySource(@RequestBody
UpdateAuditSourceRequest request) {
+ return Response.success(
+ auditService.updateAuditQuerySource(request));
+ }
+
+ @ApiOperation(value = "query which source is connected")
+ @GetMapping("/audit/querySource")
Review Comment:
1. Please change the API and method name to `getSource`, in order to
facilitate the subsequent expansion of the listSources interface, the interface
format will be unified.
2. Entity is used by DB and cannot be returned directly as a parameter. You
should learn from other interfaces, such as getComponentHeartbeat, to convert
Entity into Response and return it.
##########
inlong-manager/manager-web/sql/changes-1.8.0.sql:
##########
@@ -84,6 +84,21 @@ UPDATE inlong_cluster SET ext_params = replace(ext_params,
'"tenant"', '"pulsarT
ALTER TABLE `inlong_stream` MODIFY COLUMN `name` varchar(256) DEFAULT NULL
COMMENT 'The name of the inlong stream page display, can be Chinese';
+
+CREATE TABLE IF NOT EXISTS `audit_query_source_config`
Review Comment:
`audit_source` is enough, `info`, `table`, `config`, and other vague
meanings should not appear in the naming of tables.
##########
inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/resource/sink/ck/ClickHouseConfig.java:
##########
@@ -30,45 +36,66 @@
* Clickhouse config information, including url, user, etc.
*/
@Component
+@Service
Review Comment:
Duplicated, maybe use `Configuration` is enough.
##########
inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/audit/UpdateAuditSourceRequest.java:
##########
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.inlong.manager.pojo.audit;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.validation.constraints.NotBlank;
+
+@Data
+@EqualsAndHashCode(callSuper = false)
+@ApiModel("Update audit query source request")
+public class UpdateAuditSourceRequest {
Review Comment:
-> `AuditSourceRequest`, there is no need to specify Update, as the save
interface can use it as well.
##########
inlong-manager/manager-web/sql/changes-1.8.0.sql:
##########
@@ -84,6 +84,21 @@ UPDATE inlong_cluster SET ext_params = replace(ext_params,
'"tenant"', '"pulsarT
ALTER TABLE `inlong_stream` MODIFY COLUMN `name` varchar(256) DEFAULT NULL
COMMENT 'The name of the inlong stream page display, can be Chinese';
+
+CREATE TABLE IF NOT EXISTS `audit_query_source_config`
+(
+ `audit_query_source` varchar(256) NOT NULL COMMENT 'MYSQL,
ELASTICSEARCH, CLICKHOUSE' ,
Review Comment:
`source_type` is enough.
--
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]