DynamicComment.php 869 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace app\api\controller;
  3. use app\api\model\UserDynamicComment;
  4. use app\api\service\User as UserService;
  5. /**
  6. * 动态评论控制器
  7. * Class DynamicComment
  8. * @package app\api\controller
  9. */
  10. class DynamicComment 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 UserDynamicComment();
  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. }