use of com.tale.dto.BackResponse in project tale by otale.
the class IndexController method backup.
/**
* 系统备份
* @return
*/
@Route(value = "backup", method = HttpMethod.POST)
@JSON
public RestResponse backup(@QueryParam String bk_type, @QueryParam String bk_path, Request request) {
if (StringKit.isBlank(bk_type)) {
return RestResponse.fail("请确认信息输入完整");
}
try {
BackResponse backResponse = siteService.backup(bk_type, bk_path, "yyyyMMddHHmm");
logService.save(LogActions.SYS_BACKUP, null, request.address(), this.getUid());
return RestResponse.ok(backResponse);
} catch (Exception e) {
String msg = "备份失败";
if (e instanceof TipException) {
msg = e.getMessage();
} else {
LOGGER.error(msg, e);
}
return RestResponse.fail(msg);
}
}
Aggregations