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

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


The following commit(s) were added to refs/heads/master by this push:
     new a5e8f54  [INLONG-3280][Dashboard][Manager] Fix update and delete 
datasource failed  (#3281)
a5e8f54 is described below

commit a5e8f547e08dc1ae36ddb17946f97500013e9928
Author: xuesongxs <[email protected]>
AuthorDate: Mon Mar 21 21:56:21 2022 +0800

    [INLONG-3280][Dashboard][Manager] Fix update and delete datasource failed  
(#3281)
---
 inlong-dashboard/src/pages/DataSources/CreateModal.tsx              | 4 ++--
 inlong-dashboard/src/pages/DataSources/index.tsx                    | 2 +-
 .../inlong/manager/common/pojo/commonserver/CommonDbServerInfo.java | 6 +++---
 .../manager/common/pojo/commonserver/CommonDbServerListVo.java      | 4 ++--
 .../inlong/manager/service/core/impl/CommonDBServerServiceImpl.java | 2 +-
 5 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/inlong-dashboard/src/pages/DataSources/CreateModal.tsx 
b/inlong-dashboard/src/pages/DataSources/CreateModal.tsx
index c3d95fe..02abb9d 100644
--- a/inlong-dashboard/src/pages/DataSources/CreateModal.tsx
+++ b/inlong-dashboard/src/pages/DataSources/CreateModal.tsx
@@ -50,7 +50,7 @@ const Comp: React.FC<Props> = ({ type, id, ...modalProps }) 
=> {
       serverType: type,
     };
     if (isUpdate) {
-      values.id = id;
+      submitData.id = id;
     }
     if (type === 'DB') {
       submitData.inCharges = values.inCharges.join(',');
@@ -78,7 +78,7 @@ const Comp: React.FC<Props> = ({ type, id, ...modalProps }) 
=> {
 
   const { data, run: getData } = useRequest(
     id => ({
-      url: `/commonserver/db/get/${id}`,
+      url: `/commonserver/db/getById/${id}`,
       params: {
         serverType: type,
       },
diff --git a/inlong-dashboard/src/pages/DataSources/index.tsx 
b/inlong-dashboard/src/pages/DataSources/index.tsx
index 1355088..fea59cb 100644
--- a/inlong-dashboard/src/pages/DataSources/index.tsx
+++ b/inlong-dashboard/src/pages/DataSources/index.tsx
@@ -93,7 +93,7 @@ const Comp: React.FC = () => {
       title: i18n.t('basic.DeleteConfirm'),
       onOk: async () => {
         await request({
-          url: `/commonserver/db/delete/${id}`,
+          url: `/commonserver/db/deleteById/${id}`,
           method: 'DELETE',
           params: {
             serverType: options.type,
diff --git 
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerInfo.java
 
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerInfo.java
index eb6c621..4de29b7 100644
--- 
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerInfo.java
+++ 
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerInfo.java
@@ -32,7 +32,7 @@ import lombok.NoArgsConstructor;
 @ApiModel("Common DB server info")
 public class CommonDbServerInfo {
 
-    private int id;
+    private Integer id;
 
     @ApiModelProperty("access type, support: Agent, DataProxy Client, 
LoadProxy")
     private String accessType;
@@ -47,7 +47,7 @@ public class CommonDbServerInfo {
     private String dbServerIp;
 
     @ApiModelProperty("DB Server port")
-    private int port;
+    private Integer port;
 
     @ApiModelProperty("target database name")
     private String dbName;
@@ -80,7 +80,7 @@ public class CommonDbServerInfo {
     private String backupDbServerIp;
 
     @ApiModelProperty("backup DB host port")
-    private int backupDbPort;
+    private Integer backupDbPort;
 
     @ApiModelProperty("status, 0: invalid, 1: normal")
     private Integer status;
diff --git 
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerListVo.java
 
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerListVo.java
index 19ca84f..d44a1cf 100644
--- 
a/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerListVo.java
+++ 
b/inlong-manager/manager-common/src/main/java/org/apache/inlong/manager/common/pojo/commonserver/CommonDbServerListVo.java
@@ -29,7 +29,7 @@ import lombok.Data;
 @ApiModel("File source list")
 public class CommonDbServerListVo {
 
-    private int id;
+    private Integer id;
 
     @ApiModelProperty("Collection type, Agent, DataProxy Client, LoadProxy")
     private String accessType;
@@ -44,7 +44,7 @@ public class CommonDbServerListVo {
     private String dbServerIp;
 
     @ApiModelProperty("Port Number")
-    private int port;
+    private Integer port;
 
     @ApiModelProperty("Target database name")
     private String dbName;
diff --git 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/CommonDBServerServiceImpl.java
 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/CommonDBServerServiceImpl.java
index eab427a..95f7e3b 100644
--- 
a/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/CommonDBServerServiceImpl.java
+++ 
b/inlong-manager/manager-service/src/main/java/org/apache/inlong/manager/service/core/impl/CommonDBServerServiceImpl.java
@@ -121,7 +121,7 @@ public class CommonDBServerServiceImpl implements 
CommonDBServerService {
     }
 
     private void checkValidity(CommonDbServerInfo commonDbServerInfo) throws 
Exception {
-        if (commonDbServerInfo.getId() > 0) {
+        if (commonDbServerInfo.getId() != null && commonDbServerInfo.getId() > 
0) {
             throw new IllegalArgumentException("CommonDbServer id [" + 
commonDbServerInfo.getId()
                     + "] has already exists, please check");
         }

Reply via email to