From d78bcb87c067ef2f43f4288e1eaf58b011ffa61c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marcin=20Micha=C5=82ek?= Date: Tue, 27 Jan 2015 21:04:57 +0100 Subject: [PATCH] logs: add optional limits parameter, default to 50 --- .../hello/agh/edu/bazy/controllers/LogsController.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/main/java/hello/agh/edu/bazy/controllers/LogsController.java b/src/main/java/hello/agh/edu/bazy/controllers/LogsController.java index fcd3412..50c2665 100644 --- a/src/main/java/hello/agh/edu/bazy/controllers/LogsController.java +++ b/src/main/java/hello/agh/edu/bazy/controllers/LogsController.java @@ -20,13 +20,14 @@ public class LogsController { @RequestMapping(APIServicePaths.GET_LOGS) @ResponseBody - String getLogs(@RequestParam("moduleType") String moduleType, @RequestParam("logLevels") String logLevels) { - System.out.print(moduleType); - System.out.print(logLevels); + String getLogs(@RequestParam("moduleType") String moduleType, + @RequestParam("logLevels") String logLevels, + @RequestParam(required = false, value = "limit") String limit) { return restTemplate.getForObject(ModuleServicePaths.GET_LOGS .concat("?moduleType=").concat(moduleType) - .concat("&logLevels=").concat(logLevels), + .concat("&logLevels=").concat(logLevels) + .concat("&limit=").concat(limit != null ? limit : "50"), String.class ); }