From 34523c1c5fe69a2e6ee10ffcbc9124af8751d133 Mon Sep 17 00:00:00 2001 From: gzydong <837215079@qq.com> Date: Sat, 22 Jan 2022 21:10:29 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=85=BC=E5=AE=B9=E5=BC=80=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/Api/V1/Article/ArticleController.php | 4 +--- app/Controller/Api/V1/Talk/MessageController.php | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) 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',