SbloodyS commented on code in PR #3923:
URL: 
https://github.com/apache/incubator-streampark/pull/3923#discussion_r1694429177


##########
streampark-console/streampark-console-service/src/main/java/org/apache/streampark/console/core/controller/ApplicationController.java:
##########
@@ -79,190 +78,187 @@ public class ApplicationController {
     @PostMapping("get")
     @Permission(app = "#app.id")
     @RequiresPermissions("app:detail")
-    public RestResponse get(Application app) {
+    public Response<Application> get(Application app) {
         Application application = applicationManageService.getApp(app.getId());
-        return RestResponse.success(application);
+        return Response.success(application);
     }
 
     @Permission(team = "#app.teamId")
     @PostMapping("create")
     @RequiresPermissions("app:create")
-    public RestResponse create(Application app) throws IOException {
-        boolean saved = applicationManageService.create(app);
-        return RestResponse.success(saved);
+    public Response<Boolean> create(Application app) throws IOException {
+        return Response.success(applicationManageService.create(app));
     }
 
     @Permission(app = "#app.id", team = "#app.teamId")
     @PostMapping("copy")
     @RequiresPermissions("app:copy")
-    public RestResponse copy(Application app) throws IOException {
+    public Response<Void> copy(Application app) throws IOException {
         applicationManageService.copy(app);
-        return RestResponse.success();
+        return Response.success();
     }
 
     @AppUpdated
     @Permission(app = "#app.id")
     @PostMapping("update")
     @RequiresPermissions("app:update")
-    public RestResponse update(Application app) {
+    public Response<Void> update(Application app) {
         applicationManageService.update(app);
-        return RestResponse.success(true);
+        return Response.success();
     }
 
     @PostMapping("dashboard")
     @Permission(team = "#teamId")
-    public RestResponse dashboard(Long teamId) {
-        Map<String, Serializable> dashboardMap = 
applicationInfoService.getDashboardDataMap(teamId);
-        return RestResponse.success(dashboardMap);
+    public Response<?> dashboard(Long teamId) {

Review Comment:
   Using generics in controller is not a good practice. A good crontroller 
should returns a specific bean object.



-- 
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]

Reply via email to