diff --git a/docker-run.sh b/docker-run.sh index 0ef8a1e..decf9a6 100755 --- a/docker-run.sh +++ b/docker-run.sh @@ -8,7 +8,7 @@ docker rm -f nextcloud docker run -d --name=nextcloud -p 8080:80 -v "${PWD}:/var/www/html/custom_apps/upschooling" docker.io/nextcloud docker exec nextcloud chown -R 33 /var/www/html/custom_apps docker exec nextcloud chmod -R ug+rw /var/www/html/custom_apps -docker exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make' +docker exec --user 33 nextcloud bash -c 'cd /var/www/html/custom_apps/upschooling && make composer' docker exec --user 33 nextcloud php occ maintenance:install --database "sqlite" --admin-user "admin" --admin-pass "admin" docker exec --user 33 nextcloud php occ config:system:set --value=true --type=boolean debug docker exec --user 33 nextcloud php occ app:enable --force upschooling diff --git a/lib/Controller/NoteApiController.php b/lib/Controller/TicketApiController.php similarity index 91% rename from lib/Controller/NoteApiController.php rename to lib/Controller/TicketApiController.php index 1667bba..d2a9d6f 100644 --- a/lib/Controller/NoteApiController.php +++ b/lib/Controller/TicketApiController.php @@ -3,13 +3,13 @@ namespace OCA\UPschooling\Controller; use OCA\UPschooling\AppInfo\Application; -use OCA\UPschooling\Service\NoteService; +use OCA\UPschooling\Service\TicketService; use OCP\AppFramework\ApiController; use OCP\AppFramework\Http\DataResponse; use OCP\IRequest; -class NoteApiController extends ApiController { - /** @var NoteService */ +class TicketApiController extends ApiController { + /** @var TicketService */ private $service; /** @var string */ @@ -18,7 +18,7 @@ class NoteApiController extends ApiController { use Errors; public function __construct(IRequest $request, - NoteService $service, + TicketService $service, $userId) { parent::__construct(Application::APP_ID, $request); $this->service = $service; diff --git a/lib/Controller/NoteController.php b/lib/Controller/TicketController.php similarity index 90% rename from lib/Controller/NoteController.php rename to lib/Controller/TicketController.php index 4c37699..2b3b55f 100644 --- a/lib/Controller/NoteController.php +++ b/lib/Controller/TicketController.php @@ -3,13 +3,13 @@ namespace OCA\UPschooling\Controller; use OCA\UPschooling\AppInfo\Application; -use OCA\UPschooling\Service\NoteService; +use OCA\UPschooling\Service\TicketService; use OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; use OCP\IRequest; -class NoteController extends Controller { - /** @var NoteService */ +class TicketController extends Controller { + /** @var TicketService */ private $service; /** @var string */ @@ -18,7 +18,7 @@ class NoteController extends Controller { use Errors; public function __construct(IRequest $request, - NoteService $service, + TicketService $service, $userId) { parent::__construct(Application::APP_ID, $request); $this->service = $service; diff --git a/lib/Db/Note.php b/lib/Db/Note.php deleted file mode 100644 index 36e81a9..0000000 --- a/lib/Db/Note.php +++ /dev/null @@ -1,21 +0,0 @@ - $this->id, - 'title' => $this->title, - 'content' => $this->content - ]; - } -} diff --git a/lib/Db/Ticket.php b/lib/Db/Ticket.php new file mode 100644 index 0000000..04c0943 --- /dev/null +++ b/lib/Db/Ticket.php @@ -0,0 +1,27 @@ + $this->id, + 'title' => $this->title, + 'description' => $this->description, + 'helperId' => $this->helperId, + 'dueDate' => $this->dueDate, + 'status' => $this->status, + ]; + } +} diff --git a/lib/Db/NoteMapper.php b/lib/Db/TicketMapper.php similarity index 85% rename from lib/Db/NoteMapper.php rename to lib/Db/TicketMapper.php index bd3ae2a..1f985b2 100644 --- a/lib/Db/NoteMapper.php +++ b/lib/Db/TicketMapper.php @@ -8,19 +8,19 @@ use OCP\AppFramework\Db\QBMapper; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; -class NoteMapper extends QBMapper { +class TicketMapper extends QBMapper { public function __construct(IDBConnection $db) { - parent::__construct($db, 'upschooling', Note::class); + parent::__construct($db, 'upschooling', Ticket::class); } /** * @param int $id * @param string $userId - * @return Entity|Note + * @return Entity|Ticket * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException * @throws DoesNotExistException */ - public function find(int $id, string $userId): Note { + public function find(int $id, string $userId): Ticket { /* @var $qb IQueryBuilder */ $qb = $this->db->getQueryBuilder(); $qb->select('*') diff --git a/lib/Service/NoteService.php b/lib/Service/TicketService.php similarity index 89% rename from lib/Service/NoteService.php rename to lib/Service/TicketService.php index 8f6e167..b2966f3 100644 --- a/lib/Service/NoteService.php +++ b/lib/Service/TicketService.php @@ -7,15 +7,15 @@ use Exception; use OCP\AppFramework\Db\DoesNotExistException; use OCP\AppFramework\Db\MultipleObjectsReturnedException; -use OCA\UPschooling\Db\Note; -use OCA\UPschooling\Db\NoteMapper; +use OCA\UPschooling\Db\Ticket; +use OCA\UPschooling\Db\TicketMapper; -class NoteService { +class TicketService { - /** @var NoteMapper */ + /** @var TicketMapper */ private $mapper; - public function __construct(NoteMapper $mapper) { + public function __construct(TicketMapper $mapper) { $this->mapper = $mapper; } @@ -46,7 +46,7 @@ class NoteService { } public function create($title, $content, $userId) { - $note = new Note(); + $note = new Ticket(); $note->setTitle($title); $note->setContent($content); $note->setUserId($userId); diff --git a/src/App.vue b/src/App.vue index dab9b22..b0b223d 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,215 +1,25 @@