UserController.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <?php
  2. namespace App\Generated\Controllers\V1;
  3. use App\Generated\V1\Messages\User\StoreSelfPartnerMessage;
  4. use App\Generated\V1\Messages\User\ToggleTagMessage;
  5. use App\Generated\V1\Messages\User\UpdateProfileMessage;
  6. use App\Http\Controllers\Controller;
  7. use App\Http\Services\V1\UserService;
  8. use App\Generated\V1\Messages\User\CreateAnswerMessage;
  9. use App\Generated\V1\Messages\User\GetQuestionListMessage;
  10. use App\Generated\V1\Messages\User\GetQuestionAnswerListMessage;
  11. use App\Generated\V1\Messages\User\SelectCoverMessage;
  12. use App\Generated\V1\Messages\User\DeletePhotosMessage;
  13. use App\Generated\V1\Messages\User\GetFpdxProfileMessage;
  14. use App\Generated\V1\Messages\User\ProfileMessage;
  15. use App\Generated\V1\Messages\User\GetQuestionInfoMessage;
  16. use DB;
  17. class UserController extends Controller
  18. {
  19. public $handler;
  20. public function __construct(UserService $handler)
  21. {
  22. $this->handler = $handler;
  23. }
  24. public function selectCover(SelectCoverMessage $message)
  25. {
  26. $message->validateInput();
  27. $this->handler->selectCover($message);
  28. $message->validateOutput();
  29. return $message->getResponse();
  30. }
  31. public function deletePhotos(DeletePhotosMessage $message)
  32. {
  33. $message->validateInput();
  34. $this->handler->deletePhotos($message);
  35. $message->validateOutput();
  36. return $message->getResponse();
  37. }
  38. public function createAnswer(CreateAnswerMessage $message)
  39. {
  40. $message->validateInput();
  41. $this->handler->createAnswer($message);
  42. $message->validateOutput();
  43. return $message->getResponse();
  44. }
  45. public function getQuestionAnswerList(GetQuestionAnswerListMessage $message)
  46. {
  47. $message->validateInput();
  48. $this->handler->getQuestionAnswerList($message);
  49. $message->validateOutput();
  50. return $message->getResponse();
  51. }
  52. public function getQuestionInfo(GetQuestionInfoMessage $message)
  53. {
  54. $message->validateInput();
  55. $this->handler->getQuestionInfo($message);
  56. $message->validateOutput();
  57. return $message->getResponse();
  58. }
  59. public function getQuestionList(GetQuestionListMessage $message)
  60. {
  61. $message->validateInput();
  62. $this->handler->getQuestionList($message);
  63. $message->validateOutput();
  64. return $message->getResponse();
  65. }
  66. public function storeSelfPartner(StoreSelfPartnerMessage $message)
  67. {
  68. $message->validateInput();
  69. $this->handler->storeSelfPartner($message);
  70. $message->validateOutput();
  71. return $message->getResponse();
  72. }
  73. public function toggleTag(ToggleTagMessage $message)
  74. {
  75. $message->validateInput();
  76. $this->handler->toggleTag($message);
  77. $message->validateOutput();
  78. return $message->getResponse();
  79. }
  80. public function updateProfile(UpdateProfileMessage $message)
  81. {
  82. $message->validateInput();
  83. $this->handler->updateProfile($message);
  84. $message->validateOutput();
  85. return $message->getResponse();
  86. }
  87. public function getFpdxProfile(GetFpdxProfileMessage $message)
  88. {
  89. $message->validateInput();
  90. $this->handler->getFpdxProfile($message);
  91. $message->validateOutput();
  92. return $message->getResponse();
  93. }
  94. public function profile(ProfileMessage $message)
  95. {
  96. $message->validateInput();
  97. $this->handler->profile($message);
  98. $message->validateOutput();
  99. return $message->getResponse();
  100. }
  101. }