get logs method

This commit is contained in:
Marcin Michałek committed 2015-01-27 15:55:16 +01:00
1 parent 671b7e78db
commit 51ad0bd7a0
4 files changed
+44 -1

No files matched your search

@@ -20,7 +20,6 @@ import org.springframework.web.client.RestTemplate;
@RequestMapping(APIServicePaths.AUTHENTICATION_CONTROLLER)
public class LoginController {
public static final String TOKEN = "token";
public static final String PERMISSION = "permission";
RestTemplate restTemplate = new RestTemplate();
@@ -0,0 +1,33 @@
package hello.agh.edu.bazy.controllers;
import hello.agh.edu.bazy.path.APIServicePaths;
import hello.agh.edu.bazy.path.ModuleServicePaths;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;
/**
* Created by Marcin on 2015-01-19.
*/
@Controller
@RequestMapping(APIServicePaths.LOGS_CONTROLLER)
public class LogsController {
RestTemplate restTemplate = new RestTemplate();
@RequestMapping(APIServicePaths.GET_LOGS)
@ResponseBody
String getLogs(@RequestParam("moduleType") String moduleType, @RequestParam("logLevels") String logLevels) {
System.out.print(moduleType);
System.out.print(logLevels);
return restTemplate.getForObject(ModuleServicePaths.GET_LOGS
.concat("?moduleType=").concat(moduleType)
.concat("&logLevels=").concat(logLevels),
String.class
);
}
}
@@ -56,4 +56,9 @@ public final class APIServicePaths {
public static final String GET_ALL_CONFIGURATION = "/configurations";
public static final String DELETE_CONFIGURATION = "/configuration";
public static final String DELETE_PROJECT = "/project";
//PROFILE
public static final String LOGS_CONTROLLER = "/logs";
public static final String PUT_LOG = "/log";
public static final String GET_LOGS = "/logs";
}
@@ -20,4 +20,10 @@ public final class ModuleServicePaths {
public static final String CHECK_PERMISSION_FOR_TOKEN = AUTHENTICATION_MODULE + "/checkPermissionForToken";
public static final String GET_USER_FOR_TOKEN = AUTHENTICATION_MODULE + "/getUserForToken";
public static final String INVALIDATE_TOKEN = AUTHENTICATION_MODULE + "/invalidateToken";
//LOGS
public static final String LOGS_MODULE = ROOT + "/restlogger/logger";
public static final String GET_LOGS = LOGS_MODULE + "/getlog";
// http://10.156.207.136:8080/restlogger/logger/getlog?moduleType=gis&logLevels=debug,error
}