GetContactMessage.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace App\Generated\V1_1\Messages\Friend;
  3. use Kamicloud\StubApi\Concerns\ValueHelper;
  4. use App\Generated\V1_1\Enums\FriendLevel;
  5. use Kamicloud\StubApi\Http\Messages\Message;
  6. use Kamicloud\StubApi\Utils\Constants;
  7. use App\Generated\V1_1\DTOs\ContactUserDTO;
  8. class GetContactMessage extends Message
  9. {
  10. use ValueHelper;
  11. protected $contactUid;
  12. protected $isUnHandlerFriendApply;
  13. protected $friendLevel;
  14. protected $is_blacklist;
  15. protected $star_at;
  16. protected $contact;
  17. /**
  18. * @return int
  19. */
  20. public function getContactUid()
  21. {
  22. return $this->contactUid;
  23. }
  24. public function requestRules()
  25. {
  26. return [
  27. ['contactUid', 'contact_uid', 'bail|integer', Constants::INTEGER, null],
  28. ];
  29. }
  30. public function responseRules()
  31. {
  32. return [
  33. ['isUnHandlerFriendApply', 'is_un_handler_friend_apply', 'bail|boolean', Constants::BOOLEAN, null],
  34. ['friendLevel', 'friend_level', FriendLevel::class, Constants::ENUM, null],
  35. ['is_blacklist', 'is_blacklist', 'bail|integer', Constants::INTEGER, null],
  36. ['star_at', 'star_at', 'bail|nullable|integer', Constants::INTEGER | Constants::OPTIONAL, null],
  37. ['contact', 'contact', ContactUserDTO::class, Constants::MODEL, null],
  38. ];
  39. }
  40. public function setResponse($isUnHandlerFriendApply, $friendLevel, $is_blacklist, $star_at, $contact)
  41. {
  42. $this->isUnHandlerFriendApply = $isUnHandlerFriendApply;
  43. $this->friendLevel = $friendLevel;
  44. $this->is_blacklist = $is_blacklist;
  45. $this->star_at = $star_at;
  46. $this->contact = $contact;
  47. }
  48. }