<?php
namespace App\Controller;
use App\Service\GoogleSheet\GoogleSheetGroups;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use App\Service\LangLionService;
class StationaryCoursesController extends AbstractController
{
public function __construct(
private LangLionService $langLionService,
private GoogleSheetGroups $googleSheetGroups)
{}
/**
* @Route("/scratch", name="app_stationary_course_scratch")
*/
public function scratch(): Response
{
$accessToken = $this->langLionService->authorize();
if (!$accessToken) {
return new Response('Authorization failed', Response::HTTP_UNAUTHORIZED);
}
$groups = $this->langLionService->getGroups($accessToken, null, 'programowanie');
// $groups = $this->googleSheetGroups->getGroups(filterCourse: 'programowanie');
return $this->render('stationary_courses/scratch.html.twig', [
'groups' => $groups
])->setSharedMaxAge(3600);
}
/**
* @Route("/minecraft", name="app_stationary_course_minecraft")
*/
public function minecraft(): Response
{
return $this->render('stationary_courses/minecraft.html.twig', [
'controller_name' => 'StationaryCoursesController',
]);
}
/**
* @Route("/robotyka", name="app_stationary_course_robotyka")
*/
public function robotyka(): Response
{
$accessToken = $this->langLionService->authorize();
if (!$accessToken) {
return new Response('Authorization failed', Response::HTTP_UNAUTHORIZED);
}
$groups = $this->langLionService->getGroups($accessToken, null, 'robotyka');
// $groups = $this->googleSheetGroups->getGroups(filterCourse: 'robotyka');
return $this->render('stationary_courses/robotyka.html.twig', [
'groups' => $groups
])->setSharedMaxAge(3600);
}
/**
* @Route("/darmowe-warsztaty", name="app_stationary_course_free_class")
*/
public function freeLesson(): Response
{
return $this->render('stationary_courses/free-lesson.html.twig', [
'controller_name' => 'StationaryCoursesController',
]);
}
/**
* @Route("/przedszkola", name="app_stationary_course_preschool")
*/
public function preschool(): Response
{
$accessToken = $this->langLionService->authorize();
if (!$accessToken) {
return new Response('Authorization failed', Response::HTTP_UNAUTHORIZED);
}
$groups = $this->langLionService->getGroups($accessToken, null, 'programowanie');
return $this->render('stationary_courses/preschool.html.twig', [
'groups' => $groups
])->setSharedMaxAge(3600);
}
}