dataLists(new ArticleCommentLists()); } /** * @notes 添加评论 * @return \think\response\Json * @author likeadmin * @date 2024/02/18 15:03 */ public function add() { $params = (new ArticleCommentValidate())->post()->goCheck('add'); $result = ArticleCommentLogic::add($params); if (true === $result) { return $this->success('添加成功', [], 1, 1); } return $this->fail(ArticleCommentLogic::getError()); } /** * @notes 编辑评论 * @return \think\response\Json * @author likeadmin * @date 2024/02/18 15:03 */ public function edit() { $params = (new ArticleCommentValidate())->post()->goCheck('edit'); $result = ArticleCommentLogic::edit($params); if (true === $result) { return $this->success('编辑成功', [], 1, 1); } return $this->fail(ArticleCommentLogic::getError()); } /** * @notes 删除评论 * @return \think\response\Json * @author likeadmin * @date 2024/02/18 15:03 */ public function delete() { $params = (new ArticleCommentValidate())->post()->goCheck('delete'); ArticleCommentLogic::delete($params); return $this->success('删除成功', [], 1, 1); } /** * @notes 获取评论详情 * @return \think\response\Json * @author likeadmin * @date 2024/02/18 15:03 */ public function detail() { $params = (new ArticleCommentValidate())->goCheck('detail'); $result = ArticleCommentLogic::detail($params); return $this->data($result); } }