Domain.php 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | CatchAdmin [Just Like ~ ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2017~2020 http://catchadmin.com All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt )
  8. // +----------------------------------------------------------------------
  9. // | Author: JaguarJack [ njphper@gmail.com ]
  10. // +----------------------------------------------------------------------
  11. namespace catchAdmin\domain\support\driver\qcloud;
  12. use catchAdmin\domain\support\contract\DomainActionInterface;
  13. use catchAdmin\domain\support\driver\ApiTrait;
  14. use catchAdmin\domain\support\Transformer;
  15. class Domain implements DomainActionInterface
  16. {
  17. use ApiTrait;
  18. public function getList(array $params)
  19. {
  20. $offset = ($params['page'] ?? 1) - 1;
  21. $length = $params['limit'] ?? 10;
  22. // TODO: Implement getList() method.
  23. return Transformer::qcloudDomainPaginate($this->get([
  24. 'Action' => 'DomainList',
  25. 'offset' => $offset,
  26. 'length' => $length
  27. ]), $offset, $length);
  28. }
  29. public function store(array $params)
  30. {
  31. // TODO: Implement add() method.
  32. }
  33. public function delete(array $params)
  34. {
  35. // TODO: Implement delete() method.
  36. return $this->get([
  37. 'Action' => 'DeleteDomain',
  38. 'DomainName' => $params['name'],
  39. ]);
  40. }
  41. public function read($name)
  42. {
  43. // TODO: Implement info() method.
  44. return $this->get([
  45. 'Action' => 'DescribeDomainInfo',
  46. 'DomainName' => $name
  47. ]);
  48. }
  49. }