This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 160253ca8b [INLONG-10335][Manager] Use audit sdk to obtain audit ID 
(#10336)
160253ca8b is described below

commit 160253ca8bc11466d12f08c147bc90f82d3c2fb5
Author: fuweng11 <[email protected]>
AuthorDate: Mon Jun 3 19:10:33 2024 +0800

    [INLONG-10335][Manager] Use audit sdk to obtain audit ID (#10336)
---
 .../apache/inlong/common/enums/IndicatorType.java  | 13 +++-
 .../inlong/manager/dao/entity/AuditBaseEntity.java | 35 -----------
 .../manager/dao/mapper/AuditBaseEntityMapper.java  | 41 ------------
 .../resources/mappers/AuditBaseEntityMapper.xml    | 72 ----------------------
 .../manager/pojo/audit/AuditBaseResponse.java      | 44 -------------
 inlong-manager/manager-service/pom.xml             | 11 ++++
 .../inlong/manager/service/core/AuditService.java  |  4 +-
 .../service/core/impl/AuditServiceImpl.java        | 64 ++++++++++---------
 .../main/resources/h2/apache_inlong_manager.sql    | 54 ----------------
 .../manager-web/sql/apache_inlong_manager.sql      | 68 --------------------
 .../manager/web/controller/AuditController.java    |  4 +-
 11 files changed, 58 insertions(+), 352 deletions(-)

diff --git 
a/inlong-common/src/main/java/org/apache/inlong/common/enums/IndicatorType.java 
b/inlong-common/src/main/java/org/apache/inlong/common/enums/IndicatorType.java
index b27c926e8f..0a562c9a78 100644
--- 
a/inlong-common/src/main/java/org/apache/inlong/common/enums/IndicatorType.java
+++ 
b/inlong-common/src/main/java/org/apache/inlong/common/enums/IndicatorType.java
@@ -53,6 +53,18 @@ public enum IndicatorType {
         return UNKNOWN_TYPE;
     }
 
+    public static Boolean isFailedType(IndicatorType indicatorType) {
+        return RECEIVED_FAILED.equals(indicatorType) || 
SEND_FAILED.equals(indicatorType);
+    }
+
+    public static Boolean isDiscardType(IndicatorType indicatorType) {
+        return RECEIVED_DISCARD.equals(indicatorType) || 
SEND_DISCARD.equals(indicatorType);
+    }
+
+    public static Boolean isRetryType(IndicatorType indicatorType) {
+        return RECEIVED_RETRY.equals(indicatorType) || 
SEND_RETRY.equals(indicatorType);
+    }
+
     public int getCode() {
         return code;
     }
@@ -64,5 +76,4 @@ public enum IndicatorType {
     public String getDesc() {
         return desc;
     }
-
 }
diff --git 
a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/AuditBaseEntity.java
 
b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/AuditBaseEntity.java
deleted file mode 100644
index e4ed92d236..0000000000
--- 
a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/entity/AuditBaseEntity.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * 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.dao.entity;
-
-import lombok.Data;
-
-/**
- * Audit base info
- */
-@Data
-public class AuditBaseEntity {
-
-    private static final long serialVersionUID = 1L;
-    private Integer id;
-    private String name;
-    private String type;
-    private Integer indicatorType;
-    private String auditId;
-
-}
diff --git 
a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/AuditBaseEntityMapper.java
 
b/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/AuditBaseEntityMapper.java
deleted file mode 100644
index 8e3c8fdb44..0000000000
--- 
a/inlong-manager/manager-dao/src/main/java/org/apache/inlong/manager/dao/mapper/AuditBaseEntityMapper.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * 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.dao.mapper;
-
-import org.apache.inlong.manager.dao.entity.AuditBaseEntity;
-
-import org.apache.ibatis.annotations.Param;
-import org.springframework.stereotype.Repository;
-
-import java.util.List;
-
-@Repository
-public interface AuditBaseEntityMapper {
-
-    int insert(AuditBaseEntity record);
-
-    List<AuditBaseEntity> selectAll();
-
-    AuditBaseEntity selectByPrimaryKey(Integer id);
-
-    AuditBaseEntity selectByType(@Param("type") String type);
-
-    AuditBaseEntity selectByTypeAndIndicatorType(@Param("type") String type,
-            @Param("indicatorType") Integer indicatorType);
-
-}
diff --git 
a/inlong-manager/manager-dao/src/main/resources/mappers/AuditBaseEntityMapper.xml
 
b/inlong-manager/manager-dao/src/main/resources/mappers/AuditBaseEntityMapper.xml
deleted file mode 100644
index 6ac240d214..0000000000
--- 
a/inlong-manager/manager-dao/src/main/resources/mappers/AuditBaseEntityMapper.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    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.
--->
-
-<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd";>
-<mapper namespace="org.apache.inlong.manager.dao.mapper.AuditBaseEntityMapper">
-    <resultMap id="BaseResultMap" 
type="org.apache.inlong.manager.dao.entity.AuditBaseEntity">
-        <id column="id" jdbcType="INTEGER" property="id"/>
-        <result column="name" jdbcType="VARCHAR" property="name"/>
-        <result column="type" jdbcType="VARCHAR" property="type"/>
-        <result column="indicator_type" jdbcType="INTEGER" 
property="indicatorType"/>
-        <result column="audit_id" jdbcType="VARCHAR" property="auditId"/>
-    </resultMap>
-    <sql id="Base_Column_List">
-        id, name, type, indicator_type, audit_id
-    </sql>
-    <insert id="insert" useGeneratedKeys="true" keyProperty="id"
-            
parameterType="org.apache.inlong.manager.dao.entity.AuditBaseEntity">
-        insert into audit_base (id, name, type, indicator_type, audit_id)
-        values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
-                #{type,jdbcType=VARCHAR}, #{indicatorType,jdbcType=INTEGER},
-                #{auditId,jdbcType=VARCHAR})
-    </insert>
-
-    <select id="selectAll" 
resultType="org.apache.inlong.manager.dao.entity.AuditBaseEntity">
-        select
-        <include refid="Base_Column_List"/>
-        from audit_base
-    </select>
-
-    <select id="selectByPrimaryKey" parameterType="java.lang.Integer" 
resultMap="BaseResultMap">
-        select
-        <include refid="Base_Column_List"/>
-        from audit_base
-        where id = #{id,jdbcType=INTEGER}
-    </select>
-
-    <select id="selectByType" 
resultType="org.apache.inlong.manager.dao.entity.AuditBaseEntity">
-        select
-        <include refid="Base_Column_List"/>
-        from audit_base
-        <where>
-            <if test="type != null and type != ''">
-                and type = #{type, jdbcType=VARCHAR}
-            </if>
-        </where>
-    </select>
-    <select id="selectByTypeAndIndicatorType" 
resultType="org.apache.inlong.manager.dao.entity.AuditBaseEntity">
-        select
-        <include refid="Base_Column_List"/>
-        from audit_base
-        where type = #{type, jdbcType=VARCHAR}
-        and indicator_type = #{indicatorType, jdbcType=INTEGER}
-    </select>
-
-</mapper>
diff --git 
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/audit/AuditBaseResponse.java
 
b/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/audit/AuditBaseResponse.java
deleted file mode 100644
index a404b702e4..0000000000
--- 
a/inlong-manager/manager-pojo/src/main/java/org/apache/inlong/manager/pojo/audit/AuditBaseResponse.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * 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.ApiModelProperty;
-import lombok.Data;
-
-/**
- * Audit base info
- */
-@Data
-public class AuditBaseResponse {
-
-    @ApiModelProperty(value = "Audit log timestamp")
-    private Integer id;
-
-    @ApiModelProperty(value = "Audit name")
-    private String name;
-
-    @ApiModelProperty(value = "Audit type")
-    private String type;
-
-    @ApiModelProperty(value = "Indicator type")
-    private Integer indicatorType;
-
-    @ApiModelProperty(value = "Audit id")
-    private String auditId;
-
-}
diff --git a/inlong-manager/manager-service/pom.xml 
b/inlong-manager/manager-service/pom.xml
index 1b300dfc34..2f9878db47 100644
--- a/inlong-manager/manager-service/pom.xml
+++ b/inlong-manager/manager-service/pom.xml
@@ -469,6 +469,17 @@
             <groupId>redis.clients</groupId>
             <artifactId>jedis</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.apache.inlong</groupId>
+            <artifactId>audit-sdk</artifactId>
+            <version>${project.version}</version>
+            <exclusions>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-simple</artifactId>
+                </exclusion>
+            </exclusions>
+        </dependency>
         <dependency>
             <groupId>org.apache.inlong</groupId>
             <artifactId>sdk-common</artifactId>
diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AuditService.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AuditService.java
index 77fdfd87fa..c4b5844892 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AuditService.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/AuditService.java
@@ -17,8 +17,8 @@
 
 package org.apache.inlong.manager.service.core;
 
+import org.apache.inlong.audit.entity.AuditInformation;
 import org.apache.inlong.common.enums.IndicatorType;
-import org.apache.inlong.manager.pojo.audit.AuditBaseResponse;
 import org.apache.inlong.manager.pojo.audit.AuditRequest;
 import org.apache.inlong.manager.pojo.audit.AuditVO;
 
@@ -45,7 +45,7 @@ public interface AuditService {
      */
     List<AuditVO> listAll(AuditRequest request) throws Exception;
 
-    List<AuditBaseResponse> getAuditBases();
+    List<AuditInformation> getAuditBases();
 
     /**
      * Get audit id by type and indicator type.
diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java
index 8230771b76..6ec2b2d370 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/AuditServiceImpl.java
@@ -17,6 +17,9 @@
 
 package org.apache.inlong.manager.service.core.impl;
 
+import org.apache.inlong.audit.AuditOperator;
+import org.apache.inlong.audit.entity.AuditInformation;
+import org.apache.inlong.audit.entity.FlowType;
 import org.apache.inlong.common.enums.IndicatorType;
 import org.apache.inlong.manager.common.consts.InlongConstants;
 import org.apache.inlong.manager.common.consts.SourceType;
@@ -25,18 +28,14 @@ import org.apache.inlong.manager.common.enums.ClusterType;
 import org.apache.inlong.manager.common.enums.ErrorCodeEnum;
 import org.apache.inlong.manager.common.enums.TimeStaticsDim;
 import org.apache.inlong.manager.common.exceptions.BusinessException;
-import org.apache.inlong.manager.common.util.CommonBeanUtils;
 import org.apache.inlong.manager.common.util.Preconditions;
-import org.apache.inlong.manager.dao.entity.AuditBaseEntity;
 import org.apache.inlong.manager.dao.entity.InlongGroupEntity;
 import org.apache.inlong.manager.dao.entity.StreamSinkEntity;
 import org.apache.inlong.manager.dao.entity.StreamSourceEntity;
-import org.apache.inlong.manager.dao.mapper.AuditBaseEntityMapper;
 import org.apache.inlong.manager.dao.mapper.AuditEntityMapper;
 import org.apache.inlong.manager.dao.mapper.InlongGroupEntityMapper;
 import org.apache.inlong.manager.dao.mapper.StreamSinkEntityMapper;
 import org.apache.inlong.manager.dao.mapper.StreamSourceEntityMapper;
-import org.apache.inlong.manager.pojo.audit.AuditBaseResponse;
 import org.apache.inlong.manager.pojo.audit.AuditInfo;
 import org.apache.inlong.manager.pojo.audit.AuditRequest;
 import org.apache.inlong.manager.pojo.audit.AuditVO;
@@ -96,8 +95,8 @@ public class AuditServiceImpl implements AuditService {
     private static final DateTimeFormatter HOUR_DATE_FORMATTER = 
DateTimeFormat.forPattern(HOUR_FORMAT);
     private static final DateTimeFormatter DAY_DATE_FORMATTER = 
DateTimeFormat.forPattern(DAY_FORMAT);
     // key 1: type of audit, like pulsar, hive, key 2: indicator type, value : 
entity of audit base item
-    private final Map<String, Map<Integer, AuditBaseEntity>> auditIndicatorMap 
= new ConcurrentHashMap<>();
-    private final Map<String, AuditBaseEntity> auditItemMap = new 
ConcurrentHashMap<>();
+    private final Map<String, Map<Integer, AuditInformation>> 
auditIndicatorMap = new ConcurrentHashMap<>();
+    private final Map<String, AuditInformation> auditItemMap = new 
ConcurrentHashMap<>();
     private ScheduledExecutorService executor = 
Executors.newScheduledThreadPool(10);
     // defaults to return all audit ids, can be overwritten in properties file
     // see audit id definitions: 
https://inlong.apache.org/docs/modules/audit/overview#audit-id
@@ -111,8 +110,6 @@ public class AuditServiceImpl implements AuditService {
     @Value("${audit.query.url:http://127.0.0.1:10080}";)
     private String auditQueryUrl;
 
-    @Autowired
-    private AuditBaseEntityMapper auditBaseMapper;
     @Autowired
     private AuditEntityMapper auditEntityMapper;
     @Autowired
@@ -138,13 +135,7 @@ public class AuditServiceImpl implements AuditService {
     public Boolean refreshBaseItemCache() {
         LOGGER.debug("start to reload audit base item info");
         try {
-            List<AuditBaseEntity> auditBaseEntities = 
auditBaseMapper.selectAll();
-            for (AuditBaseEntity auditBaseEntity : auditBaseEntities) {
-                auditItemMap.put(auditBaseEntity.getAuditId(), 
auditBaseEntity);
-                String type = auditBaseEntity.getType();
-                Map<Integer, AuditBaseEntity> itemMap = 
auditIndicatorMap.computeIfAbsent(type, v -> new HashMap<>());
-                itemMap.put(auditBaseEntity.getIndicatorType(), 
auditBaseEntity);
-            }
+            auditIndicatorMap.clear();
         } catch (Throwable t) {
             LOGGER.error("failed to reload audit base item info", t);
             return false;
@@ -159,16 +150,21 @@ public class AuditServiceImpl implements AuditService {
         if (StringUtils.isBlank(type)) {
             return null;
         }
-        Map<Integer, AuditBaseEntity> itemMap = 
auditIndicatorMap.computeIfAbsent(type, v -> new HashMap<>());
-        AuditBaseEntity auditBaseEntity = itemMap.get(indicatorType.getCode());
-        if (auditBaseEntity != null) {
-            return auditBaseEntity.getAuditId();
+        Map<Integer, AuditInformation> itemMap = 
auditIndicatorMap.computeIfAbsent(type, v -> new HashMap<>());
+        AuditInformation auditInformation = 
itemMap.get(indicatorType.getCode());
+        if (auditInformation != null) {
+            return String.valueOf(auditInformation.getAuditId());
         }
-        auditBaseEntity = auditBaseMapper.selectByTypeAndIndicatorType(type, 
indicatorType.getCode());
-        Preconditions.expectNotNull(auditBaseEntity, 
ErrorCodeEnum.AUDIT_ID_TYPE_NOT_SUPPORTED,
+        FlowType flowType = indicatorType.getCode() % 2 == 0 ? FlowType.INPUT 
: FlowType.OUTPUT;
+        auditInformation = 
AuditOperator.getInstance().buildAuditInformation(type, flowType,
+                IndicatorType.isFailedType(indicatorType),
+                true,
+                IndicatorType.isDiscardType(indicatorType),
+                IndicatorType.isRetryType(indicatorType));
+        Preconditions.expectNotNull(auditInformation, 
ErrorCodeEnum.AUDIT_ID_TYPE_NOT_SUPPORTED,
                 
String.format(ErrorCodeEnum.AUDIT_ID_TYPE_NOT_SUPPORTED.getMessage(), type));
-        itemMap.put(auditBaseEntity.getIndicatorType(), auditBaseEntity);
-        return auditBaseEntity.getAuditId();
+        itemMap.put(indicatorType.getCode(), auditInformation);
+        return String.valueOf(auditInformation.getAuditId());
     }
 
     @Override
@@ -225,8 +221,8 @@ public class AuditServiceImpl implements AuditService {
         AuditQuerySource querySource = 
AuditQuerySource.valueOf(auditQuerySource);
         CountDownLatch latch = new 
CountDownLatch(request.getAuditIds().size());
         for (String auditId : request.getAuditIds()) {
-            AuditBaseEntity auditBaseEntity = auditItemMap.get(auditId);
-            String auditName = auditBaseEntity != null ? 
auditBaseEntity.getName() : "";
+            AuditInformation auditInformation = auditItemMap.get(auditId);
+            String auditName = auditInformation != null ? 
auditInformation.getNameInChinese() : "";
 
             if (AuditQuerySource.MYSQL == querySource) {
                 String format = "%Y-%m-%d %H:%i:00";
@@ -269,17 +265,19 @@ public class AuditServiceImpl implements AuditService {
         AuditQuerySource querySource = 
AuditQuerySource.valueOf(auditQuerySource);
         CountDownLatch latch = new 
CountDownLatch(request.getAuditIds().size());
         for (String auditId : request.getAuditIds()) {
-            AuditBaseEntity auditBaseEntity = auditItemMap.get(auditId);
+            AuditInformation auditInformation = auditItemMap.get(auditId);
             String auditName = "";
-            if (auditBaseEntity != null) {
-                auditName = auditBaseEntity.getName();
+            if (auditInformation != null) {
+                auditName = auditInformation.getNameInChinese();
             }
             if (AuditQuerySource.MYSQL == querySource) {
                 // Support min agg at now
                 DateTime endDate = 
SECOND_DATE_FORMATTER.parseDateTime(request.getEndDate());
                 String endDateStr = 
endDate.plusDays(1).toString(SECOND_DATE_FORMATTER);
-                List<Map<String, Object>> sumList = 
auditEntityMapper.sumGroupByIp(request.getInlongGroupId(),
-                        request.getInlongStreamId(), request.getIp(), auditId, 
request.getStartDate(), endDateStr);
+                List<Map<String, Object>> sumList = 
auditEntityMapper.sumGroupByIp(
+                        request.getInlongGroupId(), 
request.getInlongStreamId(), request.getIp(), auditId,
+                        request.getStartDate(),
+                        endDateStr);
                 List<AuditInfo> auditSet = sumList.stream().map(s -> {
                     AuditInfo vo = new AuditInfo();
                     vo.setInlongGroupId((String) s.get("inlongGroupId"));
@@ -304,9 +302,9 @@ public class AuditServiceImpl implements AuditService {
     }
 
     @Override
-    public List<AuditBaseResponse> getAuditBases() {
-        List<AuditBaseEntity> auditBaseEntityList = 
auditBaseMapper.selectAll();
-        return CommonBeanUtils.copyListProperties(auditBaseEntityList, 
AuditBaseResponse::new);
+    public List<AuditInformation> getAuditBases() {
+        List<AuditInformation> auditInformations = 
AuditOperator.getInstance().getAllAuditInformation();
+        return auditInformations;
     }
 
     private List<String> getAuditIds(String groupId, String streamId, String 
sourceNodeType, String sinkNodeType) {
diff --git 
a/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql 
b/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
index 8f20196352..79d19a57e1 100644
--- 
a/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
+++ 
b/inlong-manager/manager-test/src/main/resources/h2/apache_inlong_manager.sql
@@ -804,60 +804,6 @@ INSERT INTO `inlong_tenant`(`name`, `description`, 
`creator`, `modifier`)
 VALUES ('public', 'Default tenant', 'admin', 'admin'),
        ('another', 'Another tenant', 'admin', 'admin');
 
--- ----------------------------
--- Table structure for audit_base
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `audit_base`
-(
-    `id`               int(11)      NOT NULL AUTO_INCREMENT COMMENT 
'Incremental primary key',
-    `name`             varchar(256) NOT NULL COMMENT 'Audit base name',
-    `type`             varchar(20)  NOT NULL COMMENT 'Audit base item type, 
such as: AGENT, DATAPROXY, etc',
-    `indicator_type`   int(4)       DEFAULT NULL COMMENT 'Indicator type for 
audit',
-    `audit_id`         varchar(11)  NOT NULL COMMENT 'Audit ID mapping of 
audit name',
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `unique_audit_base_type` (`type`, `indicator_type`),
-    UNIQUE KEY `unique_audit_base_name` (`name`)
-);
-
--- ----------------------------
--- Insert audit_base item
--- ----------------------------
-INSERT INTO `audit_base`(`name`, `type`, `indicator_type`, `audit_id`)
-VALUES ('audit_sdk_collect', 'SDK', 0, '1'),
-       ('audit_sdk_sent', 'SDK', 1, '2'),
-       ('audit_agent_collect', 'AGENT', 0, '3'),
-       ('audit_agent_sent', 'AGENT', 1, '4'),
-       ('audit_dataproxy_received', 'DATAPROXY', 0, '5'),
-       ('audit_dataproxy_sent', 'DATAPROXY', 1, '6'),
-       ('audit_sort_hive_input', 'HIVE', 0, '7'),
-       ('audit_sort_hive_output', 'HIVE', 1, '8'),
-       ('audit_sort_clickhouse_input', 'CLICKHOUSE', 0, '9'),
-       ('audit_sort_clickhouse_output', 'CLICKHOUSE', 1, '10'),
-       ('audit_sort_es_input', 'ES', 0, '11'),
-       ('audit_sort_es_output', 'ES', 1, '12'),
-       ('audit_sort_starrocks_input', 'STARROCKS', 0, '13'),
-       ('audit_sort_starrocks_output', 'STARROCKS', 1, '14'),
-       ('audit_sort_hudi_input', 'HUDI', 0, '15'),
-       ('audit_sort_hudi_output', 'HUDI', 1, '16'),
-       ('audit_sort_iceberg_input', 'ICEBERG', 0, '17'),
-       ('audit_sort_iceberg_output', 'ICEBERG', 1, '18'),
-       ('audit_sort_hbase_input', 'HBASE', 0, '19'),
-       ('audit_sort_hbase_output', 'HBASE', 1, '20'),
-       ('audit_sort_doris_input', 'DORIS', 0, '21'),
-       ('audit_sort_doris_output', 'DORIS', 1, '22'),
-       ('audit_sort_mysql_input', 'MYSQL', 0, '23'),
-       ('audit_sort_mysql_output', 'MYSQL', 1, '24'),
-       ('audit_sort_kudu_input', 'KUDU', 0, '25'),
-       ('audit_sort_kudu_output', 'KUDU', 1, '26'),
-       ('audit_sort_postgres_input', 'POSTGRESQL', 0, '27'),
-       ('audit_sort_postgres_output', 'POSTGRESQL', 1, '28'),
-       ('audit_sort_mysql_binlog_input', 'MYSQL_BINLOG', 0, '29'),
-       ('audit_sort_mysql_binlog_output', 'MYSQL_BINLOG', 1, '30'),
-       ('audit_sort_pulsar_input', 'PULSAR', 0, '31'),
-       ('audit_sort_pulsar_output', 'PULSAR', 1, '32'),
-       ('audit_sort_tube_input', 'TUBEMQ', 0, '33'),
-       ('audit_sort_tube_output', 'TUBEMQ', 1, '34');
-
 -- ----------------------------
 -- Table structure for tenant_cluster_tag
 -- ----------------------------
diff --git a/inlong-manager/manager-web/sql/apache_inlong_manager.sql 
b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
index 41e55c5206..849ffa6d4d 100644
--- a/inlong-manager/manager-web/sql/apache_inlong_manager.sql
+++ b/inlong-manager/manager-web/sql/apache_inlong_manager.sql
@@ -851,74 +851,6 @@ CREATE TABLE IF NOT EXISTS `inlong_tenant`
 INSERT INTO `inlong_tenant`(`name`, `description`, `creator`, `modifier`)
 VALUES ('public', 'Default tenant', 'admin', 'admin');
 
--- ----------------------------
--- Table structure for audit_base
--- ----------------------------
-CREATE TABLE IF NOT EXISTS `audit_base`
-(
-    `id`               int(11)      NOT NULL AUTO_INCREMENT COMMENT 
'Incremental primary key',
-    `name`             varchar(256) NOT NULL COMMENT 'Audit base name',
-    `type`             varchar(20)  NOT NULL COMMENT 'Audit base item type, 
such as: AGENT, DATAPROXY, etc',
-    `indicator_type`   int(4)       DEFAULT NULL COMMENT 'Indicator type for 
audit',
-    `audit_id`         varchar(11)  NOT NULL COMMENT 'Audit ID mapping of 
audit name',
-    PRIMARY KEY (`id`),
-    UNIQUE KEY `unique_audit_base_type` (`type`, `indicator_type`),
-    UNIQUE KEY `unique_audit_base_name` (`name`)
-) ENGINE = InnoDB
-  DEFAULT CHARSET = utf8 COMMENT ='Audit base item table';
-
--- ----------------------------
--- Insert audit_base item
--- ----------------------------
-INSERT INTO `audit_base`(`name`, `type`, `indicator_type`, `audit_id`)
-VALUES ('audit_sdk_collect', 'SDK', 0, '1'),
-       ('audit_sdk_sent', 'SDK', 1, '2'),
-       ('audit_agent_read', 'AGENT', 0, '3'),
-       ('audit_agent_sent', 'AGENT', 1, '4'),
-       ('audit_agent_sent_failed', 'AGENT', 2, '10004'),
-       ('audit_agent_read_realtime', 'AGENT', 3, '30001'),
-       ('audit_agent_send_realtime', 'AGENT', 4, '30002'),
-       ('audit_agent_add_instance_mem', 'AGENT', 5, '30003'),
-       ('audit_agent_del_instance_mem', 'AGENT', 6, '30004'),
-       ('audit_agent_add_instance_db', 'AGENT', 7, '30005'),
-       ('audit_agent_del_instance_db', 'AGENT', 8, '30006'),
-       ('audit_agent_task_mgr_heartbeat', 'AGENT', 9, '30007'),
-       ('audit_agent_task_heartbeat', 'AGENT', 10, '30008'),
-       ('audit_agent_instance_mgr_heartbeat', 'AGENT', 11, '30009'),
-       ('audit_agent_instance_heartbeat', 'AGENT', 12, '30010'),
-       ('audit_agent_sent_failed_realtime', 'AGENT', 13, '30011'),
-       ('audit_agent_del_instance_mem_unusual', 'AGENT', 14, '30014'),
-       ('audit_dataproxy_received', 'DATAPROXY', 0, '5'),
-       ('audit_dataproxy_sent', 'DATAPROXY', 1, '6'),
-       ('audit_sort_hive_input', 'HIVE', 0, '7'),
-       ('audit_sort_hive_output', 'HIVE', 1, '8'),
-       ('audit_sort_clickhouse_input', 'CLICKHOUSE', 0, '9'),
-       ('audit_sort_clickhouse_output', 'CLICKHOUSE', 1, '10'),
-       ('audit_sort_es_input', 'ES', 0, '11'),
-       ('audit_sort_es_output', 'ES', 1, '12'),
-       ('audit_sort_starrocks_input', 'STARROCKS', 0, '13'),
-       ('audit_sort_starrocks_output', 'STARROCKS', 1, '14'),
-       ('audit_sort_hudi_input', 'HUDI', 0, '15'),
-       ('audit_sort_hudi_output', 'HUDI', 1, '16'),
-       ('audit_sort_iceberg_input', 'ICEBERG', 0, '17'),
-       ('audit_sort_iceberg_output', 'ICEBERG', 1, '18'),
-       ('audit_sort_hbase_input', 'HBASE', 0, '19'),
-       ('audit_sort_hbase_output', 'HBASE', 1, '20'),
-       ('audit_sort_doris_input', 'DORIS', 0, '21'),
-       ('audit_sort_doris_output', 'DORIS', 1, '22'),
-       ('audit_sort_mysql_input', 'MYSQL', 0, '23'),
-       ('audit_sort_mysql_output', 'MYSQL', 1, '24'),
-       ('audit_sort_kudu_input', 'KUDU', 0, '25'),
-       ('audit_sort_kudu_output', 'KUDU', 1, '26'),
-       ('audit_sort_postgres_input', 'POSTGRESQL', 0, '27'),
-       ('audit_sort_postgres_output', 'POSTGRESQL', 1, '28'),
-       ('audit_sort_mysql_binlog_input', 'MYSQL_BINLOG', 0, '29'),
-       ('audit_sort_mysql_binlog_output', 'MYSQL_BINLOG', 1, '30'),
-       ('audit_sort_pulsar_input', 'PULSAR', 0, '31'),
-       ('audit_sort_pulsar_output', 'PULSAR', 1, '32'),
-       ('audit_sort_tube_input', 'TUBEMQ', 0, '33'),
-       ('audit_sort_tube_output', 'TUBEMQ', 1, '34');
-
 -- ----------------------------
 -- Table structure for tenant_cluster_tag
 -- ----------------------------
diff --git 
a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/AuditController.java
 
b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/AuditController.java
index 11b97a1a3c..8291ad1ff1 100644
--- 
a/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/AuditController.java
+++ 
b/inlong-manager/manager-web/src/main/java/org/apache/inlong/manager/web/controller/AuditController.java
@@ -17,7 +17,7 @@
 
 package org.apache.inlong.manager.web.controller;
 
-import org.apache.inlong.manager.pojo.audit.AuditBaseResponse;
+import org.apache.inlong.audit.entity.AuditInformation;
 import org.apache.inlong.manager.pojo.audit.AuditRequest;
 import org.apache.inlong.manager.pojo.audit.AuditVO;
 import org.apache.inlong.manager.pojo.common.Response;
@@ -69,7 +69,7 @@ public class AuditController {
 
     @ApiOperation(value = "Get the audit base info")
     @GetMapping("/audit/getAuditBases")
-    public Response<List<AuditBaseResponse>> getAuditBases() {
+    public Response<List<AuditInformation>> getAuditBases() {
         return Response.success(auditService.getAuditBases());
     }
 

Reply via email to