You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@paimon.apache.org by "hunter-cloud09 (via GitHub)" <gi...@apache.org> on 2023/10/23 01:46:18 UTC
[PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
hunter-cloud09 opened a new pull request, #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76
re #70
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368179933
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
@hunter-cloud09, does the `removeCatalog` only support by id? IMO, the operation that removes catalog could support by catalog id or name.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "hunter-cloud09 (via GitHub)" <gi...@apache.org>.
hunter-cloud09 commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368185375
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+ private String catalogType;
Review Comment:
The id is automatically generated by the snowflake model, so there is no need to pass in the id when creating the catalog.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "hunter-cloud09 (via GitHub)" <gi...@apache.org>.
hunter-cloud09 commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368184738
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
Do you mean to add an api?
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368171090
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+ private String catalogType;
Review Comment:
Does the DTO need catalog id?
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
Could this support remove by catalog name?
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -18,24 +18,17 @@
package org.apache.paimon.web.server.controller;
-import org.apache.paimon.web.api.catalog.PaimonServiceFactory;
-import org.apache.paimon.web.server.data.enums.CatalogMode;
+import org.apache.paimon.web.server.data.dto.CatalogDto;
import org.apache.paimon.web.server.data.model.CatalogInfo;
import org.apache.paimon.web.server.data.result.R;
import org.apache.paimon.web.server.data.result.enums.Status;
import org.apache.paimon.web.server.service.CatalogService;
-import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.DeleteMapping;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.bind.annotation.*;
Review Comment:
Do not use `*` to import the classes of the same package.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "hunter-cloud09 (via GitHub)" <gi...@apache.org>.
hunter-cloud09 commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368177661
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+ private String catalogType;
Review Comment:
It's only a DTO. need't id.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368181343
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,34 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+ private String catalogType;
Review Comment:
@hunter-cloud09, why not DTO need id? Any standard?
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368181776
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -50,35 +49,13 @@ public class CatalogController {
/**
* Create a catalog.
*
- * @param catalogInfo The catalogInfo for the catalog.
+ * @param catalogDto The catalogDto for the catalog.
* @return The created catalog.
*/
@PostMapping("/create")
- public R<Void> createCatalog(@RequestBody CatalogInfo catalogInfo) {
- if (!catalogService.checkCatalogNameUnique(catalogInfo)) {
- return R.failed(Status.CATALOG_NAME_IS_EXIST, catalogInfo.getCatalogName());
- }
-
+ public R<Void> createCatalog(@RequestBody CatalogDto catalogDto) {
Review Comment:
Could you update other interfaces with DTO? like `createDatabase`?
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1370136645
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/DatabaseController.java:
##########
@@ -104,18 +113,19 @@ public R<List<DatabaseInfo>> getAllDatabases() {
/**
* Removes a database by its name.
*
- * @param databaseName The database to be removed.
- * @param catalogName The catalog to which the database to be removed belongs.
+ * @param databaseDto The drop database DTO.
* @return A response indicating the success or failure of the removal operation.
- * @throws RuntimeException if the database is not found or it is not empty.
+ * @throws RuntimeException if the database is not found, or it is not empty.
*/
- @DeleteMapping("/drop/{databaseName}/{catalogName}")
- public R<Void> dropDatabase(
- @PathVariable String databaseName, @PathVariable String catalogName) {
+ @PostMapping("/drop")
+ public R<Void> dropDatabase(@RequestBody DropDatabaseDto databaseDto) {
Review Comment:
Ditto.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+
+ private Integer id;
+
+ private String catalogType;
+
+ private String catalogName;
Review Comment:
```suggestion
private String name;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CatalogDto.java:
##########
@@ -0,0 +1,40 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import com.baomidou.mybatisplus.annotation.TableLogic;
+import lombok.Data;
+
+@Data
+public class CatalogDto {
+
+ private Integer id;
+
+ private String catalogType;
Review Comment:
```suggestion
private String type;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/DropDatabaseDto.java:
##########
@@ -0,0 +1,30 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Getter;
+
+@Getter
+public class DropDatabaseDto extends DatabaseDto {
Review Comment:
Ditto.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -97,17 +76,27 @@ public R<List<CatalogInfo>> getCatalog() {
}
/**
- * Removes a catalog with given catalog name.
+ * Removes a catalog with given catalog name or catalog id.
*
- * @param catalogName The catalog name.
+ * @param removeCatalogDto Given the catalog name or catalog id to remove catalog.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
- ? R.succeed()
- : R.failed(Status.CATALOG_REMOVE_ERROR);
+ @PostMapping("/remove")
+ public R<Void> removeCatalog(@RequestBody RemoveCatalogDto removeCatalogDto) {
Review Comment:
Could this reuse `CatalogDto`?
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/CreateDatabaseDto.java:
##########
@@ -0,0 +1,31 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Getter;
+
+@Getter
+public class CreateDatabaseDto extends DatabaseDto {
Review Comment:
Only keep `DatabaseDto`.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/RemoveCatalogDto.java:
##########
@@ -0,0 +1,27 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class RemoveCatalogDto {
Review Comment:
Ditto.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/DatabaseDto.java:
##########
@@ -0,0 +1,29 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class DatabaseDto {
+ private String databaseName;
+ private String catalogId;
Review Comment:
Add new line between fields?
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/CatalogService.java:
##########
@@ -31,5 +33,13 @@ public interface CatalogService extends IService<CatalogInfo> {
* @param catalog catalog info
* @return result
*/
- boolean checkCatalogNameUnique(CatalogInfo catalog);
+ boolean checkCatalogNameUnique(CatalogDto catalog);
+
+ /**
+ * Create a catalog.
+ *
+ * @param catalogDto catalogInfo for the catalog.
Review Comment:
```suggestion
* @param catalogDto catalog for the catalog.
```
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimize catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas merged PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368185502
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
@hunter-cloud09, I mean that the parameter type could be `CatalogDTO`.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "hunter-cloud09 (via GitHub)" <gi...@apache.org>.
hunter-cloud09 commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368176883
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
Why use catalog name? Wouldn't it be better to use catalog id?
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "hunter-cloud09 (via GitHub)" <gi...@apache.org>.
hunter-cloud09 commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1368188267
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/CatalogController.java:
##########
@@ -99,14 +70,14 @@ public R<List<CatalogInfo>> getCatalog() {
/**
* Removes a catalog with given catalog name.
*
- * @param catalogName The catalog name.
+ * @param catalogId The catalog id.
* @return A response indicating the success or failure of the operation.
*/
- @DeleteMapping("/remove/{catalogName}")
- public R<Void> removeCatalog(@PathVariable String catalogName) {
- QueryWrapper<CatalogInfo> queryWrapper = new QueryWrapper<>();
- queryWrapper.eq("catalog_name", catalogName);
- return catalogService.remove(queryWrapper)
+ @DeleteMapping("/remove/{catalogId}")
+ public R<Void> removeCatalog(@PathVariable String catalogId) {
Review Comment:
> @hunter-cloud09, I mean that the parameter type could be `CatalogDTO`.
get it!
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1371148542
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/DatabaseDTO.java:
##########
@@ -0,0 +1,37 @@
+/*
+ * 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.paimon.web.server.data.dto;
+
+import lombok.Data;
+
+@Data
+public class DatabaseDTO {
+
+ private String databaseName;
Review Comment:
```suggestion
private String name;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/impl/UserServiceImpl.java:
##########
@@ -69,7 +69,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements Us
* @return {@link String}
*/
@Override
- public UserInfoVo login(LoginDto loginDto) throws BaseException {
+ public UserInfoVo login(LoginDTO loginDto) throws BaseException {
Review Comment:
```suggestion
public UserInfoVo login(LoginDTO loginDTO) throws BaseException {
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/LoginController.java:
##########
@@ -48,7 +48,7 @@ public class LoginController {
* @return token string
*/
@PostMapping("/login")
- public R<UserInfoVo> login(@RequestBody LoginDto loginDto) {
+ public R<UserInfoVo> login(@RequestBody LoginDTO loginDto) {
Review Comment:
```suggestion
public R<UserInfoVo> login(@RequestBody LoginDTO loginDTO) {
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/LoginController.java:
##########
@@ -48,7 +48,7 @@ public class LoginController {
* @return token string
*/
@PostMapping("/login")
- public R<UserInfoVo> login(@RequestBody LoginDto loginDto) {
+ public R<UserInfoVo> login(@RequestBody LoginDTO loginDto) {
Review Comment:
Also update the comment of `loginDTO`.
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/LoginDTO.java:
##########
@@ -24,7 +24,7 @@
/** login dto. */
Review Comment:
```suggestion
/** The DTO of login. */
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/service/UserService.java:
##########
@@ -36,7 +36,7 @@ public interface UserService extends IService<User> {
* @param loginDto login params
* @return {@link String}
*/
- UserInfoVo login(LoginDto loginDto) throws BaseException;
+ UserInfoVo login(LoginDTO loginDto) throws BaseException;
Review Comment:
```suggestion
UserInfoVo login(LoginDTO loginDTO) throws BaseException;
```
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/data/dto/LoginDTO.java:
##########
@@ -24,7 +24,7 @@
/** login dto. */
Review Comment:
Other DTOs also add the comment of class.
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [Feature] Optimization catalog controller [incubator-paimon-webui]
Posted by "SteNicholas (via GitHub)" <gi...@apache.org>.
SteNicholas commented on code in PR #76:
URL: https://github.com/apache/incubator-paimon-webui/pull/76#discussion_r1371289521
##########
paimon-web-server/src/main/java/org/apache/paimon/web/server/controller/TableController.java:
##########
@@ -68,18 +68,18 @@ public class TableController {
/**
* Creates a table in the database based on the provided TableInfo.
*
- * @param tableInfo The TableInfo object containing information about the table.
+ * @param tableDTO The TableInfo object containing information about the table.
Review Comment:
```suggestion
* @param tableDTO The TableDTO object containing information about the table.
```
--
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: issues-unsubscribe@paimon.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org