diff --git a/src/main/java/com/ycwl/basic/integration/device/client/DefaultConfigClient.java b/src/main/java/com/ycwl/basic/integration/device/client/DefaultConfigClient.java index f1571c1..2163c67 100644 --- a/src/main/java/com/ycwl/basic/integration/device/client/DefaultConfigClient.java +++ b/src/main/java/com/ycwl/basic/integration/device/client/DefaultConfigClient.java @@ -18,8 +18,8 @@ public interface DefaultConfigClient { * 获取默认配置列表 */ @GetMapping - PageResponse listDefaultConfigs(@RequestParam(value = "page", defaultValue = "1") int page, - @RequestParam(value = "pageSize", defaultValue = "10") int pageSize); + CommonResponse> listDefaultConfigs(@RequestParam(value = "page", defaultValue = "1") int page, + @RequestParam(value = "pageSize", defaultValue = "10") int pageSize); /** * 根据配置键获取默认配置 diff --git a/src/main/java/com/ycwl/basic/integration/device/service/DefaultConfigIntegrationService.java b/src/main/java/com/ycwl/basic/integration/device/service/DefaultConfigIntegrationService.java index 3a996e7..dbe702a 100644 --- a/src/main/java/com/ycwl/basic/integration/device/service/DefaultConfigIntegrationService.java +++ b/src/main/java/com/ycwl/basic/integration/device/service/DefaultConfigIntegrationService.java @@ -35,8 +35,8 @@ public class DefaultConfigIntegrationService { SERVICE_NAME, "defaults:list:" + page + ":" + pageSize, () -> { - PageResponse response = defaultConfigClient.listDefaultConfigs(page, pageSize); - return handlePageResponse(response, "获取默认配置列表失败"); + CommonResponse> response = defaultConfigClient.listDefaultConfigs(page, pageSize); + return handleResponse(response, "获取默认配置列表失败"); }, PageResponse.class ); @@ -216,15 +216,4 @@ public class DefaultConfigIntegrationService { } return response.getData(); } - - private PageResponse handlePageResponse(PageResponse response, String errorMessage) { - if (response == null || !response.isSuccess()) { - String msg = response != null && response.getMessage() != null - ? response.getMessage() - : errorMessage; - Integer code = response != null ? response.getCode() : 5000; - throw new IntegrationException(code, msg, SERVICE_NAME); - } - return response; - } } \ No newline at end of file