use of org.codelibs.fess.app.pager.FailureUrlPager in project fess by codelibs.
the class ApiAdminFailureurlAction method logs.
// ===================================================================================
// Search Execute
// ==============
// GET /api/admin/failureurl/logs
// POST /api/admin/failureurl/logs
@Execute
public JsonResponse<ApiResult> logs(final SearchBody body) {
validateApi(body, messages -> {
});
final FailureUrlPager pager = copyBeanToNewBean(body, FailureUrlPager.class);
final List<FailureUrl> list = failureUrlService.getFailureUrlList(pager);
return asJson(new ApiResult.ApiLogsResponse<EditBody>().logs(list.stream().map(entity -> createEditBody(entity)).collect(Collectors.toList())).total(pager.getAllRecordCount()).status(ApiResult.Status.OK).result());
}
use of org.codelibs.fess.app.pager.FailureUrlPager in project fess by codelibs.
the class ApiAdminFailureurlAction method delete$all.
// DELETE /api/admin/failureurl/all
@Execute
public JsonResponse<ApiResult> delete$all() {
try {
failureUrlService.deleteAll(failureUrlPager);
failureUrlPager.clear();
saveInfo(messages -> messages.addSuccessFailureUrlDeleteAll(GLOBAL));
} catch (final Exception e) {
throwValidationErrorApi(messages -> messages.addErrorsCrudFailedToDeleteCrudTable(GLOBAL, buildThrowableMessage(e)));
}
return asJson(new ApiResponse().status(Status.OK).result());
}
Aggregations