DynamicCollect.php 885 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\UserDynamicCollect;
  4. use app\api\service\User as UserService;
  5. /**
  6. * 动态收藏点赞控制器
  7. * Class DynamicCollect
  8. * @package app\api\controller
  9. */
  10. class DynamicCollect extends Controller
  11. {
  12. public function list()
  13. {
  14. }
  15. /**
  16. * 点赞收藏消息
  17. * @return \think\response\Json
  18. * @throws \cores\exception\BaseException
  19. */
  20. public function message()
  21. {
  22. $model = new UserDynamicCollect();
  23. $userInfo = UserService::getCurrentLoginUser(true);
  24. $userId = isset($userInfo['user_id'])? intval($userInfo['user_id']) : 0;
  25. $pageSize = $this->request->param('pageSize', 15);
  26. $list = $model->getListByUser($userId, $this->request->param(), (int)$pageSize);
  27. return $this->renderSuccess(compact('list'));
  28. }
  29. }