use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class SystemConfigController method queryValue.
@RequestMapping(value = "system_config/queryValue", method = RequestMethod.POST)
@ResponseBody
public RequestResult queryValue(HttpServletRequest request, String property1) {
RequestResult requestResult = new RequestResult();
try {
List<String> properties = new ArrayList<>();
if (property1 != null) {
String[] split = property1.split(",");
if (split != null) {
for (String s : split) {
if (s != null && s.trim().length() > 0) {
String tmp = s.trim();
if (!properties.contains(tmp)) {
properties.add(tmp);
}
}
}
}
}
List<SystemConfig> systemConfigs = systemConfigService.getSystemConfigsDirectly(properties);
requestResult.setSuccess(true);
requestResult.setObj(systemConfigs);
} catch (SaturnJobConsoleException e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.getMessage());
return requestResult;
} catch (Exception e) {
LOGGER.error(e.getMessage(), e);
requestResult.setSuccess(false);
requestResult.setMessage(e.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ZKDBDiffController method diffByJob.
/**
* 对比zk和db的job config数据差异。所有对比都在当前console进行。
*
* @param request
* @param jobName 作业名
* @param namespace
* @return
*/
@RequestMapping(value = "zk_db_diff/diffByJob", method = RequestMethod.GET)
@ResponseBody
public RequestResult diffByJob(HttpServletRequest request, String jobName, String namespace) {
RequestResult requestResult = new RequestResult();
try {
JobDiffInfo jobDiffInfo = zkDBDiffService.diffByJob(namespace, jobName);
requestResult.setSuccess(true);
requestResult.setObj(jobDiffInfo);
} catch (Exception e) {
requestResult.setSuccess(false);
requestResult.setMessage(e.toString());
}
return requestResult;
}
use of com.vip.saturn.job.console.domain.RequestResult in project Saturn by vipshop.
the class ZkClusterInfoController method getAllZkClusterInfo.
@RequestMapping(value = "getAllZkClusterInfo", method = RequestMethod.GET)
public RequestResult getAllZkClusterInfo(HttpServletRequest request) {
RequestResult requestResult = new RequestResult();
try {
List<ZkClusterInfo> allZkClusterInfo = zkClusterInfoService.getAllZkClusterInfo();
requestResult.setObj(allZkClusterInfo);
requestResult.setSuccess(true);
} catch (Throwable t) {
LOGGER.error(t.getMessage(), t);
requestResult.setSuccess(false);
requestResult.setMessage(t.toString());
}
return requestResult;
}
Aggregations