Application.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php
  2. namespace App\Libs\TikTok\OpenPlatform;
  3. use App\Libs\TikTok\Kernel\ServiceContainer;
  4. use App\Libs\TikTok\Kernel\Traits\ResponseCastable;
  5. /**
  6. * Class Application.
  7. * @property Auth\AccessToken $access_token
  8. * @property Auth\Client $auth
  9. * @property \Overtrue\Socialite\Providers\DouYin $oauth
  10. * @property Base\Client $base
  11. * @property UserData\Client $user_data
  12. * @property FansData\Client $fans_data
  13. * @property Video\Client $video
  14. * @property VideoData\Client $video_data
  15. * @property Im\Client $im
  16. * @property Event\Client $event
  17. * @author zhaoxiang <zhaoxiang051405@gmail.com>
  18. */
  19. class Application extends ServiceContainer
  20. {
  21. use ResponseCastable;
  22. /**
  23. * @var array
  24. */
  25. protected $providers = [
  26. Auth\ServiceProvider::class,
  27. OAuth\ServiceProvider::class,
  28. FansData\ServiceProvider::class,
  29. UserData\ServiceProvider::class,
  30. Video\ServiceProvider::class,
  31. VideoData\ServiceProvider::class,
  32. Im\ServiceProvider::class,
  33. Event\ServiceProvider::class,
  34. Base\ServiceProvider::class
  35. ];
  36. /**
  37. * 初始化开放平台的基础接口
  38. * @var array|\string[][]
  39. */
  40. protected $defaultConfig = [
  41. 'http' => [
  42. 'base_uri' => 'https://open.douyin.com/',
  43. ],
  44. ];
  45. /**
  46. * Handle dynamic calls.
  47. *
  48. * @param string $method
  49. * @param array $args
  50. *
  51. * @return mixed
  52. */
  53. public function __call(string $method, array $args)
  54. {
  55. return $this->base->$method(...$args);
  56. }
  57. }