dataLists(new ArticleLists()); } /** * @notes 文章分类列表 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 15:30 */ public function cate() { return $this->data(ArticleLogic::cate()); } /** * @notes 收藏列表 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 16:31 */ public function collect() { return $this->dataLists(new ArticleCollectLists()); } /** * @notes 文章详情 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 17:09 */ public function detail() { $id = $this->request->get('id/d'); $result = ArticleLogic::detail($id, $this->userId); return $this->data($result); } /** * @notes 加入收藏 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 17:01 */ public function addCollect() { $articleId = $this->request->post('id/d'); ArticleLogic::addCollect($articleId, $this->userId); return $this->success('操作成功'); } /** * @notes 取消收藏 * @return \think\response\Json * @author 段誉 * @date 2022/9/20 17:01 */ public function cancelCollect() { $articleId = $this->request->post('id/d'); ArticleLogic::cancelCollect($articleId, $this->userId); return $this->success('操作成功'); } }