|
@@ -8,6 +8,8 @@ use FOS\RestBundle\Controller\Annotations\RouteResource;
|
|
use FOS\RestBundle\Controller\Annotations\View;
|
|
use FOS\RestBundle\Controller\Annotations\View;
|
|
use FOS\RestBundle\Util\Codes;
|
|
use FOS\RestBundle\Util\Codes;
|
|
use FOS\RestBundle\View\View as FOSView;
|
|
use FOS\RestBundle\View\View as FOSView;
|
|
|
|
+use FTTHBundle\Utils\JsonResponseUtils;
|
|
|
|
+use Symfony\Component\HttpFoundation\JsonResponse;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
use WebserviceBundle\Controller\RESTController;
|
|
use WebserviceBundle\Controller\RESTController;
|
|
@@ -216,4 +218,19 @@ class ONURESTController extends RESTController
|
|
|
|
|
|
return $output->fetch();
|
|
return $output->fetch();
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ * GET Route annotation.
|
|
|
|
+ * @Get("/onus-export")
|
|
|
|
+ * @param Request $request
|
|
|
|
+ * @return JsonResponse
|
|
|
|
+ */
|
|
|
|
+ public function onuExportAction(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $tenancyId = $request->headers->get('tenancyid') != null ? (int) $request->headers->get('tenancyid') : 1;
|
|
|
|
+ $currentPage = $request->headers->get('currentpage') != null ? (int) $request->headers->get('currentpage') : 1;
|
|
|
|
+ $limit = $request->headers->get('limit') != null ? (int) $request->headers->get('limit') : 20;
|
|
|
|
+ $onuExportService = $this->get('onu_export_service');
|
|
|
|
+ return JsonResponseUtils::make($onuExportService->getOnusWithCostumer($tenancyId, $currentPage, $limit));
|
|
|
|
+ }
|
|
}
|
|
}
|