Compare commits
2 Commits
fix/kazapi
...
63398086b7
| Author | SHA1 | Date | |
|---|---|---|---|
| 63398086b7 | |||
| 1454b9bfc8 |
1
.env
1
.env
@@ -3,6 +3,7 @@ APP_SECRET=
|
|||||||
APP_SHARE_DIR=var/share
|
APP_SHARE_DIR=var/share
|
||||||
APP_VERSION=0.0.1
|
APP_VERSION=0.0.1
|
||||||
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=16&charset=utf8"
|
||||||
|
MESSENGER_TRANSPORT_DSN="doctrine://default"
|
||||||
MAILER_DSN="smtp://localhost:1025"
|
MAILER_DSN="smtp://localhost:1025"
|
||||||
DEFAULT_URI="http://localhost:8000"
|
DEFAULT_URI="http://localhost:8000"
|
||||||
KAZ_API_USER=
|
KAZ_API_USER=
|
||||||
|
|||||||
34
migrations/Version20260313104837.php
Normal file
34
migrations/Version20260313104837.php
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace DoctrineMigrations;
|
||||||
|
|
||||||
|
use Doctrine\DBAL\Schema\Schema;
|
||||||
|
use Doctrine\Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Auto-generated Migration: Please modify to your needs!
|
||||||
|
*/
|
||||||
|
final class Version20260313104837 extends AbstractMigration
|
||||||
|
{
|
||||||
|
public function getDescription(): string
|
||||||
|
{
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function up(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this up() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('CREATE TABLE "user" (id INT GENERATED BY DEFAULT AS IDENTITY NOT NULL, role VARCHAR(255) NOT NULL, mail VARCHAR(255) NOT NULL, mail_quota VARCHAR(255) NOT NULL, mail_de_secours VARCHAR(255) NOT NULL, identifiant_kaz VARCHAR(255) NOT NULL, quota VARCHAR(255) NOT NULL, has_nextcloud_access BOOLEAN NOT NULL, nextcloud_quota VARCHAR(255) NOT NULL, has_mobilizon BOOLEAN NOT NULL, has_agora_access BOOLEAN NOT NULL, PRIMARY KEY (id))');
|
||||||
|
$this->addSql('CREATE TABLE messenger_messages (id BIGINT GENERATED BY DEFAULT AS IDENTITY NOT NULL, body TEXT NOT NULL, headers TEXT NOT NULL, queue_name VARCHAR(190) NOT NULL, created_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, available_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, delivered_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL, PRIMARY KEY (id))');
|
||||||
|
$this->addSql('CREATE INDEX IDX_75EA56E0FB7336F0E3BD61CE16BA31DBBF396750 ON messenger_messages (queue_name, available_at, delivered_at, id)');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function down(Schema $schema): void
|
||||||
|
{
|
||||||
|
// this down() migration is auto-generated, please modify it to your needs
|
||||||
|
$this->addSql('DROP TABLE "user"');
|
||||||
|
$this->addSql('DROP TABLE messenger_messages');
|
||||||
|
}
|
||||||
|
}
|
||||||
179
src/Entity/User.php
Normal file
179
src/Entity/User.php
Normal file
@@ -0,0 +1,179 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entity;
|
||||||
|
|
||||||
|
use App\Repository\UserRepository;
|
||||||
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
|
use Symfony\Component\Validator\Constraints\Uuid;
|
||||||
|
|
||||||
|
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||||
|
#[ORM\Table(name: '`user`')]
|
||||||
|
class User
|
||||||
|
{
|
||||||
|
#[ORM\Id]
|
||||||
|
#[ORM\GeneratedValue]
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?Uuid $id ;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $role = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $mail = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $mailQuota = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $mailDeSecours = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $identifiantKaz = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $quota = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?bool $hasNextcloudAccess = null;
|
||||||
|
|
||||||
|
#[ORM\Column(length: 255)]
|
||||||
|
private ?string $nextcloudQuota = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?bool $hasMobilizon = null;
|
||||||
|
|
||||||
|
#[ORM\Column]
|
||||||
|
private ?bool $hasAgoraAccess = null;
|
||||||
|
|
||||||
|
public function getId(): ?Uuid
|
||||||
|
{
|
||||||
|
return $this->id;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setId(Uuid $id): static
|
||||||
|
{
|
||||||
|
$this->id = $id;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRole(): ?string
|
||||||
|
{
|
||||||
|
return $this->role;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setRole(string $role): static
|
||||||
|
{
|
||||||
|
$this->role = $role;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMail(): ?string
|
||||||
|
{
|
||||||
|
return $this->mail;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMail(string $mail): static
|
||||||
|
{
|
||||||
|
$this->mail = $mail;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMailQuota(): ?string
|
||||||
|
{
|
||||||
|
return $this->mailQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMailQuota(string $mailQuota): static
|
||||||
|
{
|
||||||
|
$this->mailQuota = $mailQuota;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMailDeSecours(): ?string
|
||||||
|
{
|
||||||
|
return $this->mailDeSecours;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setMailDeSecours(string $mailDeSecours): static
|
||||||
|
{
|
||||||
|
$this->mailDeSecours = $mailDeSecours;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIdentifiantKaz(): ?string
|
||||||
|
{
|
||||||
|
return $this->identifiantKaz;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setIdentifiantKaz(string $identifiantKaz): static
|
||||||
|
{
|
||||||
|
$this->identifiantKaz = $identifiantKaz;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getQuota(): ?string
|
||||||
|
{
|
||||||
|
return $this->quota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setQuota(string $quota): static
|
||||||
|
{
|
||||||
|
$this->quota = $quota;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasNextcloudAccess(): ?bool
|
||||||
|
{
|
||||||
|
return $this->hasNextcloudAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHasNextcloudAccess(bool $hasNextcloudAccess): static
|
||||||
|
{
|
||||||
|
$this->hasNextcloudAccess = $hasNextcloudAccess;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getNextcloudQuota(): ?string
|
||||||
|
{
|
||||||
|
return $this->nextcloudQuota;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setNextcloudQuota(string $nextcloudQuota): static
|
||||||
|
{
|
||||||
|
$this->nextcloudQuota = $nextcloudQuota;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasMobilizon(): ?bool
|
||||||
|
{
|
||||||
|
return $this->hasMobilizon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHasMobilizon(bool $hasMobilizon): static
|
||||||
|
{
|
||||||
|
$this->hasMobilizon = $hasMobilizon;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function hasAgoraAccess(): ?bool
|
||||||
|
{
|
||||||
|
return $this->hasAgoraAccess;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function setHasAgoraAccess(bool $hasAgoraAccess): static
|
||||||
|
{
|
||||||
|
$this->hasAgoraAccess = $hasAgoraAccess;
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
}
|
||||||
43
src/Repository/UserRepository.php
Normal file
43
src/Repository/UserRepository.php
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Repository;
|
||||||
|
|
||||||
|
use App\Entity\User;
|
||||||
|
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||||
|
use Doctrine\Persistence\ManagerRegistry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @extends ServiceEntityRepository<User>
|
||||||
|
*/
|
||||||
|
class UserRepository extends ServiceEntityRepository
|
||||||
|
{
|
||||||
|
public function __construct(ManagerRegistry $registry)
|
||||||
|
{
|
||||||
|
parent::__construct($registry, User::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
// /**
|
||||||
|
// * @return User[] Returns an array of User objects
|
||||||
|
// */
|
||||||
|
// public function findByExampleField($value): array
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->orderBy('u.id', 'ASC')
|
||||||
|
// ->setMaxResults(10)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
|
||||||
|
// public function findOneBySomeField($value): ?User
|
||||||
|
// {
|
||||||
|
// return $this->createQueryBuilder('u')
|
||||||
|
// ->andWhere('u.exampleField = :val')
|
||||||
|
// ->setParameter('val', $value)
|
||||||
|
// ->getQuery()
|
||||||
|
// ->getOneOrNullResult()
|
||||||
|
// ;
|
||||||
|
// }
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user