Skip to content
Snippets Groups Projects
Commit b83d1061 authored by DR's avatar DR
Browse files

Feat: Update catalogcontroller

parent 7c43cf83
1 merge request!1v1.0.0🚀
...@@ -283,18 +283,66 @@ class CatalogController ...@@ -283,18 +283,66 @@ class CatalogController
$data = json_decode($json); $data = json_decode($json);
$token = GetRequestHeader::getHeader("token", 1); $token = GetRequestHeader::getHeader("token", 1);
$content = $data->content ?? ""; $uuid = $data->uuid ?? "";
$reportedId = $data->reportedId ?? ""; $title = $data->title ?? "";
$reporterId = $data->reporterId ?? ""; $description = $data->description ?? "";
$trailer = $data->trailer ?? "";
$poster = $data->poster ?? "";
$category = $data->category ?? "";
$headers = array("token:{$token}");
$body = [
"uuid" => $uuid,
"title" => $title,
"description" => $description,
"trailer" => $trailer,
"poster" => $poster,
"category" => $category,
];
$soapRequest = new SOAPRequest("catalog-request", "CreateCatalog", $headers, [], $body);
$response = $soapRequest->post();
echo json_encode($response);
}
public function deleteCatalogRequest()
{
$json = file_get_contents('php://input');
$data = json_decode($json);
$token = GetRequestHeader::getHeader("token", 1);
$id = $data->id ?? "";
$headers = array("token:{$token}");
$body = [
"id" => $id,
];
$soapRequest = new SOAPRequest("catalog-request", "DeleteCatalog", $headers, [], $body);
$response = $soapRequest->post();
echo json_encode($response);
}
public function getCatalogRequest()
{
$json = file_get_contents('php://input');
$data = json_decode($json);
$token = GetRequestHeader::getHeader("token", 1);
$page = $data->page ?? "";
$pagesize = $data->pagesize ?? "";
$headers = array("token:${token}"); $headers = array("token:{$token}");
$body = [ $body = [
"content" => $content, "page" => $page,
"reportedId" => $reportedId, "pagesize" => $pagesize,
"reporterId" => $reporterId
]; ];
$soapRequest = new SOAPRequest("report-user", "CreateReport", $headers, [], $body); $soapRequest = new SOAPRequest("catalog-request", "GetCatalog", $headers, [], $body);
$response = $soapRequest->post(); $response = $soapRequest->post();
echo json_encode($response); echo json_encode($response);
...@@ -350,4 +398,4 @@ class CatalogController ...@@ -350,4 +398,4 @@ class CatalogController
echo json_encode($response); echo json_encode($response);
} }
} }
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment