feat: 연감을 가져오는 API
- Global/GetHistory - 과거 기록. 캐싱 가능 - GetCurrentHistory - 현재 기록. 캐싱 불가
This commit is contained in:
@@ -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