Dynamic.php 821 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Dynamic
  8. * @package app\api\controller
  9. */
  10. class Dynamic extends Controller
  11. {
  12. public function list()
  13. {
  14. }
  15. public function commentMessage()
  16. {
  17. }
  18. /**
  19. * @return \think\response\Json
  20. * @throws \cores\exception\BaseException
  21. */
  22. public function collectMessage()
  23. {
  24. $model = new UserDynamicCollect();
  25. $userInfo = UserService::getCurrentLoginUser(true);
  26. $userId = isset($userInfo['user_id'])? intval($userInfo['user_id']) : 0;
  27. $list = $model->getListByUser($userId, $this->request->param());
  28. return $this->renderSuccess(compact('list'));
  29. }
  30. }