fix: GET은 int를 arg로 받을 수 없음

This commit is contained in:
2022-05-15 17:00:14 +09:00
parent c067b8623c
commit e447a8d038
3 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -25,14 +25,16 @@ class GetHistory extends \sammo\BaseAPI
$v = new Validator($this->args);
$v->rule('required', ['year', 'month'])
->rule('lengthMin', 'serverID', 1)
->rule('int', 'year')
->rule('int', 'month');
->rule('integer', 'year')
->rule('integer', 'month');
if (!$v->validate()) {
return $v->errorStr();
}
if (!$this->args['serverID']) {
$this->args['serverID'] = UniqueConst::$serverID;
}
$this->args['year'] = (int)$this->args['year'];
$this->args['month'] = (int)$this->args['month'];
return null;
}