NoticeController.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Generated\Controllers\V1;
  3. use App\Generated\V1\Messages\Notice\UpdateNoticeByKeyMessage;
  4. use App\Generated\V1\Messages\Notice\GetNoticeProfileListMessage;
  5. use App\Http\Services\V1\NoticeService;
  6. use App\Http\Controllers\Controller;
  7. use App\Generated\V1\Messages\Notice\UpdateNoticeByGroupMessage;
  8. use DB;
  9. use App\Generated\V1\Messages\Notice\GetNoticeByKeyToIntMessage;
  10. class NoticeController extends Controller
  11. {
  12. public $handler;
  13. public function __construct(NoticeService $handler)
  14. {
  15. $this->handler = $handler;
  16. }
  17. public function updateNoticeByGroup(UpdateNoticeByGroupMessage $message)
  18. {
  19. $message->validateInput();
  20. $this->handler->updateNoticeByGroup($message);
  21. $message->validateOutput();
  22. return $message->getResponse();
  23. }
  24. public function updateNoticeByKey(UpdateNoticeByKeyMessage $message)
  25. {
  26. $message->validateInput();
  27. $this->handler->updateNoticeByKey($message);
  28. $message->validateOutput();
  29. return $message->getResponse();
  30. }
  31. public function getNoticeByKeyToInt(GetNoticeByKeyToIntMessage $message)
  32. {
  33. $message->validateInput();
  34. $this->handler->getNoticeByKeyToInt($message);
  35. $message->validateOutput();
  36. return $message->getResponse();
  37. }
  38. public function getNoticeProfileList(GetNoticeProfileListMessage $message)
  39. {
  40. $message->validateInput();
  41. $this->handler->getNoticeProfileList($message);
  42. $message->validateOutput();
  43. return $message->getResponse();
  44. }
  45. }