Copy.php 946 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Created by PhpStorm
  4. * User: song
  5. * Date: 2020/9/28/0028
  6. * Time: 16:14
  7. */
  8. namespace crmeb\services\product\storage;
  9. use crmeb\basic\BaseProduct;
  10. /**
  11. * Class Copy
  12. * @package crmeb\services\product\storage
  13. */
  14. class Copy extends BaseProduct
  15. {
  16. /**
  17. * 是否开通
  18. */
  19. const PRODUCT_OPEN = 'copy/open';
  20. /**
  21. * 获取详情
  22. */
  23. const PRODUCT_GOODS = 'copy/goods';
  24. /** 初始化
  25. * @param array $config
  26. */
  27. protected function initialize(array $config = [])
  28. {
  29. parent::initialize($config);
  30. }
  31. /** 是否开通复制
  32. * @return mixed
  33. */
  34. public function open()
  35. {
  36. return $this->accessToken->httpRequest(self::PRODUCT_OPEN, []);
  37. }
  38. /** 复制商品
  39. * @return mixed
  40. */
  41. public function goods($url)
  42. {
  43. $param['url'] = $url;
  44. return $this->accessToken->httpRequest(self::PRODUCT_GOODS, $param);
  45. }
  46. }