|
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
import java.util.Objects;
|
|
@@ -49,15 +50,19 @@ public class AdminController {
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/removeApplicationName")
|
|
|
- public String removeApplicationName(@RequestParam("applicationName") String applicationName) {
|
|
|
+ public Map<String, String> removeApplicationName(@RequestParam("applicationName") String applicationName) {
|
|
|
logger.info("remove application name. {}", applicationName);
|
|
|
+ Map<String, String> result = new HashMap<>();
|
|
|
try {
|
|
|
adminService.removeApplicationName(applicationName);
|
|
|
- return "OK";
|
|
|
+ result.put("status", "OK");
|
|
|
+// return "OK";
|
|
|
} catch (Exception e) {
|
|
|
logger.error("error while removing applicationName", e);
|
|
|
- return e.getMessage();
|
|
|
+ result.put("status", "fail");
|
|
|
+// return e.getMessage();
|
|
|
}
|
|
|
+ return result;
|
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "/removeAgentId")
|
|
@@ -104,4 +109,4 @@ public class AdminController {
|
|
|
return this.adminService.getInactiveAgents(applicationName, durationDays);
|
|
|
}
|
|
|
|
|
|
-}
|
|
|
+}
|