HomepageController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Generated\Controllers\V1_1;
  3. use App\Http\Services\V1_1\HomepageService;
  4. use App\Generated\V1_1\Messages\Homepage\OpenidFeedMessage;
  5. use App\Generated\V1_1\Messages\Homepage\FeedMessage;
  6. use App\Http\Controllers\Controller;
  7. use App\Generated\V1_1\Messages\Homepage\ActivityTimeTableMessage;
  8. use DB;
  9. use App\Generated\V1_1\Messages\Homepage\FeedScoreMessage;
  10. class HomepageController extends Controller
  11. {
  12. public $handler;
  13. public function __construct(HomepageService $handler)
  14. {
  15. $this->handler = $handler;
  16. }
  17. public function feedScore(FeedScoreMessage $message)
  18. {
  19. $message->validateInput();
  20. $this->handler->feedScore($message);
  21. $message->validateOutput();
  22. return $message->getResponse();
  23. }
  24. public function openidFeed(OpenidFeedMessage $message)
  25. {
  26. $message->validateInput();
  27. $this->handler->openidFeed($message);
  28. $message->validateOutput();
  29. return $message->getResponse();
  30. }
  31. public function feed(FeedMessage $message)
  32. {
  33. $message->validateInput();
  34. $this->handler->feed($message);
  35. $message->validateOutput();
  36. return $message->getResponse();
  37. }
  38. public function activityTimeTable(ActivityTimeTableMessage $message)
  39. {
  40. $message->validateInput();
  41. $this->handler->activityTimeTable($message);
  42. $message->validateOutput();
  43. return $message->getResponse();
  44. }
  45. }