From 4b3ab5e31ca84f1ab12fd784a2b0a268460b8cc5 Mon Sep 17 00:00:00 2001 From: Hide_D Date: Sat, 28 Sep 2024 13:04:29 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=EC=84=A4=EB=AC=B8=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=20=EC=8B=9C=20=EB=93=B1=EB=A1=9D=EC=9E=90=20=EC=9C=A0=EC=A0=80?= =?UTF-8?q?=EB=AA=85=20=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- hwe/sammo/API/Vote/NewVote.php | 5 +++++ hwe/sammo/DTO/VoteInfo.php | 1 + 2 files changed, 6 insertions(+) diff --git a/hwe/sammo/API/Vote/NewVote.php b/hwe/sammo/API/Vote/NewVote.php index 519dd078..507b759e 100644 --- a/hwe/sammo/API/Vote/NewVote.php +++ b/hwe/sammo/API/Vote/NewVote.php @@ -7,6 +7,7 @@ use sammo\DB; use sammo\DTO\VoteInfo; use sammo\Enums\APIRecoveryType; use sammo\KVStorage; +use sammo\RootDB; use sammo\Session; use sammo\TimeUtil; use sammo\Util; @@ -93,6 +94,8 @@ class NewVote extends \sammo\BaseAPI } } + $userName = $session->userName; + $db = DB::db(); $gameStor = KVStorage::getStorage($db, 'game_env'); @@ -108,9 +111,11 @@ class NewVote extends \sammo\BaseAPI $multipleOptions = Util::valueFit($multipleOptions, 0, count($options)); + $voteInfo = new VoteInfo( id: $voteID, title: $title, + opener: $userName ?? '[SYSTEM]', multipleOptions: $multipleOptions, startDate: $now, endDate: $endDate, diff --git a/hwe/sammo/DTO/VoteInfo.php b/hwe/sammo/DTO/VoteInfo.php index 9e8e3b74..e6f817ab 100644 --- a/hwe/sammo/DTO/VoteInfo.php +++ b/hwe/sammo/DTO/VoteInfo.php @@ -8,6 +8,7 @@ class VoteInfo extends \LDTO\DTO public int $id, public string $title, public int $multipleOptions, + public ?string $opener, public string $startDate, public ?string $endDate,