chg: dev: create the UserStats entity what is a Materialized View to store Profile stats for every user - & massive ProfileController refactor #8
This commit is contained in:
56
src/Dto/ProfileGameDto.php
Normal file
56
src/Dto/ProfileGameDto.php
Normal file
@@ -0,0 +1,56 @@
|
||||
<?php declare(strict_types=1);
|
||||
/**
|
||||
* This file is part of the SplendidBear Websites' projects.
|
||||
*
|
||||
* Copyright (c) 2026 @ www.splendidbear.org
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace App\Dto;
|
||||
|
||||
use JsonSerializable;
|
||||
|
||||
/**
|
||||
* Class ProfileGameDto
|
||||
*
|
||||
* @package App\Dto
|
||||
* @author Lang <https://www.splendidbear.org>
|
||||
* @category Class
|
||||
* @license https://www.gnu.org/licenses/lgpl-3.0.en.html GNU Lesser General Public License
|
||||
* @link www.splendidbear.org
|
||||
* @since 2026. 04. 20.
|
||||
*/
|
||||
final readonly class ProfileGameDto implements JsonSerializable
|
||||
{
|
||||
public function __construct(
|
||||
public ?int $id,
|
||||
public ?string $uuid,
|
||||
public string $redName,
|
||||
public string $blueName,
|
||||
public ?string $redAvatar,
|
||||
public ?string $blueAvatar,
|
||||
public ?int $redPoints,
|
||||
public ?int $bluePoints,
|
||||
public ?bool $redExplodedBomb,
|
||||
public ?bool $blueExplodedBomb,
|
||||
public ?string $resign,
|
||||
public ?string $created,
|
||||
public ?string $date,
|
||||
public bool $isRed,
|
||||
public string $result,
|
||||
public ?int $myPoints,
|
||||
public ?int $oppPoints,
|
||||
public float $redBonusPoints,
|
||||
public float $blueBonusPoints,
|
||||
public array $redBonusStats,
|
||||
public array $blueBonusStats,
|
||||
) {
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
return get_object_vars($this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user