diff --git a/app/Controller/Api/V1/Article/ArticleController.php b/app/Controller/Api/V1/Article/ArticleController.php index 6e4118c..af3ab76 100644 --- a/app/Controller/Api/V1/Article/ArticleController.php +++ b/app/Controller/Api/V1/Article/ArticleController.php @@ -23,7 +23,6 @@ use Psr\Http\Message\ResponseInterface; */ class ArticleController extends CController { - /** * @var ArticleService */ @@ -35,8 +34,7 @@ class ArticleController extends CController $this->articleService = $service; } - - + /** * 获取笔记列表 * diff --git a/app/Controller/Api/V1/Talk/MessageController.php b/app/Controller/Api/V1/Talk/MessageController.php index 911a83f..9505d1b 100644 --- a/app/Controller/Api/V1/Talk/MessageController.php +++ b/app/Controller/Api/V1/Talk/MessageController.php @@ -59,6 +59,7 @@ class MessageController extends CController public function text(): ResponseInterface { $params = $this->request->inputs(['talk_type', 'receiver_id', 'text']); + $this->validate($params, [ 'talk_type' => 'required|in:1,2', 'receiver_id' => 'required|integer|min:1', @@ -233,6 +234,7 @@ class MessageController extends CController public function vote(): ResponseInterface { $params = $this->request->all(); + $this->validate($params, [ 'receiver_id' => 'required|integer|min:1', 'mode' => 'required|integer|in:0,1', @@ -389,6 +391,7 @@ class MessageController extends CController public function collect(EmoticonService $service): ResponseInterface { $params = $this->request->inputs(['record_id']); + $this->validate($params, [ 'record_id' => 'required|integer' ]); @@ -410,6 +413,7 @@ class MessageController extends CController public function revoke(): ResponseInterface { $params = $this->request->inputs(['record_id']); + $this->validate($params, [ 'record_id' => 'required|integer|min:1' ]); @@ -428,6 +432,7 @@ class MessageController extends CController public function delete(): ResponseInterface { $params = $this->request->inputs(['talk_type', 'receiver_id', 'record_id']); + $this->validate($params, [ 'talk_type' => 'required|in:1,2', 'receiver_id' => 'required|integer|min:1',