feat: 연감을 가져오는 API
- Global/GetHistory - 과거 기록. 캐싱 가능 - GetCurrentHistory - 현재 기록. 캐싱 불가
This commit is contained in:
1 parent
eadbc774e3
commit
c379ecf317
7 files changed
+289
-23
No files matched your search
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace sammo\API\Global;
|
||||
|
||||
use sammo\Session;
|
||||
use DateTimeInterface;
|
||||
|
||||
use function sammo\getCurrentHistory;
|
||||
|
||||
class GetCurrentHistory extends \sammo\BaseAPI
|
||||
{
|
||||
public function validateArgs(): ?string
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getRequiredSessionMode(): int
|
||||
{
|
||||
return static::REQ_GAME_LOGIN | static::REQ_READ_ONLY;
|
||||
}
|
||||
|
||||
public function launch(Session $session, ?DateTimeInterface $modifiedSince, ?string $reqEtag)
|
||||
{
|
||||
$history = getCurrentHistory();
|
||||
|
||||
return [
|
||||
'result' => true,
|
||||
'data' => $history,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user