tomsun28 commented on code in PR #2426:
URL: https://github.com/apache/hertzbeat/pull/2426#discussion_r1701565730


##########
alerter/src/main/java/org/apache/hertzbeat/alert/controller/AlertDefinesController.java:
##########
@@ -111,8 +112,11 @@ public ResponseEntity<Message<Page<AlertDefine>>> 
getAlertDefines(
         };
         Sort sortExp = Sort.by(new 
Sort.Order(Sort.Direction.fromString(order), sort));
         PageRequest pageRequest = PageRequest.of(pageIndex, pageSize, sortExp);
+
         Page<AlertDefine> alertDefinePage = 
alertDefineService.getAlertDefines(specification, pageRequest);
-        return ResponseEntity.ok(Message.success(alertDefinePage));
+        Page<AlertDefine> alertDefinePages = new 
PageImpl<>(alertDefinePage.getContent(), pageRequest, 
alertDefinePage.getTotalElements());
+
+        return ResponseEntity.ok(Message.success(alertDefinePages));

Review Comment:
   hi why new a pageImpl to replace pre one here 



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to