changes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
|
||||
// TODO: Implement LATER
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\BoardService;
|
||||
@@ -13,11 +14,11 @@ class BoardApiController extends BaseApiController {
|
||||
private $userId;
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
BoardService $stackService,
|
||||
BoardService $cardService,
|
||||
$userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->boardService = $stackService;
|
||||
$this->boardService = $cardService;
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
|
||||
@@ -14,11 +14,11 @@ class BoardController extends Controller {
|
||||
private $boardService;
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
BoardService $stackService,
|
||||
BoardService $cardService,
|
||||
$userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->boardService = $stackService;
|
||||
$this->boardService = $cardService;
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
@@ -32,7 +32,7 @@ class BoardController extends Controller {
|
||||
*/
|
||||
public function read($boardId) {
|
||||
// FIXME: Remove as this is just for testing if loading animation works out nicely
|
||||
usleep(500000);
|
||||
usleep(200000);
|
||||
return $this->boardService->find($this->userId, $boardId);
|
||||
}
|
||||
/**
|
||||
|
||||
57
controller/cardcontroller.php
Normal file
57
controller/cardcontroller.php
Normal file
@@ -0,0 +1,57 @@
|
||||
<?php
|
||||
|
||||
namespace OCA\Deck\Controller;
|
||||
|
||||
use OCA\Deck\Service\CardService;
|
||||
|
||||
use OCP\IRequest;
|
||||
use OCP\AppFramework\Controller;
|
||||
|
||||
class CardController extends Controller {
|
||||
private $userId;
|
||||
private $cardService;
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
CardService $cardService,
|
||||
$userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->cardService = $cardService;
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function index($cardId) {
|
||||
return $this->cardService->findAll($boardId);
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function read($cardId) {
|
||||
return $this->cardService->find($this->userId, $cardId);
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function reorder($cardId, $stackId, $order) {
|
||||
return $this->cardService->reorder($cardId, $stackId, $order);
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function create($title, $stackId, $type, $order=999) {
|
||||
return $this->cardService->create($title, $stackId, $type, $order, $this->userId);
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function update($id, $title, $stackId, $type, $order) {
|
||||
return $this->cardService->update($id, $title, $stackId, $type, $order, $this->userId);
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function delete($cardId) {
|
||||
return $this->cardService->delete($this->userId, $cardId);
|
||||
}
|
||||
}
|
||||
@@ -27,27 +27,15 @@ class PageController extends Controller {
|
||||
}
|
||||
|
||||
/**
|
||||
* CAUTION: the @Stuff turns off security checks; for this page no admin is
|
||||
* required and no CSRF check. If you don't know what CSRF is, read
|
||||
* it up in the docs or you might create a security hole. This is
|
||||
* basically the only required method to add this exemption, don't
|
||||
* add it to any other method if you don't exactly know what it does
|
||||
* Handle main html view from templates/main.php
|
||||
* This will return the main angular application
|
||||
*
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index() {
|
||||
$params = ['user' => $this->userId];
|
||||
return new TemplateResponse('deck', 'main', $params); // templates/main.php
|
||||
return new TemplateResponse('deck', 'main', $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simply method that posts back the payload of the request
|
||||
* @NoAdminRequired
|
||||
*/
|
||||
public function doEcho($echo) {
|
||||
return new DataResponse(['echo' => $echo]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -14,11 +14,11 @@ class StackController extends Controller {
|
||||
private $stackService;
|
||||
public function __construct($appName,
|
||||
IRequest $request,
|
||||
StackService $stackService,
|
||||
StackService $cardService,
|
||||
$userId){
|
||||
parent::__construct($appName, $request);
|
||||
$this->userId = $userId;
|
||||
$this->stackService = $stackService;
|
||||
$this->stackService = $cardService;
|
||||
}
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
|
||||
Reference in New Issue
Block a user