作者 竞泽

合并分支 'feat/upgrade' 到 'master'

Feat/upgrade



查看合并请求 !8

要显示太多修改。

为保证性能只显示 31 of 31+ 个文件。

@@ -82,3 +82,9 @@ try { @@ -82,3 +82,9 @@ try {
82 exit(1) 82 exit(1)
83 83
84 ``` 84 ```
  85 +
  86 +6.生成请求代码
  87 +
  88 +```php
  89 +php bin/release.php
  90 +```
  1 +{"php":"7.4.28","version":"3.7.0:v3.7.0#7705d5a985132a40282d18a176eb9a4a0497747c","indent":" ","lineEnding":"\n","rules":{"blank_line_after_opening_tag":true,"braces":{"allow_single_line_anonymous_class_with_empty_body":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_typehint":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"new_with_braces":true,"no_blank_lines_after_class_opening":true,"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_blank_line_before_namespace":true,"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"visibility_required":true,"blank_line_after_namespace":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"hashes":{"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Application.php":3067316929,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Response\/ResultSet.php":2448324669,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Attribute\/Config\/Option.php":3139177677,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Attribute\/Config\/Config.php":1277397586,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Attribute\/Request.php":275704992,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Util\/Json.php":674735408,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Util\/Sort.php":2809098338,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Util\/Preg.php":1831307163,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Util\/Signature.php":631843017,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Facade\/TiktokShop.php":4147495025,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Mock\/Stream.php":3565750164,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Mock\/Annotation.php":1675605572,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Mock\/Mock.php":1851706671,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Verify.php":232647073,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Client\/Retry.php":3131670704,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Client\/Builder.php":2815448657,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Support\/Client\/Client.php":646216196,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Yunc\/Yunc.php":4071769343,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Yunc\/YuncInterface.php":2116909641,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Token\/Token.php":2577990389,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Token\/TokenInterface.php":328984864,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Order\/OrderInterface.php":2260260609,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Order\/Order.php":2721921917,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/OrderCode\/OrderCodeInterface.php":2389805141,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/OrderCode\/OrderCode.php":2331290622,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Topup\/Topup.php":666779574,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Topup\/TopupInterface.php":1196017667,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Btas\/Btas.php":1324067980,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Btas\/BtasInterface.php":1103528003,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Sms\/Sms.php":2916073722,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Sms\/SmsInterface.php":1367531219,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Pigeon\/PigeonInterface.php":2196008810,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Pigeon\/Pigeon.php":2843685280,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Recycle\/Recycle.php":752747431,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Recycle\/RecycleInterface.php":3457248007,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Member\/Member.php":2237251775,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Member\/MemberInterface.php":353236448,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Antispam\/AntispamInterface.php":2058098396,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Antispam\/Antispam.php":629451906,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Buyin\/BuyinInterface.php":1583187435,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Buyin\/Buyin.php":1476869714,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/RequestProxy.php":2168839413,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/AfterSale\/AfterSale.php":1937742963,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/AfterSale\/AfterSaleInterface.php":1360303012,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Crossborder\/CrossborderInterface.php":668316034,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Crossborder\/Crossborder.php":811260488,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/OpenCloud\/OpenCloud.php":1584687708,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/OpenCloud\/OpenCloudInterface.php":1842174920,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Product\/Product.php":517221480,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Product\/ProductInterface.php":2089196619,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/SupplyChain\/SupplyChain.php":3050466070,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/SupplyChain\/SupplyChainInterface.php":3552458741,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Request.php":3526723210,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Coupons\/Coupons.php":4186604869,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Coupons\/CouponsInterface.php":72367262,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Address\/Address.php":261287665,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Address\/AddressInterface.php":2296139515,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Warehouse\/WarehouseInterface.php":1665978542,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Warehouse\/Warehouse.php":3229084457,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Logistics\/LogisticsInterface.php":1078028808,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Logistics\/Logistics.php":2058828310,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Material\/Material.php":2783208467,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Material\/MaterialInterface.php":500014698,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Iop\/IopInterface.php":2634602830,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Request\/Iop\/Iop.php":1087611524,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/ServiceProvider.php":3482443020,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Exception\/MockException.php":3753573226,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Exception\/ClientException.php":2103649308,"\/Users\/oujingze\/Code\/gitlab\/tiktok_shop\/src\/Exception\/RetryException.php":3823388936}}
  1 +#!/bin/env php
  2 +<?php
  3 +
  4 +use Illuminate\Support\Enumerable;
  5 +
  6 +$app_path = dirname(__DIR__);
  7 +
  8 +$src_path = $app_path . '/src';
  9 +
  10 +/**
  11 + * @param string $message
  12 + * @param string $prefix
  13 + * @return void
  14 + */
  15 +function println(string $message, string $prefix = 'info')
  16 +{
  17 + \fwrite(
  18 + STDOUT,
  19 + '[' . date('Y-m-d H:i:s') . ' ' . strtoupper($prefix) . '] ' . $message . PHP_EOL
  20 + );
  21 +}
  22 +
  23 +/**
  24 + * @param string $url
  25 + * @param array $query
  26 + * @return bool|string
  27 + */
  28 +function curl_fetch(string $url, array $query = []): array
  29 +{
  30 + $ch = \curl_init();
  31 +
  32 + $query && $url .= '?' . http_build_query($query);
  33 +
  34 + \curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  35 +
  36 + \curl_setopt($ch, CURLOPT_URL, $url);
  37 +
  38 + \curl_setopt($ch, CURLOPT_TIMEOUT, 10);
  39 +
  40 + try {
  41 + $body = \curl_exec($ch);
  42 +
  43 + if (is_string($body)) {
  44 + return json_decode($body, true);
  45 + }
  46 + return [];
  47 + } finally {
  48 + \curl_close($ch);
  49 + }
  50 +}
  51 +
  52 +/**
  53 + * @param array $items
  54 + * @param string $subject
  55 + * @return string
  56 + */
  57 +function replaces(array $items, string $subject): string
  58 +{
  59 + return str_replace(
  60 + array_keys($items),
  61 + array_values($items),
  62 + $subject
  63 + );
  64 +}
  65 +
  66 +class Arr
  67 +{
  68 + /**
  69 + * @param array $array
  70 + * @param string|null $key
  71 + * @param $default
  72 + * @return mixed
  73 + */
  74 + public static function get(array $array, string $key = null, $default = null)
  75 + {
  76 + $keys = explode('.', $key);
  77 +
  78 + if (is_null($key)) {
  79 + return $array;
  80 + }
  81 +
  82 + foreach ($keys as $key) {
  83 + if (static::exists($array, $key)) {
  84 + $array = $array[$key];
  85 + } else {
  86 + return $default;
  87 + }
  88 + }
  89 +
  90 + return $array;
  91 + }
  92 +
  93 + /**
  94 + * @param $array
  95 + * @param $key
  96 + * @return bool
  97 + */
  98 + public static function exists($array, $key): bool
  99 + {
  100 + if ($array instanceof Enumerable) {
  101 + return $array->has($key);
  102 + }
  103 +
  104 + if ($array instanceof ArrayAccess) {
  105 + return $array->offsetExists($key);
  106 + }
  107 +
  108 + return array_key_exists($key, $array);
  109 + }
  110 +}
  111 +
  112 +class Cls
  113 +{
  114 + /**
  115 + * @param object $object
  116 + * @param string|null $key
  117 + * @param $default
  118 + * @return mixed|object|null
  119 + */
  120 + public static function get(object $object, string $key = null, $default = null)
  121 + {
  122 + $keys = explode('->', $key);
  123 +
  124 + if (is_null($key)) {
  125 + return $object;
  126 + }
  127 +
  128 + foreach ($keys as $key) {
  129 + if (is_object($object) && static::exists($object, $key)) {
  130 + $object = $object->{$key};
  131 + } elseif (is_array($object) && Arr::exists($object, $key)) {
  132 + $object = Arr::get($object, $key);
  133 + } else {
  134 + return $default;
  135 + }
  136 + }
  137 +
  138 + return $object;
  139 + }
  140 +
  141 + /**
  142 + * @param object $object
  143 + * @param $key
  144 + * @return bool
  145 + */
  146 + public static function exists(object $object, $key): bool
  147 + {
  148 + if ($object instanceof Enumerable) {
  149 + return $object->has($key);
  150 + }
  151 +
  152 + if ($object instanceof ArrayAccess) {
  153 + return $object->offsetExists($key);
  154 + }
  155 +
  156 + return property_exists($object, $key);
  157 + }
  158 +}
  159 +
  160 +class FetchDoc
  161 +{
  162 + /**
  163 + * fetch top doc menus.
  164 + * @return array|null
  165 + */
  166 + public function fetchDocMenus(): array
  167 + {
  168 + return curl_fetch(
  169 + 'https://op.jinritemai.com/doc/external/open/queryDocDirTree',
  170 + ['dirId' => 3]
  171 + );
  172 + }
  173 +
  174 + /**
  175 + * fetch in menu api list
  176 + * @param int $dirId
  177 + * @return array|null
  178 + */
  179 + public function fetchDocApis(int $dirId): array
  180 + {
  181 + return curl_fetch(
  182 + 'https://op.jinritemai.com/doc/external/open/queryDocArticleList',
  183 + [
  184 + 'dirId' => $dirId,
  185 + 'orderType' => 3,
  186 + 'pageIndex' => 0,
  187 + 'pageSize' => 9999,
  188 + 'status' => 1
  189 + ]
  190 + );
  191 + }
  192 +
  193 + /**
  194 + * fetch doc detail
  195 + * @param int $articleId
  196 + * @return array
  197 + */
  198 + public function fetchDocApi(int $articleId): array
  199 + {
  200 + return curl_fetch(
  201 + 'https://op.jinritemai.com/doc/external/open/queryDocArticleDetail',
  202 + [
  203 + 'articleId' => $articleId,
  204 + 'onlyView' => false,
  205 + ]
  206 + );
  207 + }
  208 +}
  209 +
  210 +class Name
  211 +{
  212 + /**
  213 + * 过滤字符串
  214 + * @param string $value
  215 + * @return string
  216 + */
  217 + public static function filter(string $value): string
  218 + {
  219 + $charArr = [];
  220 +
  221 + $len = strlen($value);
  222 +
  223 + for ($i = 0; $i < $len; $i++) {
  224 + $char = ord($value[$i]);
  225 +
  226 + if (($char >= 48 && $char <= 57)
  227 + || ($char >= 97 && $char <= 122)
  228 + || ($char >= 65 && $char <= 90)
  229 + || $char === 95) {
  230 + $charArr[] = $value[$i];
  231 + }
  232 + }
  233 + return join('', $charArr);
  234 + }
  235 +
  236 + /**
  237 + * @param string $value
  238 + * @return string
  239 + */
  240 + public static function methodName(string $value): string
  241 + {
  242 + $value = self::filter($value);
  243 +
  244 + $words = explode(' ', str_replace(['-', '_'], ' ', $value));
  245 +
  246 + $studlyWords = array_map(function ($word) {
  247 + return ucfirst($word);
  248 + }, $words);
  249 +
  250 + return lcfirst(implode($studlyWords));
  251 + }
  252 +
  253 + /**
  254 + * @param string $value
  255 + * @return string
  256 + */
  257 + public static function className(string $value): string
  258 + {
  259 + return ucfirst(static::methodName($value));
  260 + }
  261 +}
  262 +
  263 +class Main
  264 +{
  265 + /**
  266 + * @var CodeSpace
  267 + */
  268 + protected CodeSpace $codeSpace;
  269 +
  270 + /**
  271 + * @var FetchDoc
  272 + */
  273 + protected FetchDoc $fetchDoc;
  274 +
  275 + /**
  276 + * @return void
  277 + */
  278 + public static function run()
  279 + {
  280 + $static = new static();
  281 +
  282 + $static->do();
  283 + }
  284 +
  285 + public function __construct()
  286 + {
  287 + $this->codeSpace = new CodeSpace();
  288 +
  289 + $this->fetchDoc = new FetchDoc();
  290 + }
  291 +
  292 + /**
  293 + * main
  294 + * @return void
  295 + */
  296 + public function do()
  297 + {
  298 + $menus = $this->fetchDoc->fetchDocMenus();
  299 +
  300 + foreach (Arr::get($menus, 'data.dirs', []) as $item) {
  301 + $apis = $this->fetchDoc->fetchDocApis(Arr::get($item, 'id'));
  302 +
  303 + $articles = Arr::get($apis, 'data.articles', []);
  304 +
  305 + $this->codeSpace->push(
  306 + $this->createCodeSpace(
  307 + $item,
  308 + $articles
  309 + )
  310 + );
  311 + }
  312 + }
  313 +
  314 + /**
  315 + * @param array $section
  316 + * @param array $articles
  317 + * @return CodeSelf
  318 + */
  319 + protected function createCodeSpace(array $section, array $articles): CodeSelf
  320 + {
  321 + $code = new CodeSelf();
  322 +
  323 + $code->className = Name::className($this->reckonClsName($articles));
  324 +
  325 + $code->annotate = Arr::get($section, 'name', '');
  326 +
  327 + foreach ($articles as $article) {
  328 + $apiArticle = $this->fetchDoc->fetchDocApi(
  329 + Arr::get($article, 'id')
  330 + );
  331 +
  332 + $subSelf = $this->createCodeMethod(
  333 + $section,
  334 + Arr::get($apiArticle, 'data.article', [])
  335 + );
  336 +
  337 + if ($subSelf->service) {
  338 + $code->methods[] = $this->createCodeMethod(
  339 + $section,
  340 + Arr::get($apiArticle, 'data.article', [])
  341 + );
  342 + }
  343 + }
  344 +
  345 + $this->codeSpace->push($code);
  346 +
  347 + return $code;
  348 + }
  349 +
  350 + /**
  351 + * @param array $section
  352 + * @param array $article
  353 + * @return CodeSubSelf
  354 + */
  355 + protected function createCodeMethod(array $section, array $article): CodeSubSelf
  356 + {
  357 + $subSelf = new CodeSubSelf();
  358 +
  359 + $content = Arr::get($article, 'content');
  360 +
  361 + if (strpos($content, 'TreeTable') !== false) {
  362 + preg_match(
  363 + '/"demoValue":"([^"]*)"/',
  364 + Arr::get($article, 'content'),
  365 + $match
  366 + );
  367 +
  368 + $subSelf->service = Arr::get($match, 1);
  369 + } elseif (strpos(Arr::get($article, 'content'), '|--|--|') !== false) {
  370 + $parts = explode(PHP_EOL, $content);
  371 +
  372 + $flag = false;
  373 +
  374 + $pos = 0;
  375 +
  376 + foreach ($parts as $key => $line) {
  377 + if (mb_strpos($line, '公共参数') !== false) {
  378 + $pos = $key;
  379 + }
  380 +
  381 + if ($pos && $key == $pos + 1) {
  382 + $flag = true;
  383 + }
  384 +
  385 + if ($flag && '' == $line) {
  386 + $flag = false;
  387 + }
  388 +
  389 + if ($flag) {
  390 + if ($key === $pos + 3) {
  391 + $parts = explode('|', trim($line, '|'));
  392 +
  393 + $subSelf->service = trim($parts[3]);
  394 + }
  395 + }
  396 + }
  397 + } else {
  398 + $content = json_decode(
  399 + $content,
  400 + true,
  401 + 512,
  402 + JSON_INVALID_UTF8_SUBSTITUTE
  403 + );
  404 +
  405 + $subSelf->service = Arr::get($content, 'request.publicParam.0.example');
  406 + }
  407 +
  408 + $subSelf->method = 'POST';
  409 +
  410 + $subSelf->path = Arr::get($article, 'info.title');
  411 +
  412 + $subSelf->name = Name::methodName(
  413 + str_replace('.', '_', $subSelf->service)
  414 + );
  415 +
  416 + $subSelf->docUri = sprintf(
  417 + 'https://op.jinritemai.com/docs/api-docs/%d/%d',
  418 + Arr::get($section, 'id'),
  419 + Arr::get($article, 'info.id')
  420 + );
  421 +
  422 + $subSelf->annotate = Arr::get($article, 'info.subtitle');
  423 +
  424 + return $subSelf;
  425 + }
  426 +
  427 + /**
  428 + * @param array $articles
  429 + * @return false|int|string
  430 + */
  431 + protected function reckonClsName(array $articles): string
  432 + {
  433 + $titles = array_map(function ($article) {
  434 + $title = trim(Arr::get($article, 'title', ''), '/');
  435 +
  436 + $parts = explode('/', $title);
  437 +
  438 + return $parts ? $parts[0] : '';
  439 + }, $articles);
  440 +
  441 + $titleCountValues = array_count_values($titles);
  442 +
  443 + arsort($titleCountValues);
  444 +
  445 + return current(array_keys($titleCountValues));
  446 + }
  447 +
  448 + /**
  449 + * @return string[]
  450 + */
  451 + protected function refreshAnnotate(): array
  452 + {
  453 + $queue = $this->codeSpace->toQueue();
  454 +
  455 + $targets = [];
  456 + do {
  457 + /**
  458 + * @var CodeSelf $code
  459 + */
  460 + $code = $queue->pop();
  461 +
  462 + $targets[] = Name::methodName($code->className);
  463 + } while (!$queue->isEmpty());
  464 +
  465 + $targets = array_unique($targets);
  466 +
  467 + $metaMethods = array_map(function ($target) {
  468 + $name = ucfirst($target);
  469 + $interface = sprintf('Request\\%s\\%sInterface', $name, $name);
  470 + $method = lcfirst($target);
  471 + return ' * @method ' . $interface . ' ' . $method . '()';
  472 + }, $targets);
  473 +
  474 + array_unshift($metaMethods, ' * @method Verify verify()');
  475 +
  476 + $metaAnnotate = '/**' . "\n";
  477 + $metaAnnotate .= join("\n", $metaMethods) . "\n";
  478 + $metaAnnotate .= ' */';
  479 +
  480 + global $src_path;
  481 +
  482 + $metaFile = $src_path . '/Application.php';
  483 +
  484 + require_once $metaFile;
  485 +
  486 + $ref = new ReflectionClass(\Lackoxygen\TiktokShop\Application::class);
  487 +
  488 + $content = file_get_contents($metaFile);
  489 +
  490 + file_put_contents($metaFile, str_replace($ref->getDocComment(), $metaAnnotate, $content));
  491 +
  492 + return $metaMethods;
  493 + }
  494 +
  495 + /**
  496 + * @param array $metas
  497 + * @return void
  498 + */
  499 + protected function createFacade(array $metas)
  500 + {
  501 + $facade = <<<FACADE
  502 +<?php
  503 +
  504 +namespace Lackoxygen\TiktokShop\Facade;
  505 +
  506 +use Lackoxygen\TiktokShop\Request;
  507 +use Illuminate\Support\Facades\Facade;
  508 +use Lackoxygen\TiktokShop\Support\Verify;
  509 +use Lackoxygen\TiktokShop\Application;
  510 +
  511 +\${ANNOTATE}
  512 +
  513 +class TiktokShop extends Facade
  514 +{
  515 + /**
  516 + * @return string
  517 + */
  518 + protected static function getFacadeAccessor(): string
  519 + {
  520 + return Application::class;
  521 + }
  522 +}
  523 +FACADE;
  524 +
  525 + $keyword = '@method';
  526 +
  527 + $metas = array_map(function ($meta) use ($keyword) {
  528 + $pos = strpos($meta, $keyword);
  529 +
  530 + $left = substr($meta, 0, $pos + strlen($keyword));
  531 +
  532 + $right = substr($meta, $pos + strlen($keyword));
  533 +
  534 + return $left . ' static' . $right;
  535 + }, $metas);
  536 +
  537 + array_unshift(
  538 + $metas,
  539 + ' * @method static Application setAccessToken(string $accessToken)',
  540 + ' * @method static Application use ($options)'
  541 + );
  542 +
  543 + $metaAnnotate = '/**' . "\n";
  544 + $metaAnnotate .= join("\n", $metas) . "\n";
  545 + $metaAnnotate .= ' */';
  546 +
  547 + $facadeContent = replaces(['${ANNOTATE}' => $metaAnnotate], $facade);
  548 +
  549 + global $src_path;
  550 +
  551 + file_put_contents(
  552 + $src_path . '/Facade/TiktokShop.php',
  553 + $facadeContent
  554 + );
  555 + }
  556 +
  557 + protected function fixStyle()
  558 + {
  559 + global $app_path;
  560 +
  561 + $cs = $app_path . '/vendor/bin/php-cs-fixer';
  562 +
  563 + if (!file_exists($cs)) {
  564 + return;
  565 + }
  566 +
  567 + $directory = $app_path . '/src';
  568 +
  569 + `{$cs} fix --quiet {$directory} --rules=@PSR12 > /dev/null`;
  570 + }
  571 +
  572 + public function __destruct()
  573 + {
  574 + $this->codeSpace->write();
  575 +
  576 + $metas = $this->refreshAnnotate();
  577 +
  578 + $this->createFacade($metas);
  579 +
  580 + $this->fixStyle();
  581 +
  582 + println('success!');
  583 + }
  584 +}
  585 +
  586 +class CodeSpace
  587 +{
  588 + protected SplQueue $spaces;
  589 +
  590 + protected CodeWriter $writer;
  591 +
  592 + public function __construct()
  593 + {
  594 + $this->spaces = new SplQueue();
  595 +
  596 + $this->writer = new CodeWriter();
  597 + }
  598 +
  599 + public function push(CodeSelf $codeSelf)
  600 + {
  601 + $this->spaces->push($codeSelf);
  602 + }
  603 +
  604 + public function write()
  605 + {
  606 + $this->writer->batchWrite($this->toQueue());
  607 + }
  608 +
  609 + public function toQueue(): SplQueue
  610 + {
  611 + return clone $this->spaces;
  612 + }
  613 +}
  614 +
  615 +class CodeWriter
  616 +{
  617 + /**
  618 + * @param SplQueue $queue
  619 + * @return void
  620 + */
  621 + public function batchWrite(SplQueue $queue)
  622 + {
  623 + do {
  624 + $code = $queue->pop();
  625 +
  626 + $this->write($code);
  627 + } while (!$queue->isEmpty());
  628 + }
  629 +
  630 + /**
  631 + * @param CodeSelf $codeSelf
  632 + * @return void
  633 + */
  634 + public function write(CodeSelf $codeSelf)
  635 + {
  636 + $interface = new CodeGenerateInterface(
  637 + clone $codeSelf
  638 + );
  639 +
  640 + $class = new CodeGenerateClass(
  641 + clone $codeSelf,
  642 + $interface->toArray()['name']
  643 + );
  644 +
  645 + global $src_path;
  646 +
  647 + $baseDir = $src_path . '/Request';
  648 +
  649 + $directory = $baseDir . '/' . $class->toArray()['name'];
  650 +
  651 + if (!is_dir($directory)) {
  652 + @mkdir($directory);
  653 + }
  654 +
  655 + file_put_contents(
  656 + $directory . '/' . $interface->toArray()['file'],
  657 + $interface
  658 + );
  659 +
  660 + file_put_contents(
  661 + $directory . '/' . $class->toArray()['file'],
  662 + $class
  663 + );
  664 + }
  665 +}
  666 +
  667 +
  668 +class CodeGenerateInterface
  669 +{
  670 + protected static string $template = <<<temp
  671 +<?php
  672 +namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
  673 +
  674 +use Lackoxygen\TiktokShop\Response\ResultSet;
  675 +
  676 +/**
  677 + * @note \${ANNOTATE}
  678 + */
  679 +interface \${NAME}Interface
  680 +{
  681 +\${METHOD}
  682 +}
  683 +temp;
  684 +
  685 + protected string $content = '';
  686 +
  687 + protected CodeSelf $codeSelf;
  688 +
  689 + /**
  690 + * @param CodeSelf $codeSelf
  691 + */
  692 + public function __construct(CodeSelf $codeSelf)
  693 + {
  694 + $methods = [];
  695 +
  696 + /**
  697 + * @var CodeSubSelf $method
  698 + */
  699 + foreach ($codeSelf->methods as $method) {
  700 + $methods[] = $this->generateMethod($method);
  701 + }
  702 +
  703 + $this->content = replaces(
  704 + [
  705 + '${SECTION}' => $codeSelf->className,
  706 + '${ANNOTATE}' => $codeSelf->annotate,
  707 + '${NAME}' => $codeSelf->className,
  708 + '${METHOD}' => join(
  709 + PHP_EOL . PHP_EOL,
  710 + array_map(function ($method) {
  711 + return join(PHP_EOL, $method);
  712 + }, $methods)
  713 + )
  714 + ],
  715 + static::$template
  716 + );
  717 +
  718 + $this->codeSelf = $codeSelf;
  719 + }
  720 +
  721 + /**
  722 + * @param CodeSubSelf $subSelf
  723 + * @return array
  724 + */
  725 + protected function generateMethod(CodeSubSelf $subSelf): array
  726 + {
  727 + $template[] = "\t" . '/**';
  728 + $template[] = "\t" . ' * ' . $subSelf->annotate;
  729 + $template[] = "\t" . ' * @link ' . $subSelf->docUri;
  730 + $template[] = "\t" . ' * @param array $params';
  731 + $template[] = "\t" . ' * @return ResultSet';
  732 + $template[] = "\t" . ' */';
  733 + $template[] = "\t" . 'function ' . $subSelf->name . '(array $params = []);';
  734 +
  735 + return $template;
  736 + }
  737 +
  738 +
  739 + /**
  740 + * @return string
  741 + */
  742 + public function __toString(): string
  743 + {
  744 + return $this->content;
  745 + }
  746 +
  747 + /**
  748 + * @return array
  749 + */
  750 + public function toArray(): array
  751 + {
  752 + $name = $this->codeSelf->className . 'Interface';
  753 +
  754 + return [
  755 + 'name' => $name,
  756 + 'file' => $name . '.php',
  757 + 'content' => $this->content,
  758 + ];
  759 + }
  760 +}
  761 +
  762 +class CodeGenerateClass
  763 +{
  764 + protected static string $template = <<<temp
  765 +<?php
  766 +
  767 +namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
  768 +
  769 +use Lackoxygen\TiktokShop\Request\Request;
  770 +
  771 +class \${NAME} extends Request implements \${INTERFACE}
  772 +{
  773 +\${METHOD}
  774 +}
  775 +temp;
  776 +
  777 + protected string $content = '';
  778 +
  779 + protected CodeSelf $codeSelf;
  780 +
  781 + protected string $interface = '';
  782 +
  783 + public function __construct(CodeSelf $codeSelf, string $interface)
  784 + {
  785 + $this->codeSelf = $codeSelf;
  786 +
  787 + $this->interface = $interface;
  788 +
  789 + $methods = [];
  790 +
  791 + /**
  792 + * @var CodeSubSelf $method
  793 + */
  794 + foreach ($codeSelf->methods as $method) {
  795 + $methods[] = $this->generateMethod($method);
  796 + }
  797 +
  798 + $this->content = replaces(
  799 + [
  800 + '${SECTION}' => $codeSelf->className,
  801 + '${ANNOTATE}' => $codeSelf->annotate,
  802 + '${INTERFACE}' => $this->interface,
  803 + '${NAME}' => $codeSelf->className,
  804 + '${METHOD}' => join(
  805 + PHP_EOL . PHP_EOL,
  806 + array_map(function ($method) {
  807 + return join(PHP_EOL, $method);
  808 + }, $methods)
  809 + )
  810 + ],
  811 + static::$template
  812 + );
  813 + }
  814 +
  815 + /**
  816 + * @param CodeSubSelf $subSelf
  817 + * @return array
  818 + */
  819 + protected function generateMethod(CodeSubSelf $subSelf): array
  820 + {
  821 + $template[] = "\t" . '/**';
  822 + $template[] = "\t" . ' * @inheritDoc';
  823 + $template[] = "\t" . ' */';
  824 + $template[] = "\t" . 'function ' . $subSelf->name . '(array $params = [])';
  825 + $template[] = "\t" . '{';
  826 + $template[] = "\t\t" . '$this->builder->method(\'' . $subSelf->method . '\')';
  827 + $template[] = "\t\t\t" . '->service(\'' . $subSelf->service . '\')';
  828 + $template[] = "\t\t\t" . '->path(\'' . $subSelf->path . '\')';
  829 + $template[] = "\t\t\t" . '->params($params);';
  830 + $template[] = "\t" . '}';
  831 +
  832 + return $template;
  833 + }
  834 +
  835 + /**
  836 + * @return string
  837 + */
  838 + public function __toString(): string
  839 + {
  840 + return $this->content;
  841 + }
  842 +
  843 + /**
  844 + * @return array
  845 + */
  846 + public function toArray(): array
  847 + {
  848 + return [
  849 + 'name' => $this->codeSelf->className,
  850 + 'file' => $this->codeSelf->className . '.php',
  851 + 'content' => $this->content,
  852 + ];
  853 + }
  854 +}
  855 +
  856 +class CodeSelf
  857 +{
  858 + /**
  859 + * @var string
  860 + */
  861 + public string $className = '';
  862 +
  863 + /**
  864 + * @var string
  865 + */
  866 + public string $annotate = '';
  867 +
  868 + /**
  869 + * @var array [] $methods
  870 + */
  871 + public array $methods = [];
  872 +}
  873 +
  874 +class CodeSubSelf
  875 +{
  876 + /**
  877 + * @var string
  878 + */
  879 + public string $docUri = '';
  880 +
  881 + /**
  882 + * @var string
  883 + */
  884 + public string $name = '';
  885 +
  886 + /**
  887 + * @var string
  888 + */
  889 + public string $method = '';
  890 +
  891 + /**
  892 + * @var string
  893 + */
  894 + public string $service = '';
  895 +
  896 + /**
  897 + * @var string
  898 + */
  899 + public string $path = '';
  900 +
  901 + /**
  902 + * @var string
  903 + */
  904 + public string $annotate = '';
  905 +}
  906 +
  907 +Main::run();
@@ -3,43 +3,49 @@ @@ -3,43 +3,49 @@
3 namespace Lackoxygen\TiktokShop; 3 namespace Lackoxygen\TiktokShop;
4 4
5 use Illuminate\Support\Arr; 5 use Illuminate\Support\Arr;
6 -use Lackoxygen\TiktokShop\Attribute\Config;  
7 -use Lackoxygen\TiktokShop\Passage\Alliance\Alliance;  
8 -use Lackoxygen\TiktokShop\Passage\Authorize;  
9 -use Lackoxygen\TiktokShop\Passage\Order\OrderInterface;  
10 -use Lackoxygen\TiktokShop\Passage\PassageProxy;  
11 -use Lackoxygen\TiktokShop\Passage\Product\ProductInterface;  
12 -use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface;  
13 -use Lackoxygen\TiktokShop\Passage\Verify;  
14 -use Lackoxygen\TiktokShop\Passage\Logistics\Logistics; 6 +use Lackoxygen\TiktokShop\Attribute\Config\Config;
  7 +use Lackoxygen\TiktokShop\Attribute\Config\Option;
  8 +use Lackoxygen\TiktokShop\Request\RequestProxy;
  9 +use Lackoxygen\TiktokShop\Support\Verify;
15 10
16 /** 11 /**
17 - * @method OrderInterface order()  
18 - * @method ShopInterface shop()  
19 - * @method ProductInterface product()  
20 - * @method Authorize authorize()  
21 * @method Verify verify() 12 * @method Verify verify()
22 - * @method Alliance alliance()  
23 - * @method Logistics logistics() 13 + * @method Request\Pigeon\PigeonInterface pigeon()
  14 + * @method Request\Sms\SmsInterface sms()
  15 + * @method Request\SupplyChain\SupplyChainInterface supplyChain()
  16 + * @method Request\Topup\TopupInterface topup()
  17 + * @method Request\OpenCloud\OpenCloudInterface openCloud()
  18 + * @method Request\Btas\BtasInterface btas()
  19 + * @method Request\Recycle\RecycleInterface recycle()
  20 + * @method Request\Member\MemberInterface member()
  21 + * @method Request\Buyin\BuyinInterface buyin()
  22 + * @method Request\Yunc\YuncInterface yunc()
  23 + * @method Request\OrderCode\OrderCodeInterface orderCode()
  24 + * @method Request\Coupons\CouponsInterface coupons()
  25 + * @method Request\Crossborder\CrossborderInterface crossborder()
  26 + * @method Request\Iop\IopInterface iop()
  27 + * @method Request\Antispam\AntispamInterface antispam()
  28 + * @method Request\Token\TokenInterface token()
  29 + * @method Request\Order\OrderInterface order()
  30 + * @method Request\AfterSale\AfterSaleInterface afterSale()
  31 + * @method Request\Logistics\LogisticsInterface logistics()
  32 + * @method Request\Warehouse\WarehouseInterface warehouse()
  33 + * @method Request\Product\ProductInterface product()
  34 + * @method Request\Material\MaterialInterface material()
  35 + * @method Request\Address\AddressInterface address()
24 */ 36 */
25 -class TiktokShop 37 +class Application
26 { 38 {
27 /** 39 /**
28 - * @var Config 40 + * @var Option
29 */ 41 */
30 - protected Config $config; 42 + protected Option $config;
31 43
32 /** 44 /**
33 * @var array|string[] 45 * @var array|string[]
34 */ 46 */
35 - protected static array $passages = [  
36 - 'order' => Passage\Order\Order::class,  
37 - 'shop' => Passage\Shop\Shop::class,  
38 - 'product' => Passage\Product\Product::class,  
39 - 'authorize' => Authorize::class,  
40 - 'verify' => Verify::class,  
41 - 'alliance' => Alliance::class,  
42 - 'logistics' => Passage\Logistics\Logistics::class 47 + protected array $fixedPriority = [
  48 + 'verify' => Verify::class
43 ]; 49 ];
44 50
45 /** 51 /**
@@ -55,7 +61,7 @@ class TiktokShop @@ -55,7 +61,7 @@ class TiktokShop
55 61
56 $app = $options ?: 'default'; 62 $app = $options ?: 'default';
57 63
58 - $config = \config(TiktokShopProvider::$name . '.' . $app); 64 + $config = \config(ServiceProvider::$name . '.' . $app);
59 65
60 if (!is_array($config)) { 66 if (!is_array($config)) {
61 throw new \InvalidArgumentException('config file not found'); 67 throw new \InvalidArgumentException('config file not found');
@@ -71,11 +77,11 @@ class TiktokShop @@ -71,11 +77,11 @@ class TiktokShop
71 /** 77 /**
72 * @param array $options 78 * @param array $options
73 * 79 *
74 - * @return Config 80 + * @return Option
75 */ 81 */
76 - public static function newConfig(array $options): Config 82 + public static function newConfig(array $options): Option
77 { 83 {
78 - return new Config( 84 + return new Option(
79 Arr::get($options, 'app_key'), 85 Arr::get($options, 'app_key'),
80 Arr::get($options, 'app_secret'), 86 Arr::get($options, 'app_secret'),
81 Arr::get($options, 'base_uri'), 87 Arr::get($options, 'base_uri'),
@@ -87,9 +93,9 @@ class TiktokShop @@ -87,9 +93,9 @@ class TiktokShop
87 /** 93 /**
88 * @param $options 94 * @param $options
89 * 95 *
90 - * @return TiktokShop 96 + * @return Application
91 */ 97 */
92 - public static function use($options = null): TiktokShop 98 + public static function use($options = null): Application
93 { 99 {
94 return new static($options); 100 return new static($options);
95 } 101 }
@@ -97,9 +103,9 @@ class TiktokShop @@ -97,9 +103,9 @@ class TiktokShop
97 /** 103 /**
98 * @param string $accessToken 104 * @param string $accessToken
99 * 105 *
100 - * @return $this 106 + * @return Application
101 */ 107 */
102 - public function setAccessToken(string $accessToken): TiktokShop 108 + public function setAccessToken(string $accessToken): Application
103 { 109 {
104 $this->config->setAccessToken($accessToken); 110 $this->config->setAccessToken($accessToken);
105 111
@@ -107,21 +113,44 @@ class TiktokShop @@ -107,21 +113,44 @@ class TiktokShop
107 } 113 }
108 114
109 /** 115 /**
  116 + * @param string $name
  117 + * @return RequestProxy|object
  118 + */
  119 + private function guide(string $name)
  120 + {
  121 + if (array_key_exists($name, $this->fixedPriority)) {
  122 + return new $this->fixedPriority[$name]($this->config);
  123 + }
  124 +
  125 + $name = ucfirst($name);
  126 +
  127 + $request = '\Lackoxygen\TiktokShop\Request\\' . $name . '\\' . $name;
  128 +
  129 + if (!class_exists($request)) {
  130 + throw new \OverflowException('class file(' . $request . ') not found');
  131 + }
  132 +
  133 + return RequestProxy::proxy($request, $this->config);
  134 + }
  135 +
  136 + /**
110 * @param $name 137 * @param $name
111 * @param array $arguments 138 * @param array $arguments
112 * 139 *
113 - * @return PassageProxy 140 + * @return RequestProxy
114 */ 141 */
115 public function __call($name, array $arguments = []) 142 public function __call($name, array $arguments = [])
116 { 143 {
117 - $passage = static::$passages[$name]; 144 + $guide = $this->guide($name);
118 145
119 try { 146 try {
120 - return PassageProxy::proxy($passage, $this->config); 147 + return $guide;
121 } finally { 148 } finally {
  149 + if ($guide instanceof RequestProxy) {
122 register_shutdown_function(function () { 150 register_shutdown_function(function () {
123 $this->config->setAccessToken(''); 151 $this->config->setAccessToken('');
124 }); 152 });
125 } 153 }
126 } 154 }
  155 + }
127 } 156 }
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Attribute\Config;
  4 +
  5 +class Config
  6 +{
  7 + /**
  8 + * @var Option
  9 + */
  10 + protected Option $config;
  11 +
  12 + /**
  13 + * @param Option $option
  14 + */
  15 + public function __construct(Option $option)
  16 + {
  17 + $this->config = $option;
  18 + }
  19 +
  20 + /**
  21 + * @return Option
  22 + */
  23 + public function getConfig(): Option
  24 + {
  25 + return clone $this->config;
  26 + }
  27 +}
1 <?php 1 <?php
2 2
3 -namespace Lackoxygen\TiktokShop\Attribute; 3 +namespace Lackoxygen\TiktokShop\Attribute\Config;
4 4
5 -class Config 5 +class Option
6 { 6 {
7 - private string $appKey = ''; 7 + /**
  8 + * @var string
  9 + */
  10 + private string $appKey;
8 11
9 - private string $appSecret = ''; 12 + /**
  13 + * @var string
  14 + */
  15 + private string $appSecret;
10 16
11 - private bool $enableMock = false; 17 + /**
  18 + * @var bool
  19 + */
  20 + private bool $enableMock;
12 21
13 - private string $baseUri = ''; 22 + /**
  23 + * @var string
  24 + */
  25 + private string $baseUri;
14 26
  27 + /**
  28 + * @var string
  29 + */
15 private string $accessToken = ''; 30 private string $accessToken = '';
16 31
  32 + /**
  33 + * @var float
  34 + */
17 private float $timeout; 35 private float $timeout;
18 36
  37 + /**
  38 + * @param string $appKey
  39 + * @param string $appSecret
  40 + * @param string $baseUri
  41 + * @param float $timeout
  42 + * @param bool $enableMock
  43 + */
19 public function __construct( 44 public function __construct(
20 string $appKey = '', 45 string $appKey = '',
21 string $appSecret = '', 46 string $appSecret = '',
@@ -2,39 +2,44 @@ @@ -2,39 +2,44 @@
2 2
3 namespace Lackoxygen\TiktokShop\Attribute; 3 namespace Lackoxygen\TiktokShop\Attribute;
4 4
5 -class Request 5 +use Lackoxygen\TiktokShop\Attribute\Config\Config;
  6 +
  7 +class Request extends Config
6 { 8 {
  9 + /**
  10 + * @var string
  11 + */
7 private string $service = ''; 12 private string $service = '';
8 13
  14 + /**
  15 + * @var string
  16 + */
9 private string $timestamp = ''; 17 private string $timestamp = '';
10 18
  19 + /**
  20 + * @var string
  21 + */
11 private string $v = '2'; 22 private string $v = '2';
12 23
  24 + /**
  25 + * @var string
  26 + */
13 private string $method = 'GET'; 27 private string $method = 'GET';
14 28
  29 + /**
  30 + * @var array
  31 + */
15 private array $params = []; 32 private array $params = [];
16 33
17 - protected string $path = '';  
18 -  
19 - private bool $signature = true;  
20 -  
21 - private Config $config;  
22 -  
23 /** 34 /**
24 - * @param mixed $config 35 + * @var string
25 */ 36 */
26 - public function setConfig(Config $config): void  
27 - {  
28 - $this->config = $config;  
29 - } 37 + protected string $path = '';
30 38
31 /** 39 /**
32 - * @return mixed 40 + * @var bool
33 */ 41 */
34 - public function getConfig(): Config  
35 - {  
36 - return $this->config;  
37 - } 42 + private bool $signature = true;
38 43
39 /** 44 /**
40 * @return string 45 * @return string
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Command;  
4 -  
5 -use Lackoxygen\TiktokShop\Supervisor\Session\SessionHeart;  
6 -use Illuminate\Console\Command;  
7 -  
8 -class RefreshToken extends Command  
9 -{  
10 - /**  
11 - * The name and signature of the console command.  
12 - *  
13 - * @var string  
14 - */  
15 - protected $signature = 'tiktok-shop:refresh.token';  
16 -  
17 - /**  
18 - * The console command description.  
19 - *  
20 - * @var string  
21 - */  
22 - protected $description = 'The refresh tiktok shop token';  
23 -  
24 - /**  
25 - * Create a new command instance.  
26 - *  
27 - * @return void  
28 - */  
29 - public function __construct()  
30 - {  
31 - parent::__construct();  
32 - }  
33 -  
34 - /**  
35 - * Execute the console command.  
36 - *  
37 - * @return int  
38 - */  
39 - public function handle()  
40 - {  
41 - SessionHeart::new()->keepalive();  
42 -  
43 - return 0;  
44 - }  
45 -}  
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Contracts;  
4 -  
5 -interface SessionInterface  
6 -{  
7 - public function id(): string;  
8 -  
9 - public function unEffective(): bool;  
10 -  
11 - public function effective(): bool;  
12 -  
13 - public function discard();  
14 -  
15 - public function watch(): bool;  
16 -  
17 - public function appKey(): string;  
18 -}  
@@ -2,25 +2,40 @@ @@ -2,25 +2,40 @@
2 2
3 namespace Lackoxygen\TiktokShop\Facade; 3 namespace Lackoxygen\TiktokShop\Facade;
4 4
  5 +use Lackoxygen\TiktokShop\Request;
5 use Illuminate\Support\Facades\Facade; 6 use Illuminate\Support\Facades\Facade;
6 -use Lackoxygen\TiktokShop\Passage\Alliance\Alliance;  
7 -use Lackoxygen\TiktokShop\Passage\Authorize;  
8 -use Lackoxygen\TiktokShop\Passage\Order\OrderInterface;  
9 -use Lackoxygen\TiktokShop\Passage\Product\ProductInterface;  
10 -use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface;  
11 -use Lackoxygen\TiktokShop\Passage\Verify;  
12 -use Lackoxygen\TiktokShop\TiktokShop as TiktokShopKernel; 7 +use Lackoxygen\TiktokShop\Support\Verify;
  8 +use Lackoxygen\TiktokShop\Application;
13 9
14 /** 10 /**
15 - * @method static OrderInterface order()  
16 - * @method static ShopInterface shop()  
17 - * @method static ProductInterface product()  
18 - * @method static Authorize authorize() 11 + * @method static Application setAccessToken(string $accessToken)
  12 + * @method static Application use ($options)
19 * @method static Verify verify() 13 * @method static Verify verify()
20 - * @method static Alliance alliance()  
21 - * @method static TiktokShopKernel setAccessToken(string $accessToken)  
22 - * @method static TiktokShopKernel use ($options) 14 + * @method static Request\Pigeon\PigeonInterface pigeon()
  15 + * @method static Request\Sms\SmsInterface sms()
  16 + * @method static Request\SupplyChain\SupplyChainInterface supplyChain()
  17 + * @method static Request\Topup\TopupInterface topup()
  18 + * @method static Request\OpenCloud\OpenCloudInterface openCloud()
  19 + * @method static Request\Btas\BtasInterface btas()
  20 + * @method static Request\Recycle\RecycleInterface recycle()
  21 + * @method static Request\Member\MemberInterface member()
  22 + * @method static Request\Buyin\BuyinInterface buyin()
  23 + * @method static Request\Yunc\YuncInterface yunc()
  24 + * @method static Request\OrderCode\OrderCodeInterface orderCode()
  25 + * @method static Request\Coupons\CouponsInterface coupons()
  26 + * @method static Request\Crossborder\CrossborderInterface crossborder()
  27 + * @method static Request\Iop\IopInterface iop()
  28 + * @method static Request\Antispam\AntispamInterface antispam()
  29 + * @method static Request\Token\TokenInterface token()
  30 + * @method static Request\Order\OrderInterface order()
  31 + * @method static Request\AfterSale\AfterSaleInterface afterSale()
  32 + * @method static Request\Logistics\LogisticsInterface logistics()
  33 + * @method static Request\Warehouse\WarehouseInterface warehouse()
  34 + * @method static Request\Product\ProductInterface product()
  35 + * @method static Request\Material\MaterialInterface material()
  36 + * @method static Request\Address\AddressInterface address()
23 */ 37 */
  38 +
24 class TiktokShop extends Facade 39 class TiktokShop extends Facade
25 { 40 {
26 /** 41 /**
@@ -28,6 +43,6 @@ class TiktokShop extends Facade @@ -28,6 +43,6 @@ class TiktokShop extends Facade
28 */ 43 */
29 protected static function getFacadeAccessor(): string 44 protected static function getFacadeAccessor(): string
30 { 45 {
31 - return TiktokShopKernel::class; 46 + return Application::class;
32 } 47 }
33 } 48 }
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Passage\Alliance;  
4 -  
5 -use Lackoxygen\TiktokShop\Passage\Passage;  
6 -  
7 -class Alliance extends Passage implements AllianceInterface  
8 -{  
9 - /**  
10 - * @inheritDoc  
11 - */  
12 - public function simplePlan(array $params)  
13 - {  
14 - $this->builder  
15 - ->method('POST')  
16 - ->params($params)  
17 - ->path('buyin/simplePlan')  
18 - ->service('buyin.simplePlan');  
19 - }  
20 -  
21 - /**  
22 - * @inheritDoc  
23 - */  
24 - public function exclusivePlan(array $params)  
25 - {  
26 - $this->builder  
27 - ->method('POST')  
28 - ->params($params)  
29 - ->path('buyin/exclusivePlan')  
30 - ->service('buyin.exclusivePlan');  
31 - }  
32 -  
33 - /**  
34 - * @inheritDoc  
35 - */  
36 - public function activitySearch(array $params)  
37 - {  
38 - $this->builder  
39 - ->method('POST')  
40 - ->params($params)  
41 - ->path('buyin/activitySearch')  
42 - ->service('buyin.activitySearch');  
43 - }  
44 -  
45 - /**  
46 - * @inheritDoc  
47 - */  
48 - public function applyActivities(array $params)  
49 - {  
50 - $this->builder  
51 - ->method('POST')  
52 - ->params($params)  
53 - ->path('buyin/applyActivities')  
54 - ->service('buyin.applyActivities');  
55 - }  
56 -  
57 - /**  
58 - * @inheritDoc  
59 - */  
60 - public function createOrUpdateOrienPlan(array $params)  
61 - {  
62 - $this->builder  
63 - ->method('POST')  
64 - ->params($params)  
65 - ->path('buyin/createOrUpdateOrienPlan')  
66 - ->service('buyin.createOrUpdateOrienPlan');  
67 - }  
68 -  
69 - /**  
70 - * @inheritDoc  
71 - */  
72 - public function orienPlanList(array $params)  
73 - {  
74 - $this->builder  
75 - ->method('POST')  
76 - ->params($params)  
77 - ->path('buyin/orienPlanList')  
78 - ->service('buyin.orienPlanList');  
79 - }  
80 -  
81 - /**  
82 - * @inheritDoc  
83 - */  
84 - public function orienPlanAuthors(array $params)  
85 - {  
86 - $this->builder  
87 - ->method('POST')  
88 - ->params($params)  
89 - ->path('buyin/orienPlanAuthors')  
90 - ->service('buyin.orienPlanAuthors');  
91 - }  
92 -  
93 - /**  
94 - * @inheritDoc  
95 - */  
96 - public function orienPlanCtrl(array $params)  
97 - {  
98 - $this->builder  
99 - ->method('POST')  
100 - ->params($params)  
101 - ->path('buyin/orienPlanCtrl')  
102 - ->service('buyin.orienPlanCtrl');  
103 - }  
104 -  
105 - /**  
106 - * @inheritDoc  
107 - */  
108 - public function orienPlanAuthorsAdd(array $params)  
109 - {  
110 - $this->builder  
111 - ->method('POST')  
112 - ->params($params)  
113 - ->path('buyin/orienPlanAuthorsAdd')  
114 - ->service('buyin.orienPlanAuthorsAdd');  
115 - }  
116 -  
117 - /**  
118 - * @inheritDoc  
119 - */  
120 - public function orienPlanAudit(array $params)  
121 - {  
122 - $this->builder  
123 - ->method('POST')  
124 - ->params($params)  
125 - ->path('buyin/orienPlanAudit')  
126 - ->service('buyin.orienPlanAudit');  
127 - }  
128 -  
129 - /**  
130 - * @inheritDoc  
131 - */  
132 - public function colonelActivityCreateOrUpdate(array $params)  
133 - {  
134 - $this->builder  
135 - ->method('POST')  
136 - ->params($params)  
137 - ->path('alliance/colonelActivityCreateOrUpdate')  
138 - ->service('alliance.colonelActivityCreateOrUpdate');  
139 - }  
140 -  
141 - /**  
142 - * @inheritDoc  
143 - */  
144 - public function activityProductCategoryList(array $params)  
145 - {  
146 - $this->builder  
147 - ->method('POST')  
148 - ->params($params)  
149 - ->path('alliance/activityProductCategoryList')  
150 - ->service('alliance.activityProductCategoryList');  
151 - }  
152 -  
153 - /**  
154 - * @inheritDoc  
155 - */  
156 - public function instituteColonelActivityList(array $params)  
157 - {  
158 - $this->builder  
159 - ->method('POST')  
160 - ->params($params)  
161 - ->path('alliance/instituteColonelActivityList')  
162 - ->service('alliance.instituteColonelActivityList');  
163 - }  
164 -  
165 - /**  
166 - * @inheritDoc  
167 - */  
168 - public function instituteColonelActivityOperate(array $params)  
169 - {  
170 - $this->builder  
171 - ->method('POST')  
172 - ->params($params)  
173 - ->path('alliance/instituteColonelActivityOperate')  
174 - ->service('alliance.instituteColonelActivityOperate');  
175 - }  
176 -  
177 - /**  
178 - * @inheritDoc  
179 - */  
180 - public function colonelActivityProduct(array $params)  
181 - {  
182 - $this->builder  
183 - ->method('POST')  
184 - ->params($params)  
185 - ->path('alliance/colonelActivityProduct')  
186 - ->service('alliance.colonelActivityProduct');  
187 - }  
188 -  
189 - /**  
190 - * @inheritDoc  
191 - */  
192 - public function colonelActivityProductAudit(array $params)  
193 - {  
194 - $this->builder  
195 - ->method('POST')  
196 - ->params($params)  
197 - ->path('alliance/colonelActivityProductAudit')  
198 - ->service('alliance.colonelActivityProductAudit');  
199 - }  
200 -  
201 - /**  
202 - * @inheritDoc  
203 - */  
204 - public function colonelActivityProductExtension(array $params)  
205 - {  
206 - $this->builder  
207 - ->method('POST')  
208 - ->params($params)  
209 - ->path('alliance/colonelActivityProductExtension')  
210 - ->service('alliance.colonelActivityProductExtension');  
211 - }  
212 -  
213 - /**  
214 - * @inheritDoc  
215 - */  
216 - public function specialApplyList(array $params)  
217 - {  
218 - $this->builder  
219 - ->method('POST')  
220 - ->params($params)  
221 - ->path('buyin.colonel/specialApplyList')  
222 - ->service('buyin.colonel.specialApplyList');  
223 - }  
224 -  
225 - /**  
226 - * @inheritDoc  
227 - */  
228 - public function specialApplyDeal(array $params)  
229 - {  
230 - $this->builder  
231 - ->method('POST')  
232 - ->params($params)  
233 - ->path('buyin.colonel/specialApplyDeal')  
234 - ->service('buyin.colonel.specialApplyDeal');  
235 - }  
236 -  
237 - /**  
238 - * @inheritDoc  
239 - */  
240 - public function materialsProductsSearch(array $params)  
241 - {  
242 - $this->builder  
243 - ->method('POST')  
244 - ->params($params)  
245 - ->path('alliance/materialsProductsSearch')  
246 - ->service('alliance.materialsProductsSearch');  
247 - }  
248 -  
249 - /**  
250 - * @inheritDoc  
251 - */  
252 - public function materialsProductsDetails(array $params)  
253 - {  
254 - $this->builder  
255 - ->method('POST')  
256 - ->params($params)  
257 - ->path('alliance/materialsProductsDetails')  
258 - ->service('alliance.materialsProductsDetails');  
259 - }  
260 -  
261 - /**  
262 - * @inheritDoc  
263 - */  
264 - public function materialsProductCategory(array $params)  
265 - {  
266 - $this->builder  
267 - ->method('POST')  
268 - ->params($params)  
269 - ->path('alliance/materialsProductCategory')  
270 - ->service('alliance.materialsProductCategory');  
271 - }  
272 -  
273 - /**  
274 - * @inheritDoc  
275 - */  
276 - public function materialsProductStatus(array $params)  
277 - {  
278 - $this->builder  
279 - ->method('POST')  
280 - ->params($params)  
281 - ->path('buyin/materialsProductStatus')  
282 - ->service('buyin.materialsProductStatus');  
283 - }  
284 -  
285 - /**  
286 - * @inheritDoc  
287 - */  
288 - public function queryInstituteOrders(array $params)  
289 - {  
290 - $this->builder  
291 - ->method('POST')  
292 - ->params($params)  
293 - ->path('buyin/queryInstituteOrders')  
294 - ->service('buyin.queryInstituteOrders');  
295 - }  
296 -  
297 - /**  
298 - * @inheritDoc  
299 - */  
300 - public function kolPidCreate(array $params)  
301 - {  
302 - $this->builder  
303 - ->method('POST')  
304 - ->params($params)  
305 - ->path('buyin/kolPidCreate')  
306 - ->service('buyin.kolPidCreate');  
307 - }  
308 -  
309 - /**  
310 - * @inheritDoc  
311 - */  
312 - public function kolPidList(array $params)  
313 - {  
314 - $this->builder  
315 - ->method('POST')  
316 - ->params($params)  
317 - ->path('buyin/kolPidList')  
318 - ->service('buyin.kolPidList');  
319 - }  
320 -  
321 - /**  
322 - * @inheritDoc  
323 - */  
324 - public function kolPidEdit(array $params)  
325 - {  
326 - $this->builder  
327 - ->method('POST')  
328 - ->params($params)  
329 - ->path('buyin/kolPidEdit')  
330 - ->service('buyin.kolPidEdit');  
331 - }  
332 -  
333 - /**  
334 - * @inheritDoc  
335 - */  
336 - public function kolPidDel(array $params)  
337 - {  
338 - $this->builder  
339 - ->method('POST')  
340 - ->params($params)  
341 - ->path('buyin/kolPidDel')  
342 - ->service('buyin.kolPidDel');  
343 - }  
344 -  
345 - /**  
346 - * @inheritDoc  
347 - */  
348 - public function kolProductShare(array $params)  
349 - {  
350 - $this->builder  
351 - ->method('POST')  
352 - ->params($params)  
353 - ->path('buyin/kolProductShare')  
354 - ->service('buyin.kolProductShare');  
355 - }  
356 -  
357 - /**  
358 - * @inheritDoc  
359 - */  
360 - public function institutePidCreate(array $params)  
361 - {  
362 - $this->builder  
363 - ->method('POST')  
364 - ->params($params)  
365 - ->path('buyin/institutePidCreate')  
366 - ->service('buyin.institutePidCreate');  
367 - }  
368 -  
369 - /**  
370 - * @inheritDoc  
371 - */  
372 - public function institutePidList(array $params)  
373 - {  
374 - $this->builder  
375 - ->method('POST')  
376 - ->params($params)  
377 - ->path('buyin/institutePidList')  
378 - ->service('buyin.institutePidList');  
379 - }  
380 -  
381 - /**  
382 - * @inheritDoc  
383 - */  
384 - public function institutePidEdit(array $params)  
385 - {  
386 - $this->builder  
387 - ->method('POST')  
388 - ->params($params)  
389 - ->path('buyin/institutePidEdit')  
390 - ->service('buyin.institutePidEdit');  
391 - }  
392 -  
393 - /**  
394 - * @inheritDoc  
395 - */  
396 - public function institutePidDel(array $params)  
397 - {  
398 - $this->builder  
399 - ->method('POST')  
400 - ->params($params)  
401 - ->path('buyin/institutePidDel')  
402 - ->service('buyin.institutePidDel');  
403 - }  
404 -  
405 - /**  
406 - * @inheritDoc  
407 - */  
408 - public function liveShareMaterial(array $params)  
409 - {  
410 - $this->builder  
411 - ->method('POST')  
412 - ->params($params)  
413 - ->path('buyin/liveShareMaterial')  
414 - ->service('buyin.liveShareMaterial');  
415 - }  
416 -  
417 - /**  
418 - * @inheritDoc  
419 - */  
420 - public function instituteLiveShare(array $params)  
421 - {  
422 - $this->builder  
423 - ->method('POST')  
424 - ->params($params)  
425 - ->path('buyin/instituteLiveShare')  
426 - ->service('buyin.instituteLiveShare');  
427 - }  
428 -  
429 - /**  
430 - * @inheritDoc  
431 - */  
432 - public function instituteOrderAds(array $params)  
433 - {  
434 - $this->builder  
435 - ->method('POST')  
436 - ->params($params)  
437 - ->path('buyin/instituteOrderAds')  
438 - ->service('buyin.instituteOrderAds');  
439 - }  
440 -  
441 - /**  
442 - * @inheritDoc  
443 - */  
444 - public function kolOrderAds(array $params)  
445 - {  
446 - $this->builder  
447 - ->method('POST')  
448 - ->params($params)  
449 - ->path('buyin/kolOrderAds')  
450 - ->service('buyin.kolOrderAds');  
451 - }  
452 -  
453 - /**  
454 - * @inheritDoc  
455 - */  
456 - public function shopPidMemberCreate(array $params)  
457 - {  
458 - $this->builder  
459 - ->method('POST')  
460 - ->params($params)  
461 - ->path('buyin/shopPidMemberCreate')  
462 - ->service('buyin.shopPidMemberCreate');  
463 - }  
464 -  
465 - /**  
466 - * @inheritDoc  
467 - */  
468 - public function kolMaterialsProductsDetails(array $params)  
469 - {  
470 - $this->builder  
471 - ->method('POST')  
472 - ->params($params)  
473 - ->path('buyin/kolMaterialsProductsDetails')  
474 - ->service('buyin.kolMaterialsProductsDetails');  
475 - }  
476 -  
477 - /**  
478 - * @inheritDoc  
479 - */  
480 - public function getProductShareMaterial(array $params)  
481 - {  
482 - $this->builder  
483 - ->method('POST')  
484 - ->params($params)  
485 - ->path('buyin/getProductShareMaterial')  
486 - ->service('buyin.getProductShareMaterial');  
487 - }  
488 -  
489 - /**  
490 - * @inheritDoc  
491 - */  
492 - public function getProductSkus(array $params)  
493 - {  
494 - $this->builder  
495 - ->method('POST')  
496 - ->params($params)  
497 - ->path('buyin/productSkus')  
498 - ->service('buyin.productSkus');  
499 - }  
500 -  
501 - /**  
502 - * @inheritDoc  
503 - */  
504 - public function shareCommandParse(array $params)  
505 - {  
506 - $this->builder  
507 - ->method('POST')  
508 - ->params($params)  
509 - ->path('buyin/shareCommandParse')  
510 - ->service('buyin.shareCommandParse');  
511 - }  
512 -  
513 - /**  
514 - * @inheritDoc  
515 - */  
516 - public function activityShareConvert(array $params)  
517 - {  
518 - $this->builder  
519 - ->method('POST')  
520 - ->params($params)  
521 - ->path('buyin/activityShareConvert')  
522 - ->service('buyin.activityShareConvert');  
523 - }  
524 -}  
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Passage;  
4 -  
5 -use Illuminate\Support\Arr;  
6 -  
7 -class Authorize extends Passage  
8 -{  
9 - /**  
10 - * @param string $code  
11 - * @param string $grantType {authorization_self, authorization_code}  
12 - * @param bool $sandbox  
13 - * @return ResultSet  
14 - */  
15 - public function token(string $code, string $grantType = 'authorization_code', bool $sandbox = false)  
16 - {  
17 - $params = ['code' => $code, 'grant_type' => $grantType];  
18 - if ($sandbox) {  
19 - if ($grantType === 'authorization_self') {  
20 - if ($code == '4463798') {  
21 - Arr::set($params, 'test_shop', 1);  
22 - } else {  
23 - Arr::set($params, 'shop_id', $code);  
24 - }  
25 - }  
26 - }  
27 - $this->builder->service('token.create');  
28 - $this->builder  
29 - ->method('GET')  
30 - ->path('/token/create')  
31 - ->service('token.create')  
32 - ->params($params);  
33 - }  
34 -  
35 - /**  
36 - * @param string $refreshToken  
37 - * @param string $grantType  
38 - * @return ResultSet  
39 - */  
40 - public function refresh(string $refreshToken, string $grantType = 'refresh_token')  
41 - {  
42 - $this->builder  
43 - ->method('POST')  
44 - ->service('token.refresh')  
45 - ->params(['refresh_token' => $refreshToken, 'grant_type' => $grantType]);  
46 - }  
47 -}  
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Passage\Logistics;  
4 -  
5 -use Lackoxygen\TiktokShop\Passage\ResultSet;  
6 -  
7 -interface LogisticsInterface  
8 -{  
9 - /**  
10 - * @link https://op.jinritemai.com/docs/api-docs/16/1075  
11 - * @return mixed  
12 - */  
13 - public function appendSubOrder(array $params);  
14 -  
15 - /**  
16 - * @link https://op.jinritemai.com/docs/api-docs/16/541  
17 - * @return mixed  
18 - */  
19 - public function logisticsCompanyList(array $params);  
20 -  
21 - /**  
22 - * @link https://op.jinritemai.com/docs/api-docs/16/718  
23 - * @return mixed  
24 - */  
25 - public function add(array $params);  
26 -  
27 - /**  
28 - * @link https://op.jinritemai.com/docs/api-docs/16/390  
29 - * @return mixed  
30 - */  
31 - public function edit(array $params);  
32 -  
33 - /**  
34 - * @link https://op.jinritemai.com/docs/api-docs/16/539  
35 - * @return mixed  
36 - */  
37 - public function logisticsEditByPack(array $params);  
38 -  
39 - /**  
40 - * @link https://op.jinritemai.com/docs/api-docs/16/562  
41 - * @return mixed  
42 - */  
43 - public function logisticsAddMultiPack(array $params);  
44 -  
45 - /**  
46 - * @link https://op.jinritemai.com/docs/api-docs/16/565  
47 - * @return mixed  
48 - */  
49 - public function freightTemplateList(array $params);  
50 -  
51 - /**  
52 - * @link https://op.jinritemai.com/docs/api-docs/16/563  
53 - * @return mixed  
54 - */  
55 - public function logisticsAddSinglePack(array $params);  
56 -  
57 - /**  
58 - * @link https://op.jinritemai.com/docs/api-docs/16/494  
59 - * @return mixed  
60 - */  
61 - public function updateOrder(array $params);  
62 -  
63 - /**  
64 - * @link https://op.jinritemai.com/docs/api-docs/16/397  
65 - * @return mixed  
66 - */  
67 - public function cancelOrder(array $params);  
68 -  
69 - /**  
70 - * @link https://op.jinritemai.com/docs/api-docs/16/526  
71 - * @return mixed  
72 - */  
73 - public function orderOperate(array $params);  
74 -  
75 - /**  
76 - * @link https://op.jinritemai.com/docs/api-docs/16/527  
77 - * @return mixed  
78 - */  
79 - public function orderCustomClearance(array $params);  
80 -  
81 - /**  
82 - * @link https://op.jinritemai.com/docs/api-docs/16/528  
83 - * @return mixed  
84 - */  
85 - public function orderLogisticsTrace(array $params);  
86 -  
87 - /**  
88 - * @link https://op.jinritemai.com/docs/api-docs/16/549  
89 - * @return mixed  
90 - */  
91 - public function customTemplateList(array $params);  
92 -  
93 - /**  
94 - * @link https://op.jinritemai.com/docs/api-docs/16/582  
95 - * @return mixed  
96 - */  
97 - public function getOutRange(array $params);  
98 -  
99 - /**  
100 - * @link https://op.jinritemai.com/docs/api-docs/16/476  
101 - * @return mixed  
102 - */  
103 - public function templateList(array $params);  
104 -  
105 - /**  
106 - * @link https://op.jinritemai.com/docs/api-docs/16/490  
107 - * @return mixed  
108 - */  
109 - public function waybillApply(array $params);  
110 -  
111 - /**  
112 - * @link https://op.jinritemai.com/docs/api-docs/16/1578  
113 - * @return mixed  
114 - */  
115 - public function deliveryNotice(array $params);  
116 -  
117 - /**  
118 - * @link https://op.jinritemai.com/docs/api-docs/16/1558  
119 - * @return mixed  
120 - */  
121 - public function isByteDancePackage(array $params);  
122 -}  
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Passage;  
4 -  
5 -use Lackoxygen\TiktokShop\Attribute\Config;  
6 -use Lackoxygen\TiktokShop\Exception\ClientException;  
7 -  
8 -class PassageProxy  
9 -{  
10 - protected string $passage;  
11 -  
12 - protected Config $config;  
13 -  
14 - protected function __construct(string $passage, Config $config)  
15 - {  
16 - $this->passage = $passage;  
17 -  
18 - $this->config = $config;  
19 - }  
20 -  
21 - public static function proxy(string $passage, Config $config): PassageProxy  
22 - {  
23 - return new self($passage, $config);  
24 - }  
25 -  
26 - /**  
27 - * @throws ClientException  
28 - */  
29 - public function __call($name, $arguments): ResultSet  
30 - {  
31 - /**  
32 - * @var Passage $passage  
33 - */  
34 - $passage = new $this->passage($this->config, $name);  
35 -  
36 - $result = call_user_func_array([$passage, $name], $arguments);  
37 -  
38 - if (!is_null($result)) {  
39 - return new ResultSet($result);  
40 - }  
41 -  
42 - return new ResultSet($passage());  
43 - }  
44 -}  
1 -<?php  
2 -  
3 -namespace Lackoxygen\TiktokShop\Passage\Shop;  
4 -  
5 -use Lackoxygen\TiktokShop\Passage\Passage;  
6 -  
7 -class Shop extends Passage implements ShopInterface  
8 -{  
9 - /**  
10 - * @inheritDoc  
11 - */  
12 - public function brandList(array $params)  
13 - {  
14 - $this->builder  
15 - ->method('POST')  
16 - ->params($params)  
17 - ->service('shop.brandList');  
18 - }  
19 -  
20 - /**  
21 - * @inheritDoc  
22 - */  
23 - public function searchMemberList(array $params)  
24 - {  
25 - $this->builder  
26 - ->method('POST')  
27 - ->params($params)  
28 - ->service('member.searchList');  
29 - }  
30 -  
31 - /**  
32 - * @inheritDoc  
33 - */  
34 - public function userLogin(array $params)  
35 - {  
36 - $this->builder  
37 - ->method('POST')  
38 - ->params($params)  
39 - ->service('antispam.userLogin');  
40 - }  
41 -  
42 - /**  
43 - * @inheritDoc  
44 - */  
45 - public function getShopCategory(array $params)  
46 - {  
47 - $this->builder  
48 - ->method('POST')  
49 - ->params($params)  
50 - ->service('shop.getShopCategory');  
51 - }  
52 -  
53 - /**  
54 - * @inheritDoc  
55 - */  
56 - public function addressUpdate(array $params)  
57 - {  
58 - $this->builder  
59 - ->method('POST')  
60 - ->params($params)  
61 - ->service('address.update');  
62 - }  
63 -  
64 - /**  
65 - * @inheritDoc  
66 - */  
67 - public function addressCreate(array $params)  
68 - {  
69 - $this->builder  
70 - ->method('POST')  
71 - ->params($params)  
72 - ->service('address.create');  
73 - }  
74 -  
75 - /**  
76 - * @inheritDoc  
77 - */  
78 - public function getShopShortLink(array $params)  
79 - {  
80 - $this->builder  
81 - ->method('POST')  
82 - ->params($params)  
83 - ->service('member.getShopShortLink');  
84 - }  
85 -  
86 - /**  
87 - * @inheritDoc  
88 - */  
89 - public function addressList(array $params)  
90 - {  
91 - $this->builder  
92 - ->method('POST')  
93 - ->params($params)  
94 - ->service('address.list');  
95 - }  
96 -}  
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Address;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Address extends Request implements AddressInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function qualificationSettle(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('qualification.settle')
  16 + ->path('/qualification/settle')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function addressUpdate(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('address.update')
  27 + ->path('/address/update')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function addressCreate(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('address.create')
  38 + ->path('/address/create')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function memberGetShopShortLink(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('member.getShopShortLink')
  49 + ->path('/member/getShopShortLink')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function addressList(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('address.list')
  60 + ->path('/address/list')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function shopGetShopCategory(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('shop.getShopCategory')
  71 + ->path('/shop/getShopCategory')
  72 + ->params($params);
  73 + }
  74 +
  75 + /**
  76 + * @inheritDoc
  77 + */
  78 + public function shopBrandList(array $params = [])
  79 + {
  80 + $this->builder->method('POST')
  81 + ->service('shop.brandList')
  82 + ->path('/shop/brandList')
  83 + ->params($params);
  84 + }
  85 +}
1 <?php 1 <?php
2 2
3 -namespace Lackoxygen\TiktokShop\Passage\Shop; 3 +namespace Lackoxygen\TiktokShop\Request\Address;
4 4
5 -use Lackoxygen\TiktokShop\Passage\ResultSet; 5 +use Lackoxygen\TiktokShop\Response\ResultSet;
6 6
7 -interface ShopInterface  
8 -{  
9 - /**  
10 - * @link https://op.jinritemai.com/docs/api-docs/13/54  
11 - * @param array $params  
12 - * @return ResultSet 7 +/**
  8 + * @note 店铺API
13 */ 9 */
14 - public function brandList(array $params);  
15 - 10 +interface AddressInterface
  11 +{
16 /** 12 /**
17 - * @link https://op.jinritemai.com/docs/api-docs/13/366 13 + * 商家入驻提交资料
  14 + * @link https://op.jinritemai.com/docs/api-docs/13/658
18 * @param array $params 15 * @param array $params
19 * @return ResultSet 16 * @return ResultSet
20 */ 17 */
21 - public function searchMemberList(array $params); 18 + public function qualificationSettle(array $params = []);
22 19
23 /** 20 /**
24 - * @link https://op.jinritemai.com/docs/api-docs/13/635 21 + * 店铺修改售后地址接口
  22 + * @link https://op.jinritemai.com/docs/api-docs/13/1511
25 * @param array $params 23 * @param array $params
26 * @return ResultSet 24 * @return ResultSet
27 */ 25 */
28 - public function userLogin(array $params); 26 + public function addressUpdate(array $params = []);
29 27
30 /** 28 /**
31 - * @link https://op.jinritemai.com/docs/api-docs/13/821 29 + * 创建店铺地址库
  30 + * @link https://op.jinritemai.com/docs/api-docs/13/1510
32 * @param array $params 31 * @param array $params
33 * @return ResultSet 32 * @return ResultSet
34 */ 33 */
35 - public function getShopCategory(array $params); 34 + public function addressCreate(array $params = []);
36 35
37 /** 36 /**
38 - * @link https://op.jinritemai.com/docs/api-docs/13/1511 37 + * 获取商家推广链接接口
  38 + * @link https://op.jinritemai.com/docs/api-docs/13/1455
39 * @param array $params 39 * @param array $params
40 * @return ResultSet 40 * @return ResultSet
41 */ 41 */
42 - public function addressUpdate(array $params); 42 + public function memberGetShopShortLink(array $params = []);
43 43
44 /** 44 /**
45 - * @link https://op.jinritemai.com/docs/api-docs/13/1510 45 + * 售后地址列表接口
  46 + * @link https://op.jinritemai.com/docs/api-docs/13/1435
46 * @param array $params 47 * @param array $params
47 * @return ResultSet 48 * @return ResultSet
48 */ 49 */
49 - public function addressCreate(array $params); 50 + public function addressList(array $params = []);
50 51
51 /** 52 /**
52 - * @link https://op.jinritemai.com/docs/api-docs/13/1455 53 + * 获取店铺后台供商家发布商品的类目
  54 + * @link https://op.jinritemai.com/docs/api-docs/13/1820
53 * @param array $params 55 * @param array $params
54 * @return ResultSet 56 * @return ResultSet
55 */ 57 */
56 - public function getShopShortLink(array $params); 58 + public function shopGetShopCategory(array $params = []);
57 59
58 /** 60 /**
59 - * @link https://op.jinritemai.com/docs/api-docs/13/1435 61 + * 获取店铺的已授权品牌列表
  62 + * @link https://op.jinritemai.com/docs/api-docs/13/1821
60 * @param array $params 63 * @param array $params
61 * @return ResultSet 64 * @return ResultSet
62 */ 65 */
63 - public function addressList(array $params); 66 + public function shopBrandList(array $params = []);
64 } 67 }
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\AfterSale;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class AfterSale extends Request implements AfterSaleInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function afterSaleOperate(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('afterSale.operate')
  16 + ->path('/afterSale/operate')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function afterSaleDetail(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('afterSale.Detail')
  27 + ->path('/afterSale/Detail')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function afterSaleList(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('afterSale.List')
  38 + ->path('/afterSale/List')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function afterSaleAddOrderRemark(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('afterSale.addOrderRemark')
  49 + ->path('/afterSale/addOrderRemark')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function afterSaleOpenAfterSaleChannel(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('afterSale.OpenAfterSaleChannel')
  60 + ->path('/afterSale/OpenAfterSaleChannel')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function afterSaleBuyerExchangeConfirm(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('afterSale.buyerExchangeConfirm')
  71 + ->path('/afterSale/buyerExchangeConfirm')
  72 + ->params($params);
  73 + }
  74 +
  75 + /**
  76 + * @inheritDoc
  77 + */
  78 + public function afterSaleApplyLogisticsIntercept(array $params = [])
  79 + {
  80 + $this->builder->method('POST')
  81 + ->service('afterSale.applyLogisticsIntercept')
  82 + ->path('/afterSale/applyLogisticsIntercept')
  83 + ->params($params);
  84 + }
  85 +
  86 + /**
  87 + * @inheritDoc
  88 + */
  89 + public function afterSaleCancelSendGoodsSuccess(array $params = [])
  90 + {
  91 + $this->builder->method('POST')
  92 + ->service('afterSale.CancelSendGoodsSuccess')
  93 + ->path('/afterSale/CancelSendGoodsSuccess')
  94 + ->params($params);
  95 + }
  96 +
  97 + /**
  98 + * @inheritDoc
  99 + */
  100 + public function afterSaleReturnGoodsToWareHouseSuccess(array $params = [])
  101 + {
  102 + $this->builder->method('POST')
  103 + ->service('afterSale.returnGoodsToWareHouseSuccess')
  104 + ->path('/afterSale/returnGoodsToWareHouseSuccess')
  105 + ->params($params);
  106 + }
  107 +
  108 + /**
  109 + * @inheritDoc
  110 + */
  111 + public function tradeRefundListSearch(array $params = [])
  112 + {
  113 + $this->builder->method('POST')
  114 + ->service('trade.refundListSearch')
  115 + ->path('/trade/refundListSearch')
  116 + ->params($params);
  117 + }
  118 +
  119 + /**
  120 + * @inheritDoc
  121 + */
  122 + public function afterSaleTimeExtend(array $params = [])
  123 + {
  124 + $this->builder->method('POST')
  125 + ->service('afterSale.timeExtend')
  126 + ->path('/afterSale/timeExtend')
  127 + ->params($params);
  128 + }
  129 +
  130 + /**
  131 + * @inheritDoc
  132 + */
  133 + public function afterSaleBuyerExchange(array $params = [])
  134 + {
  135 + $this->builder->method('POST')
  136 + ->service('afterSale.buyerExchange')
  137 + ->path('/afterSale/buyerExchange')
  138 + ->params($params);
  139 + }
  140 +
  141 + /**
  142 + * @inheritDoc
  143 + */
  144 + public function afterSaleRejectReasonCodeList(array $params = [])
  145 + {
  146 + $this->builder->method('POST')
  147 + ->service('afterSale.rejectReasonCodeList')
  148 + ->path('/afterSale/rejectReasonCodeList')
  149 + ->params($params);
  150 + }
  151 +
  152 + /**
  153 + * @inheritDoc
  154 + */
  155 + public function afterSaleFillLogistics(array $params = [])
  156 + {
  157 + $this->builder->method('POST')
  158 + ->service('afterSale.fillLogistics')
  159 + ->path('/afterSale/fillLogistics')
  160 + ->params($params);
  161 + }
  162 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\AfterSale;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 售后退款API
  9 + */
  10 +interface AfterSaleInterface
  11 +{
  12 + /**
  13 + * 售后审核接口聚合版
  14 + * @link https://op.jinritemai.com/docs/api-docs/17/560
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function afterSaleOperate(array $params = []);
  19 +
  20 + /**
  21 + * 提供给商家获取售后单详情信息
  22 + * @link https://op.jinritemai.com/docs/api-docs/17/1095
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function afterSaleDetail(array $params = []);
  27 +
  28 + /**
  29 + * 售后列表接口
  30 + * @link https://op.jinritemai.com/docs/api-docs/17/1295
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function afterSaleList(array $params = []);
  35 +
  36 + /**
  37 + * 店家给售后单添加备注
  38 + * @link https://op.jinritemai.com/docs/api-docs/17/585
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function afterSaleAddOrderRemark(array $params = []);
  43 +
  44 + /**
  45 + * 打开售后通道,使用户可以发起超级售后
  46 + * @link https://op.jinritemai.com/docs/api-docs/17/764
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function afterSaleOpenAfterSaleChannel(array $params = []);
  51 +
  52 + /**
  53 + * 商家确认是否收到换货
  54 + * @link https://op.jinritemai.com/docs/api-docs/17/768
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function afterSaleBuyerExchangeConfirm(array $params = []);
  59 +
  60 + /**
  61 + * 申请物流拦截
  62 + * @link https://op.jinritemai.com/docs/api-docs/17/897
  63 + * @param array $params
  64 + * @return ResultSet
  65 + */
  66 + public function afterSaleApplyLogisticsIntercept(array $params = []);
  67 +
  68 + /**
  69 + * 商家在未发货仅退款途中发送取消发货的状态
  70 + * @link https://op.jinritemai.com/docs/api-docs/17/816
  71 + * @param array $params
  72 + * @return ResultSet
  73 + */
  74 + public function afterSaleCancelSendGoodsSuccess(array $params = []);
  75 +
  76 + /**
  77 + * 商家确认售后单对应的用户退货入仓成功
  78 + * @link https://op.jinritemai.com/docs/api-docs/17/815
  79 + * @param array $params
  80 + * @return ResultSet
  81 + */
  82 + public function afterSaleReturnGoodsToWareHouseSuccess(array $params = []);
  83 +
  84 + /**
  85 + * 售后单列表查询推荐使用/afterSale/List
  86 + * @link https://op.jinritemai.com/docs/api-docs/17/254
  87 + * @param array $params
  88 + * @return ResultSet
  89 + */
  90 + public function tradeRefundListSearch(array $params = []);
  91 +
  92 + /**
  93 + * 商家延时收获接口
  94 + * @link https://op.jinritemai.com/docs/api-docs/17/770
  95 + * @param array $params
  96 + * @return ResultSet
  97 + */
  98 + public function afterSaleTimeExtend(array $params = []);
  99 +
  100 + /**
  101 + * 商家处理换货请求接口
  102 + * @link https://op.jinritemai.com/docs/api-docs/17/769
  103 + * @param array $params
  104 + * @return ResultSet
  105 + */
  106 + public function afterSaleBuyerExchange(array $params = []);
  107 +
  108 + /**
  109 + * 售后审核处理原因列表查询接口
  110 + * @link https://op.jinritemai.com/docs/api-docs/17/1540
  111 + * @param array $params
  112 + * @return ResultSet
  113 + */
  114 + public function afterSaleRejectReasonCodeList(array $params = []);
  115 +
  116 + /**
  117 + * 售后商家发货
  118 + * @link https://op.jinritemai.com/docs/api-docs/17/1908
  119 + * @param array $params
  120 + * @return ResultSet
  121 + */
  122 + public function afterSaleFillLogistics(array $params = []);
  123 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Antispam;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Antispam extends Request implements AntispamInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function antispamUserLogin(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('antispam.userLogin')
  16 + ->path('/antispam/userLogin')
  17 + ->params($params);
  18 + }
  19 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Antispam;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 风控安全API
  9 + */
  10 +interface AntispamInterface
  11 +{
  12 + /**
  13 + * 商户登陆风险检查
  14 + * @link https://op.jinritemai.com/docs/api-docs/187/635
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function antispamUserLogin(array $params = []);
  19 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Btas;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Btas extends Request implements BtasInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function btasShipping(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('btas.shipping')
  16 + ->path('/btas/shipping')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function btasGetInspectionOrder(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('btas.getInspectionOrder')
  27 + ->path('/btas/getInspectionOrder')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function btasSaveInspectionOnline(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('btas.saveInspectionOnline')
  38 + ->path('/btas/saveInspectionOnline')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function btasGetOrderInspectionResult(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('btas.getOrderInspectionResult')
  49 + ->path('/btas/getOrderInspectionResult')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function btasSaveInspectionInfo(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('btas.saveInspectionInfo')
  60 + ->path('/btas/saveInspectionInfo')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function btasListBrand(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('btas.listBrand')
  71 + ->path('/btas/listBrand')
  72 + ->params($params);
  73 + }
  74 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Btas;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note BTAS质检API
  9 + */
  10 +interface BtasInterface
  11 +{
  12 + /**
  13 + * 商家调用发货
  14 + * @link https://op.jinritemai.com/docs/api-docs/49/489
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function btasShipping(array $params = []);
  19 +
  20 + /**
  21 + * ⁣查询订单是否需要质检
  22 + * @link https://op.jinritemai.com/docs/api-docs/49/473
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function btasGetInspectionOrder(array $params = []);
  27 +
  28 + /**
  29 + * 图片质检送检
  30 + * @link https://op.jinritemai.com/docs/api-docs/49/572
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function btasSaveInspectionOnline(array $params = []);
  35 +
  36 + /**
  37 + * 获取订单的质检结果
  38 + * @link https://op.jinritemai.com/docs/api-docs/49/573
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function btasGetOrderInspectionResult(array $params = []);
  43 +
  44 + /**
  45 + * 商家送检调用
  46 + * @link https://op.jinritemai.com/docs/api-docs/49/574
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function btasSaveInspectionInfo(array $params = []);
  51 +
  52 + /**
  53 + * 获取可图片鉴定的品牌
  54 + * @link https://op.jinritemai.com/docs/api-docs/49/1865
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function btasListBrand(array $params = []);
  59 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Buyin;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Buyin extends Request implements BuyinInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function buyinSimplePlan(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('buyin.simplePlan')
  16 + ->path('/buyin/simplePlan')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function buyinShopActivityList(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('buyin.ShopActivityList')
  27 + ->path('/buyin/ShopActivityList')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function buyinShopActivityDetail(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('buyin.shopActivityDetail')
  38 + ->path('/buyin/shopActivityDetail')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function buyinApplyActivities(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('buyin.applyActivities')
  49 + ->path('/buyin/applyActivities')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function buyinActivityProductExtendList(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('buyin.activityProductExtendList')
  60 + ->path('/buyin/activityProductExtendList')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function buyinActivityProductExtendApprove(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('buyin.activityProductExtendApprove')
  71 + ->path('/buyin/activityProductExtendApprove')
  72 + ->params($params);
  73 + }
  74 +
  75 + /**
  76 + * @inheritDoc
  77 + */
  78 + public function buyinCreateOrUpdateOrienPlan(array $params = [])
  79 + {
  80 + $this->builder->method('POST')
  81 + ->service('buyin.createOrUpdateOrienPlan')
  82 + ->path('/buyin/createOrUpdateOrienPlan')
  83 + ->params($params);
  84 + }
  85 +
  86 + /**
  87 + * @inheritDoc
  88 + */
  89 + public function buyinOrienPlanList(array $params = [])
  90 + {
  91 + $this->builder->method('POST')
  92 + ->service('buyin.orienPlanList')
  93 + ->path('/buyin/orienPlanList')
  94 + ->params($params);
  95 + }
  96 +
  97 + /**
  98 + * @inheritDoc
  99 + */
  100 + public function buyinOrienPlanCtrl(array $params = [])
  101 + {
  102 + $this->builder->method('POST')
  103 + ->service('buyin.orienPlanCtrl')
  104 + ->path('/buyin/orienPlanCtrl')
  105 + ->params($params);
  106 + }
  107 +
  108 + /**
  109 + * @inheritDoc
  110 + */
  111 + public function buyinOrienPlanAuthors(array $params = [])
  112 + {
  113 + $this->builder->method('POST')
  114 + ->service('buyin.orienPlanAuthors')
  115 + ->path('/buyin/orienPlanAuthors')
  116 + ->params($params);
  117 + }
  118 +
  119 + /**
  120 + * @inheritDoc
  121 + */
  122 + public function buyinOrienPlanAuthorsAdd(array $params = [])
  123 + {
  124 + $this->builder->method('POST')
  125 + ->service('buyin.orienPlanAuthorsAdd')
  126 + ->path('/buyin/orienPlanAuthorsAdd')
  127 + ->params($params);
  128 + }
  129 +
  130 + /**
  131 + * @inheritDoc
  132 + */
  133 + public function buyinOrienPlanAudit(array $params = [])
  134 + {
  135 + $this->builder->method('POST')
  136 + ->service('buyin.orienPlanAudit')
  137 + ->path('/buyin/orienPlanAudit')
  138 + ->params($params);
  139 + }
  140 +
  141 + /**
  142 + * @inheritDoc
  143 + */
  144 + public function buyinExclusivePlan(array $params = [])
  145 + {
  146 + $this->builder->method('POST')
  147 + ->service('buyin.exclusivePlan')
  148 + ->path('/buyin/exclusivePlan')
  149 + ->params($params);
  150 + }
  151 +
  152 + /**
  153 + * @inheritDoc
  154 + */
  155 + public function buyinExclusivePlanAuthorOperate(array $params = [])
  156 + {
  157 + $this->builder->method('POST')
  158 + ->service('buyin.exclusivePlanAuthorOperate')
  159 + ->path('/buyin/exclusivePlanAuthorOperate')
  160 + ->params($params);
  161 + }
  162 +
  163 + /**
  164 + * @inheritDoc
  165 + */
  166 + public function allianceColonelActivityCreateOrUpdate(array $params = [])
  167 + {
  168 + $this->builder->method('POST')
  169 + ->service('alliance.colonelActivityCreateOrUpdate')
  170 + ->path('/alliance/colonelActivityCreateOrUpdate')
  171 + ->params($params);
  172 + }
  173 +
  174 + /**
  175 + * @inheritDoc
  176 + */
  177 + public function allianceActivityProductCategoryList(array $params = [])
  178 + {
  179 + $this->builder->method('POST')
  180 + ->service('alliance.activityProductCategoryList')
  181 + ->path('/alliance/activityProductCategoryList')
  182 + ->params($params);
  183 + }
  184 +
  185 + /**
  186 + * @inheritDoc
  187 + */
  188 + public function allianceInstituteColonelActivityList(array $params = [])
  189 + {
  190 + $this->builder->method('POST')
  191 + ->service('alliance.instituteColonelActivityList')
  192 + ->path('/alliance/instituteColonelActivityList')
  193 + ->params($params);
  194 + }
  195 +
  196 + /**
  197 + * @inheritDoc
  198 + */
  199 + public function allianceInstituteColonelActivityOperate(array $params = [])
  200 + {
  201 + $this->builder->method('POST')
  202 + ->service('alliance.instituteColonelActivityOperate')
  203 + ->path('/alliance/instituteColonelActivityOperate')
  204 + ->params($params);
  205 + }
  206 +
  207 + /**
  208 + * @inheritDoc
  209 + */
  210 + public function allianceColonelActivityProduct(array $params = [])
  211 + {
  212 + $this->builder->method('POST')
  213 + ->service('alliance.colonelActivityProduct')
  214 + ->path('/alliance/colonelActivityProduct')
  215 + ->params($params);
  216 + }
  217 +
  218 + /**
  219 + * @inheritDoc
  220 + */
  221 + public function allianceColonelActivityProductAudit(array $params = [])
  222 + {
  223 + $this->builder->method('POST')
  224 + ->service('alliance.colonelActivityProductAudit')
  225 + ->path('/alliance/colonelActivityProductAudit')
  226 + ->params($params);
  227 + }
  228 +
  229 + /**
  230 + * @inheritDoc
  231 + */
  232 + public function buyinColonelspecialApplyList(array $params = [])
  233 + {
  234 + $this->builder->method('POST')
  235 + ->service('buyin.colonel/specialApplyList')
  236 + ->path('/buyin/colonel/specialApplyList')
  237 + ->params($params);
  238 + }
  239 +
  240 + /**
  241 + * @inheritDoc
  242 + */
  243 + public function allianceColonelActivityProductExtension(array $params = [])
  244 + {
  245 + $this->builder->method('POST')
  246 + ->service('alliance.colonelActivityProductExtension')
  247 + ->path('/alliance/colonelActivityProductExtension')
  248 + ->params($params);
  249 + }
  250 +
  251 + /**
  252 + * @inheritDoc
  253 + */
  254 + public function buyinColonelspecialApplyDeal(array $params = [])
  255 + {
  256 + $this->builder->method('POST')
  257 + ->service('buyin.colonel/specialApplyDeal')
  258 + ->path('/buyin/colonel/specialApplyDeal')
  259 + ->params($params);
  260 + }
  261 +
  262 + /**
  263 + * @inheritDoc
  264 + */
  265 + public function buyinOriginColonelEnrollableActivityList(array $params = [])
  266 + {
  267 + $this->builder->method('POST')
  268 + ->service('buyin.originColonelEnrollableActivityList')
  269 + ->path('/buyin/originColonelEnrollableActivityList')
  270 + ->params($params);
  271 + }
  272 +
  273 + /**
  274 + * @inheritDoc
  275 + */
  276 + public function buyinColonelActivityDetail(array $params = [])
  277 + {
  278 + $this->builder->method('POST')
  279 + ->service('buyin.colonelActivityDetail')
  280 + ->path('/buyin/colonelActivityDetail')
  281 + ->params($params);
  282 + }
  283 +
  284 + /**
  285 + * @inheritDoc
  286 + */
  287 + public function buyinOriginColonelUnappliedProductList(array $params = [])
  288 + {
  289 + $this->builder->method('POST')
  290 + ->service('buyin.originColonelUnappliedProductList')
  291 + ->path('/buyin/originColonelUnappliedProductList')
  292 + ->params($params);
  293 + }
  294 +
  295 + /**
  296 + * @inheritDoc
  297 + */
  298 + public function buyinOriginColonelApplyActivities(array $params = [])
  299 + {
  300 + $this->builder->method('POST')
  301 + ->service('buyin.originColonelApplyActivities')
  302 + ->path('/buyin/originColonelApplyActivities')
  303 + ->params($params);
  304 + }
  305 +
  306 + /**
  307 + * @inheritDoc
  308 + */
  309 + public function buyinActivityProductList(array $params = [])
  310 + {
  311 + $this->builder->method('POST')
  312 + ->service('buyin.activityProductList')
  313 + ->path('/buyin/activityProductList')
  314 + ->params($params);
  315 + }
  316 +
  317 + /**
  318 + * @inheritDoc
  319 + */
  320 + public function buyinActivityProductCancel(array $params = [])
  321 + {
  322 + $this->builder->method('POST')
  323 + ->service('buyin.activityProductCancel')
  324 + ->path('/buyin/activityProductCancel')
  325 + ->params($params);
  326 + }
  327 +
  328 + /**
  329 + * @inheritDoc
  330 + */
  331 + public function allianceMaterialsProductsSearch(array $params = [])
  332 + {
  333 + $this->builder->method('POST')
  334 + ->service('alliance.materialsProductsSearch')
  335 + ->path('/alliance/materialsProductsSearch')
  336 + ->params($params);
  337 + }
  338 +
  339 + /**
  340 + * @inheritDoc
  341 + */
  342 + public function buyinSimplePlanList(array $params = [])
  343 + {
  344 + $this->builder->method('POST')
  345 + ->service('buyin.simplePlanList')
  346 + ->path('/buyin/simplePlanList')
  347 + ->params($params);
  348 + }
  349 +
  350 + /**
  351 + * @inheritDoc
  352 + */
  353 + public function allianceMaterialsProductsDetails(array $params = [])
  354 + {
  355 + $this->builder->method('POST')
  356 + ->service('alliance.materialsProductsDetails')
  357 + ->path('/alliance/materialsProductsDetails')
  358 + ->params($params);
  359 + }
  360 +
  361 + /**
  362 + * @inheritDoc
  363 + */
  364 + public function buyinProductSkus(array $params = [])
  365 + {
  366 + $this->builder->method('POST')
  367 + ->service('buyin.productSkus')
  368 + ->path('/buyin/productSkus')
  369 + ->params($params);
  370 + }
  371 +
  372 + /**
  373 + * @inheritDoc
  374 + */
  375 + public function allianceMaterialsProductCategory(array $params = [])
  376 + {
  377 + $this->builder->method('POST')
  378 + ->service('alliance.materialsProductCategory')
  379 + ->path('/alliance/materialsProductCategory')
  380 + ->params($params);
  381 + }
  382 +
  383 + /**
  384 + * @inheritDoc
  385 + */
  386 + public function buyinMaterialsProductStatus(array $params = [])
  387 + {
  388 + $this->builder->method('POST')
  389 + ->service('buyin.materialsProductStatus')
  390 + ->path('/buyin/materialsProductStatus')
  391 + ->params($params);
  392 + }
  393 +
  394 + /**
  395 + * @inheritDoc
  396 + */
  397 + public function buyinKolMaterialsProductsSearch(array $params = [])
  398 + {
  399 + $this->builder->method('POST')
  400 + ->service('buyin.kolMaterialsProductsSearch')
  401 + ->path('/buyin/kolMaterialsProductsSearch')
  402 + ->params($params);
  403 + }
  404 +
  405 + /**
  406 + * @inheritDoc
  407 + */
  408 + public function buyinKolMaterialsProductsDetails(array $params = [])
  409 + {
  410 + $this->builder->method('POST')
  411 + ->service('buyin.kolMaterialsProductsDetails')
  412 + ->path('/buyin/kolMaterialsProductsDetails')
  413 + ->params($params);
  414 + }
  415 +
  416 + /**
  417 + * @inheritDoc
  418 + */
  419 + public function buyinQueryInstituteOrders(array $params = [])
  420 + {
  421 + $this->builder->method('POST')
  422 + ->service('buyin.queryInstituteOrders')
  423 + ->path('/buyin/queryInstituteOrders')
  424 + ->params($params);
  425 + }
  426 +
  427 + /**
  428 + * @inheritDoc
  429 + */
  430 + public function buyinInstituteOrderMCN(array $params = [])
  431 + {
  432 + $this->builder->method('POST')
  433 + ->service('buyin.instituteOrderMCN')
  434 + ->path('/buyin/instituteOrderMCN')
  435 + ->params($params);
  436 + }
  437 +
  438 + /**
  439 + * @inheritDoc
  440 + */
  441 + public function buyinInstituteOrderColonel(array $params = [])
  442 + {
  443 + $this->builder->method('POST')
  444 + ->service('buyin.instituteOrderColonel')
  445 + ->path('/buyin/instituteOrderColonel')
  446 + ->params($params);
  447 + }
  448 +
  449 + /**
  450 + * @inheritDoc
  451 + */
  452 + public function buyinInstPickSourceConvert(array $params = [])
  453 + {
  454 + $this->builder->method('POST')
  455 + ->service('buyin.instPickSourceConvert')
  456 + ->path('/buyin/instPickSourceConvert')
  457 + ->params($params);
  458 + }
  459 +
  460 + /**
  461 + * @inheritDoc
  462 + */
  463 + public function buyinInstGmv(array $params = [])
  464 + {
  465 + $this->builder->method('POST')
  466 + ->service('buyin.instGmv')
  467 + ->path('/buyin/instGmv')
  468 + ->params($params);
  469 + }
  470 +
  471 + /**
  472 + * @inheritDoc
  473 + */
  474 + public function buyinInstGmvDetail(array $params = [])
  475 + {
  476 + $this->builder->method('POST')
  477 + ->service('buyin.instGmvDetail')
  478 + ->path('/buyin/instGmvDetail')
  479 + ->params($params);
  480 + }
  481 +
  482 + /**
  483 + * @inheritDoc
  484 + */
  485 + public function buyinKolPidCreate(array $params = [])
  486 + {
  487 + $this->builder->method('POST')
  488 + ->service('buyin.kolPidCreate')
  489 + ->path('/buyin/kolPidCreate')
  490 + ->params($params);
  491 + }
  492 +
  493 + /**
  494 + * @inheritDoc
  495 + */
  496 + public function buyinKolPidList(array $params = [])
  497 + {
  498 + $this->builder->method('POST')
  499 + ->service('buyin.kolPidList')
  500 + ->path('/buyin/kolPidList')
  501 + ->params($params);
  502 + }
  503 +
  504 + /**
  505 + * @inheritDoc
  506 + */
  507 + public function buyinKolPidEdit(array $params = [])
  508 + {
  509 + $this->builder->method('POST')
  510 + ->service('buyin.kolPidEdit')
  511 + ->path('/buyin/kolPidEdit')
  512 + ->params($params);
  513 + }
  514 +
  515 + /**
  516 + * @inheritDoc
  517 + */
  518 + public function buyinKolPidDel(array $params = [])
  519 + {
  520 + $this->builder->method('POST')
  521 + ->service('buyin.kolPidDel')
  522 + ->path('/buyin/kolPidDel')
  523 + ->params($params);
  524 + }
  525 +
  526 + /**
  527 + * @inheritDoc
  528 + */
  529 + public function buyinShareCommandParse(array $params = [])
  530 + {
  531 + $this->builder->method('POST')
  532 + ->service('buyin.shareCommandParse')
  533 + ->path('/buyin/shareCommandParse')
  534 + ->params($params);
  535 + }
  536 +
  537 + /**
  538 + * @inheritDoc
  539 + */
  540 + public function buyinKolProductShare(array $params = [])
  541 + {
  542 + $this->builder->method('POST')
  543 + ->service('buyin.kolProductShare')
  544 + ->path('/buyin/kolProductShare')
  545 + ->params($params);
  546 + }
  547 +
  548 + /**
  549 + * @inheritDoc
  550 + */
  551 + public function buyinInstitutePidCreate(array $params = [])
  552 + {
  553 + $this->builder->method('POST')
  554 + ->service('buyin.institutePidCreate')
  555 + ->path('/buyin/institutePidCreate')
  556 + ->params($params);
  557 + }
  558 +
  559 + /**
  560 + * @inheritDoc
  561 + */
  562 + public function buyinInstitutePidList(array $params = [])
  563 + {
  564 + $this->builder->method('POST')
  565 + ->service('buyin.institutePidList')
  566 + ->path('/buyin/institutePidList')
  567 + ->params($params);
  568 + }
  569 +
  570 + /**
  571 + * @inheritDoc
  572 + */
  573 + public function buyinInstitutePidEdit(array $params = [])
  574 + {
  575 + $this->builder->method('POST')
  576 + ->service('buyin.institutePidEdit')
  577 + ->path('/buyin/institutePidEdit')
  578 + ->params($params);
  579 + }
  580 +
  581 + /**
  582 + * @inheritDoc
  583 + */
  584 + public function buyinInstitutePidDel(array $params = [])
  585 + {
  586 + $this->builder->method('POST')
  587 + ->service('buyin.institutePidDel')
  588 + ->path('/buyin/institutePidDel')
  589 + ->params($params);
  590 + }
  591 +
  592 + /**
  593 + * @inheritDoc
  594 + */
  595 + public function buyinLiveShareMaterial(array $params = [])
  596 + {
  597 + $this->builder->method('POST')
  598 + ->service('buyin.liveShareMaterial')
  599 + ->path('/buyin/liveShareMaterial')
  600 + ->params($params);
  601 + }
  602 +
  603 + /**
  604 + * @inheritDoc
  605 + */
  606 + public function buyinDistributionLiveProductList(array $params = [])
  607 + {
  608 + $this->builder->method('POST')
  609 + ->service('buyin.distributionLiveProductList')
  610 + ->path('/buyin/distributionLiveProductList')
  611 + ->params($params);
  612 + }
  613 +
  614 + /**
  615 + * @inheritDoc
  616 + */
  617 + public function buyinInstituteLiveShare(array $params = [])
  618 + {
  619 + $this->builder->method('POST')
  620 + ->service('buyin.instituteLiveShare')
  621 + ->path('/buyin/instituteLiveShare')
  622 + ->params($params);
  623 + }
  624 +
  625 + /**
  626 + * @inheritDoc
  627 + */
  628 + public function buyinInstituteOrderAds(array $params = [])
  629 + {
  630 + $this->builder->method('POST')
  631 + ->service('buyin.instituteOrderAds')
  632 + ->path('/buyin/instituteOrderAds')
  633 + ->params($params);
  634 + }
  635 +
  636 + /**
  637 + * @inheritDoc
  638 + */
  639 + public function buyinKolOrderAds(array $params = [])
  640 + {
  641 + $this->builder->method('POST')
  642 + ->service('buyin.kolOrderAds')
  643 + ->path('/buyin/kolOrderAds')
  644 + ->params($params);
  645 + }
  646 +
  647 + /**
  648 + * @inheritDoc
  649 + */
  650 + public function buyinShopPidMemberCreate(array $params = [])
  651 + {
  652 + $this->builder->method('POST')
  653 + ->service('buyin.shopPidMemberCreate')
  654 + ->path('/buyin/shopPidMemberCreate')
  655 + ->params($params);
  656 + }
  657 +
  658 + /**
  659 + * @inheritDoc
  660 + */
  661 + public function buyinKolLiveShare(array $params = [])
  662 + {
  663 + $this->builder->method('POST')
  664 + ->service('buyin.kolLiveShare')
  665 + ->path('/buyin/kolLiveShare')
  666 + ->params($params);
  667 + }
  668 +
  669 + /**
  670 + * @inheritDoc
  671 + */
  672 + public function buyinMHandleTrusteeshipApply(array $params = [])
  673 + {
  674 + $this->builder->method('POST')
  675 + ->service('buyin.mHandleTrusteeshipApply')
  676 + ->path('/buyin/mHandleTrusteeshipApply')
  677 + ->params($params);
  678 + }
  679 +
  680 + /**
  681 + * @inheritDoc
  682 + */
  683 + public function buyinColoneltrusteeshipList(array $params = [])
  684 + {
  685 + $this->builder->method('POST')
  686 + ->service('buyin.colonel/trusteeshipList')
  687 + ->path('/buyin/colonel/trusteeshipList')
  688 + ->params($params);
  689 + }
  690 +
  691 + /**
  692 + * @inheritDoc
  693 + */
  694 + public function buyinInstituteOrderPick(array $params = [])
  695 + {
  696 + $this->builder->method('POST')
  697 + ->service('buyin.instituteOrderPick')
  698 + ->path('/buyin/instituteOrderPick')
  699 + ->params($params);
  700 + }
  701 +
  702 + /**
  703 + * @inheritDoc
  704 + */
  705 + public function buyinInstituteLivePreviewShare(array $params = [])
  706 + {
  707 + $this->builder->method('POST')
  708 + ->service('buyin.instituteLivePreviewShare')
  709 + ->path('/buyin/instituteLivePreviewShare')
  710 + ->params($params);
  711 + }
  712 +
  713 + /**
  714 + * @inheritDoc
  715 + */
  716 + public function buyinKolLivePreviewShare(array $params = [])
  717 + {
  718 + $this->builder->method('POST')
  719 + ->service('buyin.kolLivePreviewShare')
  720 + ->path('/buyin/kolLivePreviewShare')
  721 + ->params($params);
  722 + }
  723 +
  724 + /**
  725 + * @inheritDoc
  726 + */
  727 + public function buyinActivityShareConvert(array $params = [])
  728 + {
  729 + $this->builder->method('POST')
  730 + ->service('buyin.activityShareConvert')
  731 + ->path('/buyin/activityShareConvert')
  732 + ->params($params);
  733 + }
  734 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Buyin;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 精选联盟API
  9 + */
  10 +interface BuyinInterface
  11 +{
  12 + /**
  13 + * 创建/修改普通商品推广计划
  14 + * @link https://op.jinritemai.com/docs/api-docs/61/923
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function buyinSimplePlan(array $params = []);
  19 +
  20 + /**
  21 + * 商家可参与的团长活动查询接口
  22 + * @link https://op.jinritemai.com/docs/api-docs/61/1671
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function buyinShopActivityList(array $params = []);
  27 +
  28 + /**
  29 + * 商家侧获取团长活动详情
  30 + * @link https://op.jinritemai.com/docs/api-docs/61/1797
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function buyinShopActivityDetail(array $params = []);
  35 +
  36 + /**
  37 + * 商品团长活动提报接口
  38 + * @link https://op.jinritemai.com/docs/api-docs/61/744
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function buyinApplyActivities(array $params = []);
  43 +
  44 + /**
  45 + * 延长推广待处理/已处理记录查询
  46 + * @link https://op.jinritemai.com/docs/api-docs/61/1674
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function buyinActivityProductExtendList(array $params = []);
  51 +
  52 + /**
  53 + * 商家处理团长活动商品的推广延期申请
  54 + * @link https://op.jinritemai.com/docs/api-docs/61/1673
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function buyinActivityProductExtendApprove(array $params = []);
  59 +
  60 + /**
  61 + * 创建/修改商品定向计划
  62 + * @link https://op.jinritemai.com/docs/api-docs/61/708
  63 + * @param array $params
  64 + * @return ResultSet
  65 + */
  66 + public function buyinCreateOrUpdateOrienPlan(array $params = []);
  67 +
  68 + /**
  69 + * 商品定向计划查询
  70 + * @link https://op.jinritemai.com/docs/api-docs/61/705
  71 + * @param array $params
  72 + * @return ResultSet
  73 + */
  74 + public function buyinOrienPlanList(array $params = []);
  75 +
  76 + /**
  77 + * 商品定向计划管理
  78 + * @link https://op.jinritemai.com/docs/api-docs/61/704
  79 + * @param array $params
  80 + * @return ResultSet
  81 + */
  82 + public function buyinOrienPlanCtrl(array $params = []);
  83 +
  84 + /**
  85 + * 查询定向计划作者列表
  86 + * @link https://op.jinritemai.com/docs/api-docs/61/1879
  87 + * @param array $params
  88 + * @return ResultSet
  89 + */
  90 + public function buyinOrienPlanAuthors(array $params = []);
  91 +
  92 + /**
  93 + * 向指定定向计划中添加达人
  94 + * @link https://op.jinritemai.com/docs/api-docs/61/1877
  95 + * @param array $params
  96 + * @return ResultSet
  97 + */
  98 + public function buyinOrienPlanAuthorsAdd(array $params = []);
  99 +
  100 + /**
  101 + * 定向计划达人申请审核
  102 + * @link https://op.jinritemai.com/docs/api-docs/61/1878
  103 + * @param array $params
  104 + * @return ResultSet
  105 + */
  106 + public function buyinOrienPlanAudit(array $params = []);
  107 +
  108 + /**
  109 + * 创建/修改商品专属推广计划
  110 + * @link https://op.jinritemai.com/docs/api-docs/61/1880
  111 + * @param array $params
  112 + * @return ResultSet
  113 + */
  114 + public function buyinExclusivePlan(array $params = []);
  115 +
  116 + /**
  117 + * 店铺专属达人管理
  118 + * @link https://op.jinritemai.com/docs/api-docs/61/1935
  119 + * @param array $params
  120 + * @return ResultSet
  121 + */
  122 + public function buyinExclusivePlanAuthorOperate(array $params = []);
  123 +
  124 + /**
  125 + * 团长活动创建/编辑接口
  126 + * @link https://op.jinritemai.com/docs/api-docs/61/966
  127 + * @param array $params
  128 + * @return ResultSet
  129 + */
  130 + public function allianceColonelActivityCreateOrUpdate(array $params = []);
  131 +
  132 + /**
  133 + * 创建活动时候可选择的类目接口
  134 + * @link https://op.jinritemai.com/docs/api-docs/61/1882
  135 + * @param array $params
  136 + * @return ResultSet
  137 + */
  138 + public function allianceActivityProductCategoryList(array $params = []);
  139 +
  140 + /**
  141 + * 团长活动查询接口
  142 + * @link https://op.jinritemai.com/docs/api-docs/61/1330
  143 + * @param array $params
  144 + * @return ResultSet
  145 + */
  146 + public function allianceInstituteColonelActivityList(array $params = []);
  147 +
  148 + /**
  149 + * 专属团长活动删除接口(下线+删除)
  150 + * @link https://op.jinritemai.com/docs/api-docs/61/972
  151 + * @param array $params
  152 + * @return ResultSet
  153 + */
  154 + public function allianceInstituteColonelActivityOperate(array $params = []);
  155 +
  156 + /**
  157 + * 活动商品查询接口
  158 + * @link https://op.jinritemai.com/docs/api-docs/61/968
  159 + * @param array $params
  160 + * @return ResultSet
  161 + */
  162 + public function allianceColonelActivityProduct(array $params = []);
  163 +
  164 + /**
  165 + * 专属团长活动商品审核接口
  166 + * @link https://op.jinritemai.com/docs/api-docs/61/971
  167 + * @param array $params
  168 + * @return ResultSet
  169 + */
  170 + public function allianceColonelActivityProductAudit(array $params = []);
  171 +
  172 + /**
  173 + * 查询团长活动特殊申请
  174 + * @link https://op.jinritemai.com/docs/api-docs/61/1552
  175 + * @param array $params
  176 + * @return ResultSet
  177 + */
  178 + public function buyinColonelspecialApplyList(array $params = []);
  179 +
  180 + /**
  181 + * 专属团长活动商品延时接口
  182 + * @link https://op.jinritemai.com/docs/api-docs/61/1881
  183 + * @param array $params
  184 + * @return ResultSet
  185 + */
  186 + public function allianceColonelActivityProductExtension(array $params = []);
  187 +
  188 + /**
  189 + * 团长活动特殊申请审核
  190 + * @link https://op.jinritemai.com/docs/api-docs/61/1553
  191 + * @param array $params
  192 + * @return ResultSet
  193 + */
  194 + public function buyinColonelspecialApplyDeal(array $params = []);
  195 +
  196 + /**
  197 + * 团长可参与的二级团长活动查询接口
  198 + * @link https://op.jinritemai.com/docs/api-docs/61/1675
  199 + * @param array $params
  200 + * @return ResultSet
  201 + */
  202 + public function buyinOriginColonelEnrollableActivityList(array $params = []);
  203 +
  204 + /**
  205 + * 获取团长活动详情
  206 + * @link https://op.jinritemai.com/docs/api-docs/61/1670
  207 + * @param array $params
  208 + * @return ResultSet
  209 + */
  210 + public function buyinColonelActivityDetail(array $params = []);
  211 +
  212 + /**
  213 + * 团长获取可提报二级团长活动的商品列表
  214 + * @link https://op.jinritemai.com/docs/api-docs/61/1677
  215 + * @param array $params
  216 + * @return ResultSet
  217 + */
  218 + public function buyinOriginColonelUnappliedProductList(array $params = []);
  219 +
  220 + /**
  221 + * 团长报名二级团长活动
  222 + * @link https://op.jinritemai.com/docs/api-docs/61/1672
  223 + * @param array $params
  224 + * @return ResultSet
  225 + */
  226 + public function buyinOriginColonelApplyActivities(array $params = []);
  227 +
  228 + /**
  229 + * 一级团长查询提报活动商品
  230 + * @link https://op.jinritemai.com/docs/api-docs/61/1926
  231 + * @param array $params
  232 + * @return ResultSet
  233 + */
  234 + public function buyinActivityProductList(array $params = []);
  235 +
  236 + /**
  237 + * 一级团长取消活动提报申请接口
  238 + * @link https://op.jinritemai.com/docs/api-docs/61/1927
  239 + * @param array $params
  240 + * @return ResultSet
  241 + */
  242 + public function buyinActivityProductCancel(array $params = []);
  243 +
  244 + /**
  245 + * 检索精选联盟商品
  246 + * @link https://op.jinritemai.com/docs/api-docs/61/924
  247 + * @param array $params
  248 + * @return ResultSet
  249 + */
  250 + public function allianceMaterialsProductsSearch(array $params = []);
  251 +
  252 + /**
  253 + * 商品推广 普通计划查询
  254 + * @link https://op.jinritemai.com/docs/api-docs/61/349
  255 + * @param array $params
  256 + * @return ResultSet
  257 + */
  258 + public function buyinSimplePlanList(array $params = []);
  259 +
  260 + /**
  261 + * 批量查询推广商品详情
  262 + * @link https://op.jinritemai.com/docs/api-docs/61/1356
  263 + * @param array $params
  264 + * @return ResultSet
  265 + */
  266 + public function allianceMaterialsProductsDetails(array $params = []);
  267 +
  268 + /**
  269 + * 查询商品 SKU
  270 + * @link https://op.jinritemai.com/docs/api-docs/61/1626
  271 + * @param array $params
  272 + * @return ResultSet
  273 + */
  274 + public function buyinProductSkus(array $params = []);
  275 +
  276 + /**
  277 + * 类目查询
  278 + * @link https://op.jinritemai.com/docs/api-docs/61/637
  279 + * @param array $params
  280 + * @return ResultSet
  281 + */
  282 + public function allianceMaterialsProductCategory(array $params = []);
  283 +
  284 + /**
  285 + * 商品状态查询
  286 + * @link https://op.jinritemai.com/docs/api-docs/61/1497
  287 + * @param array $params
  288 + * @return ResultSet
  289 + */
  290 + public function buyinMaterialsProductStatus(array $params = []);
  291 +
  292 + /**
  293 + * 检索精选联盟商品,需达人授权
  294 + * @link https://op.jinritemai.com/docs/api-docs/61/1725
  295 + * @param array $params
  296 + * @return ResultSet
  297 + */
  298 + public function buyinKolMaterialsProductsSearch(array $params = []);
  299 +
  300 + /**
  301 + * 查询达人视角商品详情
  302 + * @link https://op.jinritemai.com/docs/api-docs/61/1589
  303 + * @param array $params
  304 + * @return ResultSet
  305 + */
  306 + public function buyinKolMaterialsProductsDetails(array $params = []);
  307 +
  308 + /**
  309 + * 【即将下线】查询机构联盟订单
  310 + * @link https://op.jinritemai.com/docs/api-docs/61/1398
  311 + * @param array $params
  312 + * @return ResultSet
  313 + */
  314 + public function buyinQueryInstituteOrders(array $params = []);
  315 +
  316 + /**
  317 + * 查询MCN机构订单
  318 + * @link https://op.jinritemai.com/docs/api-docs/61/1602
  319 + * @param array $params
  320 + * @return ResultSet
  321 + */
  322 + public function buyinInstituteOrderMCN(array $params = []);
  323 +
  324 + /**
  325 + * 机构查询团长订单
  326 + * @link https://op.jinritemai.com/docs/api-docs/61/1603
  327 + * @param array $params
  328 + * @return ResultSet
  329 + */
  330 + public function buyinInstituteOrderColonel(array $params = []);
  331 +
  332 + /**
  333 + * 商品选品来源转链
  334 + * @link https://op.jinritemai.com/docs/api-docs/61/1454
  335 + * @param array $params
  336 + * @return ResultSet
  337 + */
  338 + public function buyinInstPickSourceConvert(array $params = []);
  339 +
  340 + /**
  341 + * 机构选品GMV查询接口
  342 + * @link https://op.jinritemai.com/docs/api-docs/61/1652
  343 + * @param array $params
  344 + * @return ResultSet
  345 + */
  346 + public function buyinInstGmv(array $params = []);
  347 +
  348 + /**
  349 + * 机构选品GMV明细查询接口
  350 + * @link https://op.jinritemai.com/docs/api-docs/61/1653
  351 + * @param array $params
  352 + * @return ResultSet
  353 + */
  354 + public function buyinInstGmvDetail(array $params = []);
  355 +
  356 + /**
  357 + * 达人PID创建
  358 + * @link https://op.jinritemai.com/docs/api-docs/61/1460
  359 + * @param array $params
  360 + * @return ResultSet
  361 + */
  362 + public function buyinKolPidCreate(array $params = []);
  363 +
  364 + /**
  365 + * 达人PID查询接口
  366 + * @link https://op.jinritemai.com/docs/api-docs/61/1461
  367 + * @param array $params
  368 + * @return ResultSet
  369 + */
  370 + public function buyinKolPidList(array $params = []);
  371 +
  372 + /**
  373 + * 达人PID 编辑
  374 + * @link https://op.jinritemai.com/docs/api-docs/61/1462
  375 + * @param array $params
  376 + * @return ResultSet
  377 + */
  378 + public function buyinKolPidEdit(array $params = []);
  379 +
  380 + /**
  381 + * 达人PID删除
  382 + * @link https://op.jinritemai.com/docs/api-docs/61/1463
  383 + * @param array $params
  384 + * @return ResultSet
  385 + */
  386 + public function buyinKolPidDel(array $params = []);
  387 +
  388 + /**
  389 + * 商品口令转商品解析
  390 + * @link https://op.jinritemai.com/docs/api-docs/61/1726
  391 + * @param array $params
  392 + * @return ResultSet
  393 + */
  394 + public function buyinShareCommandParse(array $params = []);
  395 +
  396 + /**
  397 + * 达人商品分销转链
  398 + * @link https://op.jinritemai.com/docs/api-docs/61/1464
  399 + * @param array $params
  400 + * @return ResultSet
  401 + */
  402 + public function buyinKolProductShare(array $params = []);
  403 +
  404 + /**
  405 + * 机构PID创建
  406 + * @link https://op.jinritemai.com/docs/api-docs/61/1273
  407 + * @param array $params
  408 + * @return ResultSet
  409 + */
  410 + public function buyinInstitutePidCreate(array $params = []);
  411 +
  412 + /**
  413 + * 机构PID查询接口
  414 + * @link https://op.jinritemai.com/docs/api-docs/61/1269
  415 + * @param array $params
  416 + * @return ResultSet
  417 + */
  418 + public function buyinInstitutePidList(array $params = []);
  419 +
  420 + /**
  421 + * 机构PID 编辑
  422 + * @link https://op.jinritemai.com/docs/api-docs/61/1270
  423 + * @param array $params
  424 + * @return ResultSet
  425 + */
  426 + public function buyinInstitutePidEdit(array $params = []);
  427 +
  428 + /**
  429 + * 机构PID删除
  430 + * @link https://op.jinritemai.com/docs/api-docs/61/1271
  431 + * @param array $params
  432 + * @return ResultSet
  433 + */
  434 + public function buyinInstitutePidDel(array $params = []);
  435 +
  436 + /**
  437 + * 直播间分销物料查询
  438 + * @link https://op.jinritemai.com/docs/api-docs/61/1396
  439 + * @param array $params
  440 + * @return ResultSet
  441 + */
  442 + public function buyinLiveShareMaterial(array $params = []);
  443 +
  444 + /**
  445 + * 分销直播间商品列表
  446 + * @link https://op.jinritemai.com/docs/api-docs/61/1770
  447 + * @param array $params
  448 + * @return ResultSet
  449 + */
  450 + public function buyinDistributionLiveProductList(array $params = []);
  451 +
  452 + /**
  453 + * 机构获取达人直播间分享链接
  454 + * @link https://op.jinritemai.com/docs/api-docs/61/1297
  455 + * @param array $params
  456 + * @return ResultSet
  457 + */
  458 + public function buyinInstituteLiveShare(array $params = []);
  459 +
  460 + /**
  461 + * 查询抖客直播间分销订单
  462 + * @link https://op.jinritemai.com/docs/api-docs/61/1296
  463 + * @param array $params
  464 + * @return ResultSet
  465 + */
  466 + public function buyinInstituteOrderAds(array $params = []);
  467 +
  468 + /**
  469 + * 查询达人的直播间分销、商品分销、活动页分销订单
  470 + * @link https://op.jinritemai.com/docs/api-docs/61/1459
  471 + * @param array $params
  472 + * @return ResultSet
  473 + */
  474 + public function buyinKolOrderAds(array $params = []);
  475 +
  476 + /**
  477 + * 店铺会员绑定渠道关系创建
  478 + * @link https://op.jinritemai.com/docs/api-docs/61/1493
  479 + * @param array $params
  480 + * @return ResultSet
  481 + */
  482 + public function buyinShopPidMemberCreate(array $params = []);
  483 +
  484 + /**
  485 + * 获取达人直播间分享链接
  486 + * @link https://op.jinritemai.com/docs/api-docs/61/1724
  487 + * @param array $params
  488 + * @return ResultSet
  489 + */
  490 + public function buyinKolLiveShare(array $params = []);
  491 +
  492 + /**
  493 + * 团长托管商品审核
  494 + * @link https://op.jinritemai.com/docs/api-docs/61/2138
  495 + * @param array $params
  496 + * @return ResultSet
  497 + */
  498 + public function buyinMHandleTrusteeshipApply(array $params = []);
  499 +
  500 + /**
  501 + * 团长托管商品查询
  502 + * @link https://op.jinritemai.com/docs/api-docs/61/2137
  503 + * @param array $params
  504 + * @return ResultSet
  505 + */
  506 + public function buyinColoneltrusteeshipList(array $params = []);
  507 +
  508 + /**
  509 + * 选品订单明细查询接口
  510 + * @link https://op.jinritemai.com/docs/api-docs/61/2008
  511 + * @param array $params
  512 + * @return ResultSet
  513 + */
  514 + public function buyinInstituteOrderPick(array $params = []);
  515 +
  516 + /**
  517 + * 机构直播预告转链
  518 + * @link https://op.jinritemai.com/docs/api-docs/61/2007
  519 + * @param array $params
  520 + * @return ResultSet
  521 + */
  522 + public function buyinInstituteLivePreviewShare(array $params = []);
  523 +
  524 + /**
  525 + * 达人直播预告转链
  526 + * @link https://op.jinritemai.com/docs/api-docs/61/2006
  527 + * @param array $params
  528 + * @return ResultSet
  529 + */
  530 + public function buyinKolLivePreviewShare(array $params = []);
  531 +
  532 + /**
  533 + * 活动页转链接口
  534 + * @link https://op.jinritemai.com/docs/api-docs/61/2003
  535 + * @param array $params
  536 + * @return ResultSet
  537 + */
  538 + public function buyinActivityShareConvert(array $params = []);
  539 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Coupons;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Coupons extends Request implements CouponsInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function couponsCancelVerify(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('coupons.cancelVerify')
  16 + ->path('/coupons/cancelVerify')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function couponsAbandon(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('coupons.abandon')
  27 + ->path('/coupons/abandon')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function couponsSyncV2(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('coupons.syncV2')
  38 + ->path('/coupons/syncV2')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function couponsVerifyV2(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('coupons.verifyV2')
  49 + ->path('/coupons/verifyV2')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function couponsCertVerifyUpdate(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('coupons.certVerifyUpdate')
  60 + ->path('/coupons/certVerifyUpdate')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function orderSettle(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('order.settle')
  71 + ->path('/coupons/list')
  72 + ->params($params);
  73 + }
  74 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Coupons;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 卡券API
  9 + */
  10 +interface CouponsInterface
  11 +{
  12 + /**
  13 + * 卡券取消核销接口
  14 + * @link https://op.jinritemai.com/docs/api-docs/52/668
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function couponsCancelVerify(array $params = []);
  19 +
  20 + /**
  21 + * 卡券废弃接口
  22 + * @link https://op.jinritemai.com/docs/api-docs/52/669
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function couponsAbandon(array $params = []);
  27 +
  28 + /**
  29 + * 卡券同步
  30 + * @link https://op.jinritemai.com/docs/api-docs/52/712
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function couponsSyncV2(array $params = []);
  35 +
  36 + /**
  37 + * 卡券核销接口V2版本
  38 + * @link https://op.jinritemai.com/docs/api-docs/52/797
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function couponsVerifyV2(array $params = []);
  43 +
  44 + /**
  45 + * 卡券核销次数更新
  46 + * @link https://op.jinritemai.com/docs/api-docs/52/900
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function couponsCertVerifyUpdate(array $params = []);
  51 +
  52 + /**
  53 + * 三方卡券列表查询
  54 + * @link https://op.jinritemai.com/docs/api-docs/52/369
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function orderSettle(array $params = []);
  59 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Crossborder;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Crossborder extends Request implements CrossborderInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function dutyFreeOrderList(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('dutyFree.orderList')
  16 + ->path('/dutyFree/orderList')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function crossborderStockTaking(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('crossborder.stockTaking')
  27 + ->path('/crossborder/stockTaking')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function crossborderStockTransform(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('crossborder.stockTransform')
  38 + ->path('/crossborder/stockTransform')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function crossborderOrderInterception(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('crossborder.OrderInterception')
  49 + ->path('/crossborder/OrderInterception')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function crossborderTakingLogisticsInfo(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('crossborder.takingLogisticsInfo')
  60 + ->path('/crossborder/takingLogisticsInfo')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function crossborderWarehouseInOutboundEvent(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('crossborder.warehouseInOutboundEvent')
  71 + ->path('/crossborder/warehouseInOutboundEvent')
  72 + ->params($params);
  73 + }
  74 +
  75 + /**
  76 + * @inheritDoc
  77 + */
  78 + public function crossBorderGetTradeOrderStatus(array $params = [])
  79 + {
  80 + $this->builder->method('POST')
  81 + ->service('crossBorder.getTradeOrderStatus')
  82 + ->path('/crossBorder/getTradeOrderStatus')
  83 + ->params($params);
  84 + }
  85 +
  86 + /**
  87 + * @inheritDoc
  88 + */
  89 + public function crossBorderCustomsTaxInfo(array $params = [])
  90 + {
  91 + $this->builder->method('POST')
  92 + ->service('crossBorder.customsTaxInfo')
  93 + ->path('/crossBorder/customsTaxInfo')
  94 + ->params($params);
  95 + }
  96 +
  97 + /**
  98 + * @inheritDoc
  99 + */
  100 + public function dutyFreeOrderConfirm(array $params = [])
  101 + {
  102 + $this->builder->method('POST')
  103 + ->service('dutyFree.orderConfirm')
  104 + ->path('/dutyFree/orderConfirm')
  105 + ->params($params);
  106 + }
  107 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Crossborder;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 跨境API
  9 + */
  10 +interface CrossborderInterface
  11 +{
  12 + /**
  13 + * 商家拉单
  14 + * @link https://op.jinritemai.com/docs/api-docs/53/703
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function dutyFreeOrderList(array $params = []);
  19 +
  20 + /**
  21 + * 库存盘点回告
  22 + * @link https://op.jinritemai.com/docs/api-docs/53/883
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function crossborderStockTaking(array $params = []);
  27 +
  28 + /**
  29 + * 库存类型变动回告
  30 + * @link https://op.jinritemai.com/docs/api-docs/53/918
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function crossborderStockTransform(array $params = []);
  35 +
  36 + /**
  37 + * 服务商锁单结果回告
  38 + * @link https://op.jinritemai.com/docs/api-docs/53/920
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function crossborderOrderInterception(array $params = []);
  43 +
  44 + /**
  45 + * 运单信息回告
  46 + * @link https://op.jinritemai.com/docs/api-docs/53/1293
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function crossborderTakingLogisticsInfo(array $params = []);
  51 +
  52 + /**
  53 + * 入库和提货出库回告
  54 + * @link https://op.jinritemai.com/docs/api-docs/53/1205
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function crossborderWarehouseInOutboundEvent(array $params = []);
  59 +
  60 + /**
  61 + * 获取交易订单状态
  62 + * @link https://op.jinritemai.com/docs/api-docs/53/1650
  63 + * @param array $params
  64 + * @return ResultSet
  65 + */
  66 + public function crossBorderGetTradeOrderStatus(array $params = []);
  67 +
  68 + /**
  69 + * 服务商回告海关税费
  70 + * @link https://op.jinritemai.com/docs/api-docs/53/1761
  71 + * @param array $params
  72 + * @return ResultSet
  73 + */
  74 + public function crossBorderCustomsTaxInfo(array $params = []);
  75 +
  76 + /**
  77 + * 商家接单
  78 + * @link https://op.jinritemai.com/docs/api-docs/53/1873
  79 + * @param array $params
  80 + * @return ResultSet
  81 + */
  82 + public function dutyFreeOrderConfirm(array $params = []);
  83 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Iop;
  4 +
  5 +use Lackoxygen\TiktokShop\Request\Request;
  6 +
  7 +class Iop extends Request implements IopInterface
  8 +{
  9 + /**
  10 + * @inheritDoc
  11 + */
  12 + public function iopOrderList(array $params = [])
  13 + {
  14 + $this->builder->method('POST')
  15 + ->service('iop.orderList')
  16 + ->path('/iop/orderList')
  17 + ->params($params);
  18 + }
  19 +
  20 + /**
  21 + * @inheritDoc
  22 + */
  23 + public function iopWaybillGet(array $params = [])
  24 + {
  25 + $this->builder->method('POST')
  26 + ->service('iop.waybillGet')
  27 + ->path('/iop/waybillGet')
  28 + ->params($params);
  29 + }
  30 +
  31 + /**
  32 + * @inheritDoc
  33 + */
  34 + public function iopWaybillCancel(array $params = [])
  35 + {
  36 + $this->builder->method('POST')
  37 + ->service('iop.waybillCancel')
  38 + ->path('/iop/waybillCancel')
  39 + ->params($params);
  40 + }
  41 +
  42 + /**
  43 + * @inheritDoc
  44 + */
  45 + public function iopWaybillReturn(array $params = [])
  46 + {
  47 + $this->builder->method('POST')
  48 + ->service('iop.waybillReturn')
  49 + ->path('/iop/waybillReturn')
  50 + ->params($params);
  51 + }
  52 +
  53 + /**
  54 + * @inheritDoc
  55 + */
  56 + public function iopWaybillUpdate(array $params = [])
  57 + {
  58 + $this->builder->method('POST')
  59 + ->service('iop.waybillUpdate')
  60 + ->path('/iop/waybillUpdate')
  61 + ->params($params);
  62 + }
  63 +
  64 + /**
  65 + * @inheritDoc
  66 + */
  67 + public function iopOrderInfo(array $params = [])
  68 + {
  69 + $this->builder->method('POST')
  70 + ->service('iop.orderInfo')
  71 + ->path('/iop/orderInfo')
  72 + ->params($params);
  73 + }
  74 +
  75 + /**
  76 + * @inheritDoc
  77 + */
  78 + public function iopSellerDistribute(array $params = [])
  79 + {
  80 + $this->builder->method('POST')
  81 + ->service('iop.sellerDistribute')
  82 + ->path('/iop/sellerDistribute')
  83 + ->params($params);
  84 + }
  85 +
  86 + /**
  87 + * @inheritDoc
  88 + */
  89 + public function iopSellerOrderList(array $params = [])
  90 + {
  91 + $this->builder->method('POST')
  92 + ->service('iop.sellerOrderList')
  93 + ->path('/iop/sellerOrderList')
  94 + ->params($params);
  95 + }
  96 +
  97 + /**
  98 + * @inheritDoc
  99 + */
  100 + public function iopGetSellerList(array $params = [])
  101 + {
  102 + $this->builder->method('POST')
  103 + ->service('iop.getSellerList')
  104 + ->path('/iop/getSellerList')
  105 + ->params($params);
  106 + }
  107 +
  108 + /**
  109 + * @inheritDoc
  110 + */
  111 + public function iopRoleGet(array $params = [])
  112 + {
  113 + $this->builder->method('POST')
  114 + ->service('iop.roleGet')
  115 + ->path('/iop/roleGet')
  116 + ->params($params);
  117 + }
  118 +
  119 + /**
  120 + * @inheritDoc
  121 + */
  122 + public function iopSellerCancleDistribute(array $params = [])
  123 + {
  124 + $this->builder->method('POST')
  125 + ->service('iop.sellerCancleDistribute')
  126 + ->path('/iop/sellerCancleDistribute')
  127 + ->params($params);
  128 + }
  129 +
  130 + /**
  131 + * @inheritDoc
  132 + */
  133 + public function iopSellerSupplierList(array $params = [])
  134 + {
  135 + $this->builder->method('POST')
  136 + ->service('iop.sellerSupplierList')
  137 + ->path('/iop/sellerSupplierList')
  138 + ->params($params);
  139 + }
  140 +
  141 + /**
  142 + * @inheritDoc
  143 + */
  144 + public function iopSellerOrderInfo(array $params = [])
  145 + {
  146 + $this->builder->method('POST')
  147 + ->service('iop.sellerOrderInfo')
  148 + ->path('/iop/sellerOrderInfo')
  149 + ->params($params);
  150 + }
  151 +}
  1 +<?php
  2 +
  3 +namespace Lackoxygen\TiktokShop\Request\Iop;
  4 +
  5 +use Lackoxygen\TiktokShop\Response\ResultSet;
  6 +
  7 +/**
  8 + * @note 代发API
  9 + */
  10 +interface IopInterface
  11 +{
  12 + /**
  13 + * 【厂商】查询代打订单列表
  14 + * @link https://op.jinritemai.com/docs/api-docs/59/673
  15 + * @param array $params
  16 + * @return ResultSet
  17 + */
  18 + public function iopOrderList(array $params = []);
  19 +
  20 + /**
  21 + * 【厂商】电子面单取号
  22 + * @link https://op.jinritemai.com/docs/api-docs/59/674
  23 + * @param array $params
  24 + * @return ResultSet
  25 + */
  26 + public function iopWaybillGet(array $params = []);
  27 +
  28 + /**
  29 + * 【厂商】取消电子面单
  30 + * @link https://op.jinritemai.com/docs/api-docs/59/675
  31 + * @param array $params
  32 + * @return ResultSet
  33 + */
  34 + public function iopWaybillCancel(array $params = []);
  35 +
  36 + /**
  37 + * 【厂商】代发订单发货接口
  38 + * @link https://op.jinritemai.com/docs/api-docs/59/676
  39 + * @param array $params
  40 + * @return ResultSet
  41 + */
  42 + public function iopWaybillReturn(array $params = []);
  43 +
  44 + /**
  45 + * 【厂商】代发订单更新发货接口
  46 + * @link https://op.jinritemai.com/docs/api-docs/59/677
  47 + * @param array $params
  48 + * @return ResultSet
  49 + */
  50 + public function iopWaybillUpdate(array $params = []);
  51 +
  52 + /**
  53 + * 【厂商】订单详情
  54 + * @link https://op.jinritemai.com/docs/api-docs/59/678
  55 + * @param array $params
  56 + * @return ResultSet
  57 + */
  58 + public function iopOrderInfo(array $params = []);
  59 +
  60 + /**
  61 + * 【商家】分配代发订单
  62 + * @link https://op.jinritemai.com/docs/api-docs/59/958
  63 + * @param array $params
  64 + * @return ResultSet
  65 + */
  66 + public function iopSellerDistribute(array $params = []);
  67 +
  68 + /**
  69 + * 【商家】查看代发订单列表
  70 + * @link https://op.jinritemai.com/docs/api-docs/59/960
  71 + * @param array $params
  72 + * @return ResultSet
  73 + */
  74 + public function iopSellerOrderList(array $params = []);
  75 +
  76 + /**
  77 + * 【厂家】查询商家列表
  78 + * @link https://op.jinritemai.com/docs/api-docs/59/1752
  79 + * @param array $params
  80 + * @return ResultSet
  81 + */
  82 + public function iopGetSellerList(array $params = []);
  83 +
  84 + /**
  85 + * 【厂商】查询店铺身份
  86 + * @link https://op.jinritemai.com/docs/api-docs/59/1874
  87 + * @param array $params
  88 + * @return ResultSet
  89 + */
  90 + public function iopRoleGet(array $params = []);
  91 +
  92 + /**
  93 + * 【商家】取消分配代发订单
  94 + * @link https://op.jinritemai.com/docs/api-docs/59/1876
  95 + * @param array $params
  96 + * @return ResultSet
  97 + */
  98 + public function iopSellerCancleDistribute(array $params = []);
  99 +
  100 + /**
  101 + * 【商家】查询厂商管理列表
  102 + * @link https://op.jinritemai.com/docs/api-docs/59/1799
  103 + * @param array $params
  104 + * @return ResultSet
  105 + */
  106 + public function iopSellerSupplierList(array $params = []);
  107 +
  108 + /**
  109 + * 【商家】查看代发订单详情
  110 + * @link https://op.jinritemai.com/docs/api-docs/59/1875
  111 + * @param array $params
  112 + * @return ResultSet
  113 + */
  114 + public function iopSellerOrderInfo(array $params = []);
  115 +}