From 0755ed35334e7fa3c4227329ce85a7befa0cbf7c Mon Sep 17 00:00:00 2001 From: "leon.li" Date: Thu, 1 Sep 2016 11:10:40 +0800 Subject: [PATCH] change get log parameter --- .../dianping/platform/slb/agent/web/api/API.java | 2 +- .../slb/agent/web/controller/ApiController.java | 14 ++++++++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/api/API.java b/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/api/API.java index 3ac0f1e..2791715 100644 --- a/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/api/API.java +++ b/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/api/API.java @@ -12,7 +12,7 @@ import javax.servlet.http.HttpServletResponse; */ public interface API { - Response fetchLog(long deployId, int offset, int br, HttpServletResponse response); + Response fetchLog(long deployId, Integer offset, Integer br, HttpServletResponse response); Response deploy(long deployId, String vsName, String version, String config, boolean needReload, String dynamicRefreshPostDataStr, String dynamicVsPostData); diff --git a/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/controller/ApiController.java b/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/controller/ApiController.java index 73cf3f5..90c0cca 100644 --- a/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/controller/ApiController.java +++ b/camel-agent/src/main/java/com/dianping/platform/slb/agent/web/controller/ApiController.java @@ -140,11 +140,17 @@ public class ApiController implements API { public Response fetchLog( @RequestParam("deployId") long deployId, - @RequestParam("offset") - int offset, - @RequestParam("br") - int br, HttpServletResponse httpResponse) { + @RequestParam(value = "offset", required = false) + Integer offset, + @RequestParam(value = "br", required = false) + Integer br, HttpServletResponse httpResponse) { try { + if (offset == null) { + offset = 0; + } + if (br == null) { + br = 0; + } Reader reader = m_transactionManager.getLogReader(deployId, offset); while (reader == null && m_transactionProcessor.isTransactionProcessing(deployId)) {