YongGoose commented on code in PR #7157: URL: https://github.com/apache/incubator-seata/pull/7157#discussion_r1950432575
########## namingserver/src/main/java/org/apache/seata/namingserver/controller/NamingController.java: ########## @@ -113,14 +115,18 @@ public Result<String> changeGroup(@RequestParam String namespace, @RequestParam String clusterName, @RequestParam String unitName, @RequestParam String vGroup) { - Result<String> addGroupResult = namingManager.changeGroup(namespace, vGroup, clusterName, unitName); if (!addGroupResult.isSuccess()) { return addGroupResult; } return new Result<>("200", "change vGroup " + vGroup + "to cluster " + clusterName + " successfully!"); } + @GetMapping("/namespace") + public SingleResult<Map<String, NamespaceVO>> namespaces() { Review Comment: > If we return a `DTO` to the controller side, the controller would need to convert it to `VO`, which I think is redundant. Thank you for your opinion. If the controller layer simply returns what the service layer provides, the DTO might seem unnecessary. However, when transmitting complex objects, I believe using a DTO is appropriate. Discussions about DTOs and VOs never seem to have a definitive answer. 😅 This time, I think it would be better to follow your suggestion and use a `VO` to avoid redundancy. -- 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: notifications-unsubscr...@seata.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@seata.apache.org For additional commands, e-mail: notifications-h...@seata.apache.org