diff --git a/datasophon-service/src/main/java/com/datasophon/api/service/impl/ClusterAlertHistoryServiceImpl.java b/datasophon-service/src/main/java/com/datasophon/api/service/impl/ClusterAlertHistoryServiceImpl.java index 86784be3..30bb088b 100644 --- a/datasophon-service/src/main/java/com/datasophon/api/service/impl/ClusterAlertHistoryServiceImpl.java +++ b/datasophon-service/src/main/java/com/datasophon/api/service/impl/ClusterAlertHistoryServiceImpl.java @@ -76,13 +76,14 @@ public void saveAlertHistory(String alertMessage) { public Result getAlertList(Integer serviceInstanceId) { List list = this.list(new QueryWrapper() .eq(serviceInstanceId != null, Constants.SERVICE_INSTANCE_ID, serviceInstanceId) - .eq(Constants.IS_ENABLED, 1)); + .eq(Constants.IS_ENABLED, 1) + .orderByDesc(Constants.CREATE_TIME)); return Result.success(list); } @Override public Result getAllAlertList(Integer clusterId, Integer page, Integer pageSize) { - Integer offset = (page - 1) * pageSize; + int offset = (page - 1) * pageSize; List list = this.list(new QueryWrapper() .eq(Constants.CLUSTER_ID, clusterId) .eq(Constants.IS_ENABLED, 1)