FriendController.php 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. namespace App\Generated\Controllers\V1;
  3. use App\Generated\V1\Messages\Friend\GetUnreadCountMessage;
  4. use App\Http\Controllers\Controller;
  5. use App\Generated\V1\Messages\Friend\GetChatHistoryMessage;
  6. use App\Generated\V1\Messages\Friend\GetEachLikeListMessage;
  7. use App\Generated\V1\Messages\Friend\AgreeApplyMessage;
  8. use App\Generated\V1\Messages\Friend\GetApplyReceiveListMessage;
  9. use App\Generated\V1\Messages\Friend\GetStarListMessage;
  10. use App\Generated\V1\Messages\Friend\GetApplySendListMessage;
  11. use App\Http\Services\V1\FriendService;
  12. use App\Generated\V1\Messages\Friend\GetApplyAllListMessage;
  13. use App\Generated\V1\Messages\Friend\GetAllListMessage;
  14. use DB;
  15. class FriendController extends Controller
  16. {
  17. public $handler;
  18. public function __construct(FriendService $handler)
  19. {
  20. $this->handler = $handler;
  21. }
  22. public function agreeApply(AgreeApplyMessage $message)
  23. {
  24. $message->validateInput();
  25. $this->handler->agreeApply($message);
  26. $message->validateOutput();
  27. return $message->getResponse();
  28. }
  29. public function getUnreadCount(GetUnreadCountMessage $message)
  30. {
  31. $message->validateInput();
  32. $this->handler->getUnreadCount($message);
  33. $message->validateOutput();
  34. return $message->getResponse();
  35. }
  36. public function getChatHistory(GetChatHistoryMessage $message)
  37. {
  38. $message->validateInput();
  39. $this->handler->getChatHistory($message);
  40. $message->validateOutput();
  41. return $message->getResponse();
  42. }
  43. public function getStarList(GetStarListMessage $message)
  44. {
  45. $message->validateInput();
  46. $this->handler->getStarList($message);
  47. $message->validateOutput();
  48. return $message->getResponse();
  49. }
  50. public function getEachLikeList(GetEachLikeListMessage $message)
  51. {
  52. $message->validateInput();
  53. $this->handler->getEachLikeList($message);
  54. $message->validateOutput();
  55. return $message->getResponse();
  56. }
  57. public function getAllList(GetAllListMessage $message)
  58. {
  59. $message->validateInput();
  60. $this->handler->getAllList($message);
  61. $message->validateOutput();
  62. return $message->getResponse();
  63. }
  64. public function getApplyReceiveList(GetApplyReceiveListMessage $message)
  65. {
  66. $message->validateInput();
  67. $this->handler->getApplyReceiveList($message);
  68. $message->validateOutput();
  69. return $message->getResponse();
  70. }
  71. public function getApplySendList(GetApplySendListMessage $message)
  72. {
  73. $message->validateInput();
  74. $this->handler->getApplySendList($message);
  75. $message->validateOutput();
  76. return $message->getResponse();
  77. }
  78. public function getApplyAllList(GetApplyAllListMessage $message)
  79. {
  80. $message->validateInput();
  81. $this->handler->getApplyAllList($message);
  82. $message->validateOutput();
  83. return $message->getResponse();
  84. }
  85. }