mirror of https://github.com/sualko/cloud_bbb
refactor: remove unused controller
parent
d48c9da09c
commit
7192077919
|
@ -3,7 +3,6 @@ return [
|
|||
'resources' => [
|
||||
'room' => ['url' => '/rooms'],
|
||||
'roomShare' => ['url' => '/roomShares'],
|
||||
'room_api' => ['url' => '/api/0.1/rooms'],
|
||||
],
|
||||
'routes' => [
|
||||
['name' => 'server#records', 'url' => '/server/{roomUid}/records', 'verb' => 'GET'],
|
||||
|
@ -11,7 +10,5 @@ return [
|
|||
['name' => 'server#version', 'url' => '/server/version', 'verb' => 'GET'],
|
||||
['name' => 'server#delete_record', 'url' => '/server/record/{recordId}', 'verb' => 'DELETE'],
|
||||
['name' => 'join#index', 'url' => '/b/{token}', 'verb' => 'GET'],
|
||||
['name' => 'room_api#preflighted_cors', 'url' => '/api/0.1/{path}',
|
||||
'verb' => 'OPTIONS', 'requirements' => ['path' => '.+']]
|
||||
]
|
||||
];
|
|
@ -1,103 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\BigBlueButton\Controller;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Http\DataResponse;
|
||||
use OCP\AppFramework\ApiController;
|
||||
|
||||
use OCA\BigBlueButton\Service\RoomService;
|
||||
|
||||
class RoomApiController extends ApiController
|
||||
{
|
||||
/** @var RoomService */
|
||||
private $service;
|
||||
|
||||
/** @var string */
|
||||
private $userId;
|
||||
|
||||
use Errors;
|
||||
|
||||
public function __construct(
|
||||
$appName,
|
||||
IRequest $request,
|
||||
RoomService $service,
|
||||
$userId
|
||||
) {
|
||||
parent::__construct($appName, $request);
|
||||
$this->service = $service;
|
||||
$this->userId = $userId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index(): DataResponse
|
||||
{
|
||||
return new DataResponse($this->service->findAll($this->userId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function show(int $id): DataResponse
|
||||
{
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->find($id, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function create(
|
||||
string $name,
|
||||
string $welcome,
|
||||
int $maxParticipants,
|
||||
bool $record
|
||||
): DataResponse {
|
||||
return new DataResponse($this->service->create(
|
||||
$name,
|
||||
$welcome,
|
||||
$maxParticipants,
|
||||
$record,
|
||||
$this->userId
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function update(
|
||||
int $id,
|
||||
string $name,
|
||||
string $welcome,
|
||||
int $maxParticipants,
|
||||
bool $record,
|
||||
string $access
|
||||
): DataResponse {
|
||||
return $this->handleNotFound(function () use ($id, $name, $welcome, $maxParticipants, $record, $access) {
|
||||
return $this->service->update($id, $name, $welcome, $maxParticipants, $record, $access, $this->userId);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @CORS
|
||||
* @NoCSRFRequired
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function destroy(int $id): DataResponse
|
||||
{
|
||||
return $this->handleNotFound(function () use ($id) {
|
||||
return $this->service->delete($id, $this->userId);
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue