use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.
the class DashboardController method top10FailJob.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10FailJob")
public SuccessResponseEntity top10FailJob(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.top10FailureJob(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.top10FailureJobByAllZkCluster());
}
use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.
the class DashboardController method top10FailDomain.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10FailDomain")
public SuccessResponseEntity top10FailDomain(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.top10FailureDomain(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.top10FailureDomainByAllZkCluster());
}
use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.
the class AuthorizationController method getLoginUser.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping("/loginUser")
public SuccessResponseEntity getLoginUser(HttpSession httpSession) throws SaturnJobConsoleException {
String currentLoginUserName = getCurrentLoginUserName();
User user = authorizationService.getUser(currentLoginUserName);
return new SuccessResponseEntity(user);
}
use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.
the class ConsoleConfigController method createConfig.
/**
* 创建配置项。
*
* @param key 配置key
* @param value 配置值
*/
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@Audit
@PostMapping("/create")
public SuccessResponseEntity createConfig(@AuditParam(value = "key") @RequestParam String key, @AuditParam(value = "value") @RequestParam String value) throws SaturnJobConsoleException {
assertIsPermitted(PermissionKeys.systemConfig);
// 不能更新EXECUTOR_CONFIGS
if (SystemConfigProperties.EXECUTOR_CONFIGS.equals(key)) {
throw new SaturnJobConsoleException(String.format("配置项不能为%s", key));
}
SystemConfig systemConfig = new SystemConfig();
systemConfig.setProperty(key);
systemConfig.setValue(value);
systemConfigService.createConfig(systemConfig);
return new SuccessResponseEntity();
}
Aggregations