ChatController.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. <?php
  2. namespace App\Http\Controllers\Api;
  3. use App\Http\Validator\CoinValidator;
  4. use App\Services\ChatMessageService;
  5. use App\Services\Common\CoinLogService;
  6. /**
  7. * 聊天
  8. * Class ChatController
  9. * @package App\Http\Controllers\Api
  10. */
  11. class ChatController extends webApp
  12. {
  13. public function __construct()
  14. {
  15. parent::__construct();
  16. $this->service = new ChatMessageService();
  17. }
  18. /**
  19. * 获取列表
  20. * @return array|mixed
  21. */
  22. public function index()
  23. {
  24. $pageSize = request()->post('pageSize', 15);
  25. $params = request()->all();
  26. $params['user_id'] = $this->userId;
  27. $list = $this->service->getDataList($params, $pageSize);
  28. return message(1002, true, $list);
  29. }
  30. /**
  31. * 获取列表
  32. * @return array|mixed
  33. */
  34. public function newList()
  35. {
  36. $pageSize = request()->post('pageSize', 15);
  37. $params = request()->all();
  38. $params['user_id'] = $this->userId;
  39. $list = $this->service->getNewList($params, $pageSize);
  40. return message(1002, true, $list);
  41. }
  42. }