作者 竞泽

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

Feat/upgrade



查看合并请求 !8

要显示太多修改。

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

... ... @@ -82,3 +82,9 @@ try {
exit(1)
```
6.生成请求代码
```php
php bin/release.php
```
\ No newline at end of file
... ...
{"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}}
\ No newline at end of file
... ...
#!/bin/env php
<?php
use Illuminate\Support\Enumerable;
$app_path = dirname(__DIR__);
$src_path = $app_path . '/src';
/**
* @param string $message
* @param string $prefix
* @return void
*/
function println(string $message, string $prefix = 'info')
{
\fwrite(
STDOUT,
'[' . date('Y-m-d H:i:s') . ' ' . strtoupper($prefix) . '] ' . $message . PHP_EOL
);
}
/**
* @param string $url
* @param array $query
* @return bool|string
*/
function curl_fetch(string $url, array $query = []): array
{
$ch = \curl_init();
$query && $url .= '?' . http_build_query($query);
\curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
\curl_setopt($ch, CURLOPT_URL, $url);
\curl_setopt($ch, CURLOPT_TIMEOUT, 10);
try {
$body = \curl_exec($ch);
if (is_string($body)) {
return json_decode($body, true);
}
return [];
} finally {
\curl_close($ch);
}
}
/**
* @param array $items
* @param string $subject
* @return string
*/
function replaces(array $items, string $subject): string
{
return str_replace(
array_keys($items),
array_values($items),
$subject
);
}
class Arr
{
/**
* @param array $array
* @param string|null $key
* @param $default
* @return mixed
*/
public static function get(array $array, string $key = null, $default = null)
{
$keys = explode('.', $key);
if (is_null($key)) {
return $array;
}
foreach ($keys as $key) {
if (static::exists($array, $key)) {
$array = $array[$key];
} else {
return $default;
}
}
return $array;
}
/**
* @param $array
* @param $key
* @return bool
*/
public static function exists($array, $key): bool
{
if ($array instanceof Enumerable) {
return $array->has($key);
}
if ($array instanceof ArrayAccess) {
return $array->offsetExists($key);
}
return array_key_exists($key, $array);
}
}
class Cls
{
/**
* @param object $object
* @param string|null $key
* @param $default
* @return mixed|object|null
*/
public static function get(object $object, string $key = null, $default = null)
{
$keys = explode('->', $key);
if (is_null($key)) {
return $object;
}
foreach ($keys as $key) {
if (is_object($object) && static::exists($object, $key)) {
$object = $object->{$key};
} elseif (is_array($object) && Arr::exists($object, $key)) {
$object = Arr::get($object, $key);
} else {
return $default;
}
}
return $object;
}
/**
* @param object $object
* @param $key
* @return bool
*/
public static function exists(object $object, $key): bool
{
if ($object instanceof Enumerable) {
return $object->has($key);
}
if ($object instanceof ArrayAccess) {
return $object->offsetExists($key);
}
return property_exists($object, $key);
}
}
class FetchDoc
{
/**
* fetch top doc menus.
* @return array|null
*/
public function fetchDocMenus(): array
{
return curl_fetch(
'https://op.jinritemai.com/doc/external/open/queryDocDirTree',
['dirId' => 3]
);
}
/**
* fetch in menu api list
* @param int $dirId
* @return array|null
*/
public function fetchDocApis(int $dirId): array
{
return curl_fetch(
'https://op.jinritemai.com/doc/external/open/queryDocArticleList',
[
'dirId' => $dirId,
'orderType' => 3,
'pageIndex' => 0,
'pageSize' => 9999,
'status' => 1
]
);
}
/**
* fetch doc detail
* @param int $articleId
* @return array
*/
public function fetchDocApi(int $articleId): array
{
return curl_fetch(
'https://op.jinritemai.com/doc/external/open/queryDocArticleDetail',
[
'articleId' => $articleId,
'onlyView' => false,
]
);
}
}
class Name
{
/**
* 过滤字符串
* @param string $value
* @return string
*/
public static function filter(string $value): string
{
$charArr = [];
$len = strlen($value);
for ($i = 0; $i < $len; $i++) {
$char = ord($value[$i]);
if (($char >= 48 && $char <= 57)
|| ($char >= 97 && $char <= 122)
|| ($char >= 65 && $char <= 90)
|| $char === 95) {
$charArr[] = $value[$i];
}
}
return join('', $charArr);
}
/**
* @param string $value
* @return string
*/
public static function methodName(string $value): string
{
$value = self::filter($value);
$words = explode(' ', str_replace(['-', '_'], ' ', $value));
$studlyWords = array_map(function ($word) {
return ucfirst($word);
}, $words);
return lcfirst(implode($studlyWords));
}
/**
* @param string $value
* @return string
*/
public static function className(string $value): string
{
return ucfirst(static::methodName($value));
}
}
class Main
{
/**
* @var CodeSpace
*/
protected CodeSpace $codeSpace;
/**
* @var FetchDoc
*/
protected FetchDoc $fetchDoc;
/**
* @return void
*/
public static function run()
{
$static = new static();
$static->do();
}
public function __construct()
{
$this->codeSpace = new CodeSpace();
$this->fetchDoc = new FetchDoc();
}
/**
* main
* @return void
*/
public function do()
{
$menus = $this->fetchDoc->fetchDocMenus();
foreach (Arr::get($menus, 'data.dirs', []) as $item) {
$apis = $this->fetchDoc->fetchDocApis(Arr::get($item, 'id'));
$articles = Arr::get($apis, 'data.articles', []);
$this->codeSpace->push(
$this->createCodeSpace(
$item,
$articles
)
);
}
}
/**
* @param array $section
* @param array $articles
* @return CodeSelf
*/
protected function createCodeSpace(array $section, array $articles): CodeSelf
{
$code = new CodeSelf();
$code->className = Name::className($this->reckonClsName($articles));
$code->annotate = Arr::get($section, 'name', '');
foreach ($articles as $article) {
$apiArticle = $this->fetchDoc->fetchDocApi(
Arr::get($article, 'id')
);
$subSelf = $this->createCodeMethod(
$section,
Arr::get($apiArticle, 'data.article', [])
);
if ($subSelf->service) {
$code->methods[] = $this->createCodeMethod(
$section,
Arr::get($apiArticle, 'data.article', [])
);
}
}
$this->codeSpace->push($code);
return $code;
}
/**
* @param array $section
* @param array $article
* @return CodeSubSelf
*/
protected function createCodeMethod(array $section, array $article): CodeSubSelf
{
$subSelf = new CodeSubSelf();
$content = Arr::get($article, 'content');
if (strpos($content, 'TreeTable') !== false) {
preg_match(
'/"demoValue":"([^"]*)"/',
Arr::get($article, 'content'),
$match
);
$subSelf->service = Arr::get($match, 1);
} elseif (strpos(Arr::get($article, 'content'), '|--|--|') !== false) {
$parts = explode(PHP_EOL, $content);
$flag = false;
$pos = 0;
foreach ($parts as $key => $line) {
if (mb_strpos($line, '公共参数') !== false) {
$pos = $key;
}
if ($pos && $key == $pos + 1) {
$flag = true;
}
if ($flag && '' == $line) {
$flag = false;
}
if ($flag) {
if ($key === $pos + 3) {
$parts = explode('|', trim($line, '|'));
$subSelf->service = trim($parts[3]);
}
}
}
} else {
$content = json_decode(
$content,
true,
512,
JSON_INVALID_UTF8_SUBSTITUTE
);
$subSelf->service = Arr::get($content, 'request.publicParam.0.example');
}
$subSelf->method = 'POST';
$subSelf->path = Arr::get($article, 'info.title');
$subSelf->name = Name::methodName(
str_replace('.', '_', $subSelf->service)
);
$subSelf->docUri = sprintf(
'https://op.jinritemai.com/docs/api-docs/%d/%d',
Arr::get($section, 'id'),
Arr::get($article, 'info.id')
);
$subSelf->annotate = Arr::get($article, 'info.subtitle');
return $subSelf;
}
/**
* @param array $articles
* @return false|int|string
*/
protected function reckonClsName(array $articles): string
{
$titles = array_map(function ($article) {
$title = trim(Arr::get($article, 'title', ''), '/');
$parts = explode('/', $title);
return $parts ? $parts[0] : '';
}, $articles);
$titleCountValues = array_count_values($titles);
arsort($titleCountValues);
return current(array_keys($titleCountValues));
}
/**
* @return string[]
*/
protected function refreshAnnotate(): array
{
$queue = $this->codeSpace->toQueue();
$targets = [];
do {
/**
* @var CodeSelf $code
*/
$code = $queue->pop();
$targets[] = Name::methodName($code->className);
} while (!$queue->isEmpty());
$targets = array_unique($targets);
$metaMethods = array_map(function ($target) {
$name = ucfirst($target);
$interface = sprintf('Request\\%s\\%sInterface', $name, $name);
$method = lcfirst($target);
return ' * @method ' . $interface . ' ' . $method . '()';
}, $targets);
array_unshift($metaMethods, ' * @method Verify verify()');
$metaAnnotate = '/**' . "\n";
$metaAnnotate .= join("\n", $metaMethods) . "\n";
$metaAnnotate .= ' */';
global $src_path;
$metaFile = $src_path . '/Application.php';
require_once $metaFile;
$ref = new ReflectionClass(\Lackoxygen\TiktokShop\Application::class);
$content = file_get_contents($metaFile);
file_put_contents($metaFile, str_replace($ref->getDocComment(), $metaAnnotate, $content));
return $metaMethods;
}
/**
* @param array $metas
* @return void
*/
protected function createFacade(array $metas)
{
$facade = <<<FACADE
<?php
namespace Lackoxygen\TiktokShop\Facade;
use Lackoxygen\TiktokShop\Request;
use Illuminate\Support\Facades\Facade;
use Lackoxygen\TiktokShop\Support\Verify;
use Lackoxygen\TiktokShop\Application;
\${ANNOTATE}
class TiktokShop extends Facade
{
/**
* @return string
*/
protected static function getFacadeAccessor(): string
{
return Application::class;
}
}
FACADE;
$keyword = '@method';
$metas = array_map(function ($meta) use ($keyword) {
$pos = strpos($meta, $keyword);
$left = substr($meta, 0, $pos + strlen($keyword));
$right = substr($meta, $pos + strlen($keyword));
return $left . ' static' . $right;
}, $metas);
array_unshift(
$metas,
' * @method static Application setAccessToken(string $accessToken)',
' * @method static Application use ($options)'
);
$metaAnnotate = '/**' . "\n";
$metaAnnotate .= join("\n", $metas) . "\n";
$metaAnnotate .= ' */';
$facadeContent = replaces(['${ANNOTATE}' => $metaAnnotate], $facade);
global $src_path;
file_put_contents(
$src_path . '/Facade/TiktokShop.php',
$facadeContent
);
}
protected function fixStyle()
{
global $app_path;
$cs = $app_path . '/vendor/bin/php-cs-fixer';
if (!file_exists($cs)) {
return;
}
$directory = $app_path . '/src';
`{$cs} fix --quiet {$directory} --rules=@PSR12 > /dev/null`;
}
public function __destruct()
{
$this->codeSpace->write();
$metas = $this->refreshAnnotate();
$this->createFacade($metas);
$this->fixStyle();
println('success!');
}
}
class CodeSpace
{
protected SplQueue $spaces;
protected CodeWriter $writer;
public function __construct()
{
$this->spaces = new SplQueue();
$this->writer = new CodeWriter();
}
public function push(CodeSelf $codeSelf)
{
$this->spaces->push($codeSelf);
}
public function write()
{
$this->writer->batchWrite($this->toQueue());
}
public function toQueue(): SplQueue
{
return clone $this->spaces;
}
}
class CodeWriter
{
/**
* @param SplQueue $queue
* @return void
*/
public function batchWrite(SplQueue $queue)
{
do {
$code = $queue->pop();
$this->write($code);
} while (!$queue->isEmpty());
}
/**
* @param CodeSelf $codeSelf
* @return void
*/
public function write(CodeSelf $codeSelf)
{
$interface = new CodeGenerateInterface(
clone $codeSelf
);
$class = new CodeGenerateClass(
clone $codeSelf,
$interface->toArray()['name']
);
global $src_path;
$baseDir = $src_path . '/Request';
$directory = $baseDir . '/' . $class->toArray()['name'];
if (!is_dir($directory)) {
@mkdir($directory);
}
file_put_contents(
$directory . '/' . $interface->toArray()['file'],
$interface
);
file_put_contents(
$directory . '/' . $class->toArray()['file'],
$class
);
}
}
class CodeGenerateInterface
{
protected static string $template = <<<temp
<?php
namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note \${ANNOTATE}
*/
interface \${NAME}Interface
{
\${METHOD}
}
temp;
protected string $content = '';
protected CodeSelf $codeSelf;
/**
* @param CodeSelf $codeSelf
*/
public function __construct(CodeSelf $codeSelf)
{
$methods = [];
/**
* @var CodeSubSelf $method
*/
foreach ($codeSelf->methods as $method) {
$methods[] = $this->generateMethod($method);
}
$this->content = replaces(
[
'${SECTION}' => $codeSelf->className,
'${ANNOTATE}' => $codeSelf->annotate,
'${NAME}' => $codeSelf->className,
'${METHOD}' => join(
PHP_EOL . PHP_EOL,
array_map(function ($method) {
return join(PHP_EOL, $method);
}, $methods)
)
],
static::$template
);
$this->codeSelf = $codeSelf;
}
/**
* @param CodeSubSelf $subSelf
* @return array
*/
protected function generateMethod(CodeSubSelf $subSelf): array
{
$template[] = "\t" . '/**';
$template[] = "\t" . ' * ' . $subSelf->annotate;
$template[] = "\t" . ' * @link ' . $subSelf->docUri;
$template[] = "\t" . ' * @param array $params';
$template[] = "\t" . ' * @return ResultSet';
$template[] = "\t" . ' */';
$template[] = "\t" . 'function ' . $subSelf->name . '(array $params = []);';
return $template;
}
/**
* @return string
*/
public function __toString(): string
{
return $this->content;
}
/**
* @return array
*/
public function toArray(): array
{
$name = $this->codeSelf->className . 'Interface';
return [
'name' => $name,
'file' => $name . '.php',
'content' => $this->content,
];
}
}
class CodeGenerateClass
{
protected static string $template = <<<temp
<?php
namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
use Lackoxygen\TiktokShop\Request\Request;
class \${NAME} extends Request implements \${INTERFACE}
{
\${METHOD}
}
temp;
protected string $content = '';
protected CodeSelf $codeSelf;
protected string $interface = '';
public function __construct(CodeSelf $codeSelf, string $interface)
{
$this->codeSelf = $codeSelf;
$this->interface = $interface;
$methods = [];
/**
* @var CodeSubSelf $method
*/
foreach ($codeSelf->methods as $method) {
$methods[] = $this->generateMethod($method);
}
$this->content = replaces(
[
'${SECTION}' => $codeSelf->className,
'${ANNOTATE}' => $codeSelf->annotate,
'${INTERFACE}' => $this->interface,
'${NAME}' => $codeSelf->className,
'${METHOD}' => join(
PHP_EOL . PHP_EOL,
array_map(function ($method) {
return join(PHP_EOL, $method);
}, $methods)
)
],
static::$template
);
}
/**
* @param CodeSubSelf $subSelf
* @return array
*/
protected function generateMethod(CodeSubSelf $subSelf): array
{
$template[] = "\t" . '/**';
$template[] = "\t" . ' * @inheritDoc';
$template[] = "\t" . ' */';
$template[] = "\t" . 'function ' . $subSelf->name . '(array $params = [])';
$template[] = "\t" . '{';
$template[] = "\t\t" . '$this->builder->method(\'' . $subSelf->method . '\')';
$template[] = "\t\t\t" . '->service(\'' . $subSelf->service . '\')';
$template[] = "\t\t\t" . '->path(\'' . $subSelf->path . '\')';
$template[] = "\t\t\t" . '->params($params);';
$template[] = "\t" . '}';
return $template;
}
/**
* @return string
*/
public function __toString(): string
{
return $this->content;
}
/**
* @return array
*/
public function toArray(): array
{
return [
'name' => $this->codeSelf->className,
'file' => $this->codeSelf->className . '.php',
'content' => $this->content,
];
}
}
class CodeSelf
{
/**
* @var string
*/
public string $className = '';
/**
* @var string
*/
public string $annotate = '';
/**
* @var array [] $methods
*/
public array $methods = [];
}
class CodeSubSelf
{
/**
* @var string
*/
public string $docUri = '';
/**
* @var string
*/
public string $name = '';
/**
* @var string
*/
public string $method = '';
/**
* @var string
*/
public string $service = '';
/**
* @var string
*/
public string $path = '';
/**
* @var string
*/
public string $annotate = '';
}
Main::run();
... ...
... ... @@ -3,43 +3,49 @@
namespace Lackoxygen\TiktokShop;
use Illuminate\Support\Arr;
use Lackoxygen\TiktokShop\Attribute\Config;
use Lackoxygen\TiktokShop\Passage\Alliance\Alliance;
use Lackoxygen\TiktokShop\Passage\Authorize;
use Lackoxygen\TiktokShop\Passage\Order\OrderInterface;
use Lackoxygen\TiktokShop\Passage\PassageProxy;
use Lackoxygen\TiktokShop\Passage\Product\ProductInterface;
use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface;
use Lackoxygen\TiktokShop\Passage\Verify;
use Lackoxygen\TiktokShop\Passage\Logistics\Logistics;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Request\RequestProxy;
use Lackoxygen\TiktokShop\Support\Verify;
/**
* @method OrderInterface order()
* @method ShopInterface shop()
* @method ProductInterface product()
* @method Authorize authorize()
* @method Verify verify()
* @method Alliance alliance()
* @method Logistics logistics()
* @method Request\Pigeon\PigeonInterface pigeon()
* @method Request\Sms\SmsInterface sms()
* @method Request\SupplyChain\SupplyChainInterface supplyChain()
* @method Request\Topup\TopupInterface topup()
* @method Request\OpenCloud\OpenCloudInterface openCloud()
* @method Request\Btas\BtasInterface btas()
* @method Request\Recycle\RecycleInterface recycle()
* @method Request\Member\MemberInterface member()
* @method Request\Buyin\BuyinInterface buyin()
* @method Request\Yunc\YuncInterface yunc()
* @method Request\OrderCode\OrderCodeInterface orderCode()
* @method Request\Coupons\CouponsInterface coupons()
* @method Request\Crossborder\CrossborderInterface crossborder()
* @method Request\Iop\IopInterface iop()
* @method Request\Antispam\AntispamInterface antispam()
* @method Request\Token\TokenInterface token()
* @method Request\Order\OrderInterface order()
* @method Request\AfterSale\AfterSaleInterface afterSale()
* @method Request\Logistics\LogisticsInterface logistics()
* @method Request\Warehouse\WarehouseInterface warehouse()
* @method Request\Product\ProductInterface product()
* @method Request\Material\MaterialInterface material()
* @method Request\Address\AddressInterface address()
*/
class TiktokShop
class Application
{
/**
* @var Config
* @var Option
*/
protected Config $config;
protected Option $config;
/**
* @var array|string[]
*/
protected static array $passages = [
'order' => Passage\Order\Order::class,
'shop' => Passage\Shop\Shop::class,
'product' => Passage\Product\Product::class,
'authorize' => Authorize::class,
'verify' => Verify::class,
'alliance' => Alliance::class,
'logistics' => Passage\Logistics\Logistics::class
protected array $fixedPriority = [
'verify' => Verify::class
];
/**
... ... @@ -55,7 +61,7 @@ class TiktokShop
$app = $options ?: 'default';
$config = \config(TiktokShopProvider::$name . '.' . $app);
$config = \config(ServiceProvider::$name . '.' . $app);
if (!is_array($config)) {
throw new \InvalidArgumentException('config file not found');
... ... @@ -71,11 +77,11 @@ class TiktokShop
/**
* @param array $options
*
* @return Config
* @return Option
*/
public static function newConfig(array $options): Config
public static function newConfig(array $options): Option
{
return new Config(
return new Option(
Arr::get($options, 'app_key'),
Arr::get($options, 'app_secret'),
Arr::get($options, 'base_uri'),
... ... @@ -87,9 +93,9 @@ class TiktokShop
/**
* @param $options
*
* @return TiktokShop
* @return Application
*/
public static function use($options = null): TiktokShop
public static function use($options = null): Application
{
return new static($options);
}
... ... @@ -97,9 +103,9 @@ class TiktokShop
/**
* @param string $accessToken
*
* @return $this
* @return Application
*/
public function setAccessToken(string $accessToken): TiktokShop
public function setAccessToken(string $accessToken): Application
{
$this->config->setAccessToken($accessToken);
... ... @@ -107,21 +113,44 @@ class TiktokShop
}
/**
* @param string $name
* @return RequestProxy|object
*/
private function guide(string $name)
{
if (array_key_exists($name, $this->fixedPriority)) {
return new $this->fixedPriority[$name]($this->config);
}
$name = ucfirst($name);
$request = '\Lackoxygen\TiktokShop\Request\\' . $name . '\\' . $name;
if (!class_exists($request)) {
throw new \OverflowException('class file(' . $request . ') not found');
}
return RequestProxy::proxy($request, $this->config);
}
/**
* @param $name
* @param array $arguments
*
* @return PassageProxy
* @return RequestProxy
*/
public function __call($name, array $arguments = [])
{
$passage = static::$passages[$name];
$guide = $this->guide($name);
try {
return PassageProxy::proxy($passage, $this->config);
return $guide;
} finally {
register_shutdown_function(function () {
$this->config->setAccessToken('');
});
if ($guide instanceof RequestProxy) {
register_shutdown_function(function () {
$this->config->setAccessToken('');
});
}
}
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Attribute\Config;
class Config
{
/**
* @var Option
*/
protected Option $config;
/**
* @param Option $option
*/
public function __construct(Option $option)
{
$this->config = $option;
}
/**
* @return Option
*/
public function getConfig(): Option
{
return clone $this->config;
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Attribute;
namespace Lackoxygen\TiktokShop\Attribute\Config;
class Config
class Option
{
private string $appKey = '';
/**
* @var string
*/
private string $appKey;
private string $appSecret = '';
/**
* @var string
*/
private string $appSecret;
private bool $enableMock = false;
/**
* @var bool
*/
private bool $enableMock;
private string $baseUri = '';
/**
* @var string
*/
private string $baseUri;
/**
* @var string
*/
private string $accessToken = '';
/**
* @var float
*/
private float $timeout;
/**
* @param string $appKey
* @param string $appSecret
* @param string $baseUri
* @param float $timeout
* @param bool $enableMock
*/
public function __construct(
string $appKey = '',
string $appSecret = '',
string $baseUri = '',
float $timeout = 30.0,
bool $enableMock = false
float $timeout = 30.0,
bool $enableMock = false
) {
$this->appKey = $appKey;
$this->appSecret = $appSecret;
... ...
... ... @@ -2,39 +2,44 @@
namespace Lackoxygen\TiktokShop\Attribute;
class Request
use Lackoxygen\TiktokShop\Attribute\Config\Config;
class Request extends Config
{
/**
* @var string
*/
private string $service = '';
/**
* @var string
*/
private string $timestamp = '';
/**
* @var string
*/
private string $v = '2';
/**
* @var string
*/
private string $method = 'GET';
/**
* @var array
*/
private array $params = [];
protected string $path = '';
private bool $signature = true;
private Config $config;
/**
* @param mixed $config
* @var string
*/
public function setConfig(Config $config): void
{
$this->config = $config;
}
protected string $path = '';
/**
* @return mixed
* @var bool
*/
public function getConfig(): Config
{
return $this->config;
}
private bool $signature = true;
/**
* @return string
... ...
<?php
namespace Lackoxygen\TiktokShop\Command;
use Lackoxygen\TiktokShop\Supervisor\Session\SessionHeart;
use Illuminate\Console\Command;
class RefreshToken extends Command
{
/**
* The name and signature of the console command.
*
* @var string
*/
protected $signature = 'tiktok-shop:refresh.token';
/**
* The console command description.
*
* @var string
*/
protected $description = 'The refresh tiktok shop token';
/**
* Create a new command instance.
*
* @return void
*/
public function __construct()
{
parent::__construct();
}
/**
* Execute the console command.
*
* @return int
*/
public function handle()
{
SessionHeart::new()->keepalive();
return 0;
}
}
<?php
namespace Lackoxygen\TiktokShop\Contracts;
interface SessionInterface
{
public function id(): string;
public function unEffective(): bool;
public function effective(): bool;
public function discard();
public function watch(): bool;
public function appKey(): string;
}
... ... @@ -2,25 +2,40 @@
namespace Lackoxygen\TiktokShop\Facade;
use Lackoxygen\TiktokShop\Request;
use Illuminate\Support\Facades\Facade;
use Lackoxygen\TiktokShop\Passage\Alliance\Alliance;
use Lackoxygen\TiktokShop\Passage\Authorize;
use Lackoxygen\TiktokShop\Passage\Order\OrderInterface;
use Lackoxygen\TiktokShop\Passage\Product\ProductInterface;
use Lackoxygen\TiktokShop\Passage\Shop\ShopInterface;
use Lackoxygen\TiktokShop\Passage\Verify;
use Lackoxygen\TiktokShop\TiktokShop as TiktokShopKernel;
use Lackoxygen\TiktokShop\Support\Verify;
use Lackoxygen\TiktokShop\Application;
/**
* @method static OrderInterface order()
* @method static ShopInterface shop()
* @method static ProductInterface product()
* @method static Authorize authorize()
* @method static Application setAccessToken(string $accessToken)
* @method static Application use ($options)
* @method static Verify verify()
* @method static Alliance alliance()
* @method static TiktokShopKernel setAccessToken(string $accessToken)
* @method static TiktokShopKernel use ($options)
* @method static Request\Pigeon\PigeonInterface pigeon()
* @method static Request\Sms\SmsInterface sms()
* @method static Request\SupplyChain\SupplyChainInterface supplyChain()
* @method static Request\Topup\TopupInterface topup()
* @method static Request\OpenCloud\OpenCloudInterface openCloud()
* @method static Request\Btas\BtasInterface btas()
* @method static Request\Recycle\RecycleInterface recycle()
* @method static Request\Member\MemberInterface member()
* @method static Request\Buyin\BuyinInterface buyin()
* @method static Request\Yunc\YuncInterface yunc()
* @method static Request\OrderCode\OrderCodeInterface orderCode()
* @method static Request\Coupons\CouponsInterface coupons()
* @method static Request\Crossborder\CrossborderInterface crossborder()
* @method static Request\Iop\IopInterface iop()
* @method static Request\Antispam\AntispamInterface antispam()
* @method static Request\Token\TokenInterface token()
* @method static Request\Order\OrderInterface order()
* @method static Request\AfterSale\AfterSaleInterface afterSale()
* @method static Request\Logistics\LogisticsInterface logistics()
* @method static Request\Warehouse\WarehouseInterface warehouse()
* @method static Request\Product\ProductInterface product()
* @method static Request\Material\MaterialInterface material()
* @method static Request\Address\AddressInterface address()
*/
class TiktokShop extends Facade
{
/**
... ... @@ -28,6 +43,6 @@ class TiktokShop extends Facade
*/
protected static function getFacadeAccessor(): string
{
return TiktokShopKernel::class;
return Application::class;
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Alliance;
use Lackoxygen\TiktokShop\Passage\Passage;
class Alliance extends Passage implements AllianceInterface
{
/**
* @inheritDoc
*/
public function simplePlan(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/simplePlan')
->service('buyin.simplePlan');
}
/**
* @inheritDoc
*/
public function exclusivePlan(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/exclusivePlan')
->service('buyin.exclusivePlan');
}
/**
* @inheritDoc
*/
public function activitySearch(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/activitySearch')
->service('buyin.activitySearch');
}
/**
* @inheritDoc
*/
public function applyActivities(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/applyActivities')
->service('buyin.applyActivities');
}
/**
* @inheritDoc
*/
public function createOrUpdateOrienPlan(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/createOrUpdateOrienPlan')
->service('buyin.createOrUpdateOrienPlan');
}
/**
* @inheritDoc
*/
public function orienPlanList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/orienPlanList')
->service('buyin.orienPlanList');
}
/**
* @inheritDoc
*/
public function orienPlanAuthors(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/orienPlanAuthors')
->service('buyin.orienPlanAuthors');
}
/**
* @inheritDoc
*/
public function orienPlanCtrl(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/orienPlanCtrl')
->service('buyin.orienPlanCtrl');
}
/**
* @inheritDoc
*/
public function orienPlanAuthorsAdd(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/orienPlanAuthorsAdd')
->service('buyin.orienPlanAuthorsAdd');
}
/**
* @inheritDoc
*/
public function orienPlanAudit(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/orienPlanAudit')
->service('buyin.orienPlanAudit');
}
/**
* @inheritDoc
*/
public function colonelActivityCreateOrUpdate(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/colonelActivityCreateOrUpdate')
->service('alliance.colonelActivityCreateOrUpdate');
}
/**
* @inheritDoc
*/
public function activityProductCategoryList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/activityProductCategoryList')
->service('alliance.activityProductCategoryList');
}
/**
* @inheritDoc
*/
public function instituteColonelActivityList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/instituteColonelActivityList')
->service('alliance.instituteColonelActivityList');
}
/**
* @inheritDoc
*/
public function instituteColonelActivityOperate(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/instituteColonelActivityOperate')
->service('alliance.instituteColonelActivityOperate');
}
/**
* @inheritDoc
*/
public function colonelActivityProduct(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/colonelActivityProduct')
->service('alliance.colonelActivityProduct');
}
/**
* @inheritDoc
*/
public function colonelActivityProductAudit(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/colonelActivityProductAudit')
->service('alliance.colonelActivityProductAudit');
}
/**
* @inheritDoc
*/
public function colonelActivityProductExtension(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/colonelActivityProductExtension')
->service('alliance.colonelActivityProductExtension');
}
/**
* @inheritDoc
*/
public function specialApplyList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin.colonel/specialApplyList')
->service('buyin.colonel.specialApplyList');
}
/**
* @inheritDoc
*/
public function specialApplyDeal(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin.colonel/specialApplyDeal')
->service('buyin.colonel.specialApplyDeal');
}
/**
* @inheritDoc
*/
public function materialsProductsSearch(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/materialsProductsSearch')
->service('alliance.materialsProductsSearch');
}
/**
* @inheritDoc
*/
public function materialsProductsDetails(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/materialsProductsDetails')
->service('alliance.materialsProductsDetails');
}
/**
* @inheritDoc
*/
public function materialsProductCategory(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('alliance/materialsProductCategory')
->service('alliance.materialsProductCategory');
}
/**
* @inheritDoc
*/
public function materialsProductStatus(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/materialsProductStatus')
->service('buyin.materialsProductStatus');
}
/**
* @inheritDoc
*/
public function queryInstituteOrders(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/queryInstituteOrders')
->service('buyin.queryInstituteOrders');
}
/**
* @inheritDoc
*/
public function kolPidCreate(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolPidCreate')
->service('buyin.kolPidCreate');
}
/**
* @inheritDoc
*/
public function kolPidList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolPidList')
->service('buyin.kolPidList');
}
/**
* @inheritDoc
*/
public function kolPidEdit(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolPidEdit')
->service('buyin.kolPidEdit');
}
/**
* @inheritDoc
*/
public function kolPidDel(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolPidDel')
->service('buyin.kolPidDel');
}
/**
* @inheritDoc
*/
public function kolProductShare(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolProductShare')
->service('buyin.kolProductShare');
}
/**
* @inheritDoc
*/
public function institutePidCreate(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/institutePidCreate')
->service('buyin.institutePidCreate');
}
/**
* @inheritDoc
*/
public function institutePidList(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/institutePidList')
->service('buyin.institutePidList');
}
/**
* @inheritDoc
*/
public function institutePidEdit(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/institutePidEdit')
->service('buyin.institutePidEdit');
}
/**
* @inheritDoc
*/
public function institutePidDel(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/institutePidDel')
->service('buyin.institutePidDel');
}
/**
* @inheritDoc
*/
public function liveShareMaterial(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/liveShareMaterial')
->service('buyin.liveShareMaterial');
}
/**
* @inheritDoc
*/
public function instituteLiveShare(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/instituteLiveShare')
->service('buyin.instituteLiveShare');
}
/**
* @inheritDoc
*/
public function instituteOrderAds(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/instituteOrderAds')
->service('buyin.instituteOrderAds');
}
/**
* @inheritDoc
*/
public function kolOrderAds(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolOrderAds')
->service('buyin.kolOrderAds');
}
/**
* @inheritDoc
*/
public function shopPidMemberCreate(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/shopPidMemberCreate')
->service('buyin.shopPidMemberCreate');
}
/**
* @inheritDoc
*/
public function kolMaterialsProductsDetails(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/kolMaterialsProductsDetails')
->service('buyin.kolMaterialsProductsDetails');
}
/**
* @inheritDoc
*/
public function getProductShareMaterial(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/getProductShareMaterial')
->service('buyin.getProductShareMaterial');
}
/**
* @inheritDoc
*/
public function getProductSkus(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/productSkus')
->service('buyin.productSkus');
}
/**
* @inheritDoc
*/
public function shareCommandParse(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/shareCommandParse')
->service('buyin.shareCommandParse');
}
/**
* @inheritDoc
*/
public function activityShareConvert(array $params)
{
$this->builder
->method('POST')
->params($params)
->path('buyin/activityShareConvert')
->service('buyin.activityShareConvert');
}
}
<?php
namespace Lackoxygen\TiktokShop\Passage;
use Illuminate\Support\Arr;
class Authorize extends Passage
{
/**
* @param string $code
* @param string $grantType {authorization_self, authorization_code}
* @param bool $sandbox
* @return ResultSet
*/
public function token(string $code, string $grantType = 'authorization_code', bool $sandbox = false)
{
$params = ['code' => $code, 'grant_type' => $grantType];
if ($sandbox) {
if ($grantType === 'authorization_self') {
if ($code == '4463798') {
Arr::set($params, 'test_shop', 1);
} else {
Arr::set($params, 'shop_id', $code);
}
}
}
$this->builder->service('token.create');
$this->builder
->method('GET')
->path('/token/create')
->service('token.create')
->params($params);
}
/**
* @param string $refreshToken
* @param string $grantType
* @return ResultSet
*/
public function refresh(string $refreshToken, string $grantType = 'refresh_token')
{
$this->builder
->method('POST')
->service('token.refresh')
->params(['refresh_token' => $refreshToken, 'grant_type' => $grantType]);
}
}
<?php
namespace Lackoxygen\TiktokShop\Passage\Logistics;
use Lackoxygen\TiktokShop\Passage\ResultSet;
interface LogisticsInterface
{
/**
* @link https://op.jinritemai.com/docs/api-docs/16/1075
* @return mixed
*/
public function appendSubOrder(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/541
* @return mixed
*/
public function logisticsCompanyList(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/718
* @return mixed
*/
public function add(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/390
* @return mixed
*/
public function edit(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/539
* @return mixed
*/
public function logisticsEditByPack(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/562
* @return mixed
*/
public function logisticsAddMultiPack(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/565
* @return mixed
*/
public function freightTemplateList(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/563
* @return mixed
*/
public function logisticsAddSinglePack(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/494
* @return mixed
*/
public function updateOrder(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/397
* @return mixed
*/
public function cancelOrder(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/526
* @return mixed
*/
public function orderOperate(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/527
* @return mixed
*/
public function orderCustomClearance(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/528
* @return mixed
*/
public function orderLogisticsTrace(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/549
* @return mixed
*/
public function customTemplateList(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/582
* @return mixed
*/
public function getOutRange(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/476
* @return mixed
*/
public function templateList(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/490
* @return mixed
*/
public function waybillApply(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/1578
* @return mixed
*/
public function deliveryNotice(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/16/1558
* @return mixed
*/
public function isByteDancePackage(array $params);
}
<?php
namespace Lackoxygen\TiktokShop\Passage;
use Lackoxygen\TiktokShop\Attribute\Config;
use Lackoxygen\TiktokShop\Exception\ClientException;
class PassageProxy
{
protected string $passage;
protected Config $config;
protected function __construct(string $passage, Config $config)
{
$this->passage = $passage;
$this->config = $config;
}
public static function proxy(string $passage, Config $config): PassageProxy
{
return new self($passage, $config);
}
/**
* @throws ClientException
*/
public function __call($name, $arguments): ResultSet
{
/**
* @var Passage $passage
*/
$passage = new $this->passage($this->config, $name);
$result = call_user_func_array([$passage, $name], $arguments);
if (!is_null($result)) {
return new ResultSet($result);
}
return new ResultSet($passage());
}
}
<?php
namespace Lackoxygen\TiktokShop\Passage\Shop;
use Lackoxygen\TiktokShop\Passage\Passage;
class Shop extends Passage implements ShopInterface
{
/**
* @inheritDoc
*/
public function brandList(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('shop.brandList');
}
/**
* @inheritDoc
*/
public function searchMemberList(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('member.searchList');
}
/**
* @inheritDoc
*/
public function userLogin(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('antispam.userLogin');
}
/**
* @inheritDoc
*/
public function getShopCategory(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('shop.getShopCategory');
}
/**
* @inheritDoc
*/
public function addressUpdate(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('address.update');
}
/**
* @inheritDoc
*/
public function addressCreate(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('address.create');
}
/**
* @inheritDoc
*/
public function getShopShortLink(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('member.getShopShortLink');
}
/**
* @inheritDoc
*/
public function addressList(array $params)
{
$this->builder
->method('POST')
->params($params)
->service('address.list');
}
}
<?php
namespace Lackoxygen\TiktokShop\Request\Address;
use Lackoxygen\TiktokShop\Request\Request;
class Address extends Request implements AddressInterface
{
/**
* @inheritDoc
*/
public function qualificationSettle(array $params = [])
{
$this->builder->method('POST')
->service('qualification.settle')
->path('/qualification/settle')
->params($params);
}
/**
* @inheritDoc
*/
public function addressUpdate(array $params = [])
{
$this->builder->method('POST')
->service('address.update')
->path('/address/update')
->params($params);
}
/**
* @inheritDoc
*/
public function addressCreate(array $params = [])
{
$this->builder->method('POST')
->service('address.create')
->path('/address/create')
->params($params);
}
/**
* @inheritDoc
*/
public function memberGetShopShortLink(array $params = [])
{
$this->builder->method('POST')
->service('member.getShopShortLink')
->path('/member/getShopShortLink')
->params($params);
}
/**
* @inheritDoc
*/
public function addressList(array $params = [])
{
$this->builder->method('POST')
->service('address.list')
->path('/address/list')
->params($params);
}
/**
* @inheritDoc
*/
public function shopGetShopCategory(array $params = [])
{
$this->builder->method('POST')
->service('shop.getShopCategory')
->path('/shop/getShopCategory')
->params($params);
}
/**
* @inheritDoc
*/
public function shopBrandList(array $params = [])
{
$this->builder->method('POST')
->service('shop.brandList')
->path('/shop/brandList')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Shop;
namespace Lackoxygen\TiktokShop\Request\Address;
use Lackoxygen\TiktokShop\Passage\ResultSet;
use Lackoxygen\TiktokShop\Response\ResultSet;
interface ShopInterface
/**
* @note 店铺API
*/
interface AddressInterface
{
/**
* @link https://op.jinritemai.com/docs/api-docs/13/54
* 商家入驻提交资料
* @link https://op.jinritemai.com/docs/api-docs/13/658
* @param array $params
* @return ResultSet
*/
public function brandList(array $params);
public function qualificationSettle(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/366
* @param array $params
* @return ResultSet
*/
public function searchMemberList(array $params);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/635
* 店铺修改售后地址接口
* @link https://op.jinritemai.com/docs/api-docs/13/1511
* @param array $params
* @return ResultSet
*/
public function userLogin(array $params);
public function addressUpdate(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/821
* 创建店铺地址库
* @link https://op.jinritemai.com/docs/api-docs/13/1510
* @param array $params
* @return ResultSet
*/
public function getShopCategory(array $params);
public function addressCreate(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/1511
* 获取商家推广链接接口
* @link https://op.jinritemai.com/docs/api-docs/13/1455
* @param array $params
* @return ResultSet
*/
public function addressUpdate(array $params);
public function memberGetShopShortLink(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/1510
* 售后地址列表接口
* @link https://op.jinritemai.com/docs/api-docs/13/1435
* @param array $params
* @return ResultSet
*/
public function addressCreate(array $params);
public function addressList(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/1455
* 获取店铺后台供商家发布商品的类目
* @link https://op.jinritemai.com/docs/api-docs/13/1820
* @param array $params
* @return ResultSet
*/
public function getShopShortLink(array $params);
public function shopGetShopCategory(array $params = []);
/**
* @link https://op.jinritemai.com/docs/api-docs/13/1435
* 获取店铺的已授权品牌列表
* @link https://op.jinritemai.com/docs/api-docs/13/1821
* @param array $params
* @return ResultSet
*/
public function addressList(array $params);
public function shopBrandList(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\AfterSale;
use Lackoxygen\TiktokShop\Request\Request;
class AfterSale extends Request implements AfterSaleInterface
{
/**
* @inheritDoc
*/
public function afterSaleOperate(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.operate')
->path('/afterSale/operate')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleDetail(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.Detail')
->path('/afterSale/Detail')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleList(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.List')
->path('/afterSale/List')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleAddOrderRemark(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.addOrderRemark')
->path('/afterSale/addOrderRemark')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleOpenAfterSaleChannel(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.OpenAfterSaleChannel')
->path('/afterSale/OpenAfterSaleChannel')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleBuyerExchangeConfirm(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.buyerExchangeConfirm')
->path('/afterSale/buyerExchangeConfirm')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleApplyLogisticsIntercept(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.applyLogisticsIntercept')
->path('/afterSale/applyLogisticsIntercept')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleCancelSendGoodsSuccess(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.CancelSendGoodsSuccess')
->path('/afterSale/CancelSendGoodsSuccess')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleReturnGoodsToWareHouseSuccess(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.returnGoodsToWareHouseSuccess')
->path('/afterSale/returnGoodsToWareHouseSuccess')
->params($params);
}
/**
* @inheritDoc
*/
public function tradeRefundListSearch(array $params = [])
{
$this->builder->method('POST')
->service('trade.refundListSearch')
->path('/trade/refundListSearch')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleTimeExtend(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.timeExtend')
->path('/afterSale/timeExtend')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleBuyerExchange(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.buyerExchange')
->path('/afterSale/buyerExchange')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleRejectReasonCodeList(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.rejectReasonCodeList')
->path('/afterSale/rejectReasonCodeList')
->params($params);
}
/**
* @inheritDoc
*/
public function afterSaleFillLogistics(array $params = [])
{
$this->builder->method('POST')
->service('afterSale.fillLogistics')
->path('/afterSale/fillLogistics')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\AfterSale;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 售后退款API
*/
interface AfterSaleInterface
{
/**
* 售后审核接口聚合版
* @link https://op.jinritemai.com/docs/api-docs/17/560
* @param array $params
* @return ResultSet
*/
public function afterSaleOperate(array $params = []);
/**
* 提供给商家获取售后单详情信息
* @link https://op.jinritemai.com/docs/api-docs/17/1095
* @param array $params
* @return ResultSet
*/
public function afterSaleDetail(array $params = []);
/**
* 售后列表接口
* @link https://op.jinritemai.com/docs/api-docs/17/1295
* @param array $params
* @return ResultSet
*/
public function afterSaleList(array $params = []);
/**
* 店家给售后单添加备注
* @link https://op.jinritemai.com/docs/api-docs/17/585
* @param array $params
* @return ResultSet
*/
public function afterSaleAddOrderRemark(array $params = []);
/**
* 打开售后通道,使用户可以发起超级售后
* @link https://op.jinritemai.com/docs/api-docs/17/764
* @param array $params
* @return ResultSet
*/
public function afterSaleOpenAfterSaleChannel(array $params = []);
/**
* 商家确认是否收到换货
* @link https://op.jinritemai.com/docs/api-docs/17/768
* @param array $params
* @return ResultSet
*/
public function afterSaleBuyerExchangeConfirm(array $params = []);
/**
* 申请物流拦截
* @link https://op.jinritemai.com/docs/api-docs/17/897
* @param array $params
* @return ResultSet
*/
public function afterSaleApplyLogisticsIntercept(array $params = []);
/**
* 商家在未发货仅退款途中发送取消发货的状态
* @link https://op.jinritemai.com/docs/api-docs/17/816
* @param array $params
* @return ResultSet
*/
public function afterSaleCancelSendGoodsSuccess(array $params = []);
/**
* 商家确认售后单对应的用户退货入仓成功
* @link https://op.jinritemai.com/docs/api-docs/17/815
* @param array $params
* @return ResultSet
*/
public function afterSaleReturnGoodsToWareHouseSuccess(array $params = []);
/**
* 售后单列表查询推荐使用/afterSale/List
* @link https://op.jinritemai.com/docs/api-docs/17/254
* @param array $params
* @return ResultSet
*/
public function tradeRefundListSearch(array $params = []);
/**
* 商家延时收获接口
* @link https://op.jinritemai.com/docs/api-docs/17/770
* @param array $params
* @return ResultSet
*/
public function afterSaleTimeExtend(array $params = []);
/**
* 商家处理换货请求接口
* @link https://op.jinritemai.com/docs/api-docs/17/769
* @param array $params
* @return ResultSet
*/
public function afterSaleBuyerExchange(array $params = []);
/**
* 售后审核处理原因列表查询接口
* @link https://op.jinritemai.com/docs/api-docs/17/1540
* @param array $params
* @return ResultSet
*/
public function afterSaleRejectReasonCodeList(array $params = []);
/**
* 售后商家发货
* @link https://op.jinritemai.com/docs/api-docs/17/1908
* @param array $params
* @return ResultSet
*/
public function afterSaleFillLogistics(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Antispam;
use Lackoxygen\TiktokShop\Request\Request;
class Antispam extends Request implements AntispamInterface
{
/**
* @inheritDoc
*/
public function antispamUserLogin(array $params = [])
{
$this->builder->method('POST')
->service('antispam.userLogin')
->path('/antispam/userLogin')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Antispam;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 风控安全API
*/
interface AntispamInterface
{
/**
* 商户登陆风险检查
* @link https://op.jinritemai.com/docs/api-docs/187/635
* @param array $params
* @return ResultSet
*/
public function antispamUserLogin(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Btas;
use Lackoxygen\TiktokShop\Request\Request;
class Btas extends Request implements BtasInterface
{
/**
* @inheritDoc
*/
public function btasShipping(array $params = [])
{
$this->builder->method('POST')
->service('btas.shipping')
->path('/btas/shipping')
->params($params);
}
/**
* @inheritDoc
*/
public function btasGetInspectionOrder(array $params = [])
{
$this->builder->method('POST')
->service('btas.getInspectionOrder')
->path('/btas/getInspectionOrder')
->params($params);
}
/**
* @inheritDoc
*/
public function btasSaveInspectionOnline(array $params = [])
{
$this->builder->method('POST')
->service('btas.saveInspectionOnline')
->path('/btas/saveInspectionOnline')
->params($params);
}
/**
* @inheritDoc
*/
public function btasGetOrderInspectionResult(array $params = [])
{
$this->builder->method('POST')
->service('btas.getOrderInspectionResult')
->path('/btas/getOrderInspectionResult')
->params($params);
}
/**
* @inheritDoc
*/
public function btasSaveInspectionInfo(array $params = [])
{
$this->builder->method('POST')
->service('btas.saveInspectionInfo')
->path('/btas/saveInspectionInfo')
->params($params);
}
/**
* @inheritDoc
*/
public function btasListBrand(array $params = [])
{
$this->builder->method('POST')
->service('btas.listBrand')
->path('/btas/listBrand')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Btas;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note BTAS质检API
*/
interface BtasInterface
{
/**
* 商家调用发货
* @link https://op.jinritemai.com/docs/api-docs/49/489
* @param array $params
* @return ResultSet
*/
public function btasShipping(array $params = []);
/**
* ⁣查询订单是否需要质检
* @link https://op.jinritemai.com/docs/api-docs/49/473
* @param array $params
* @return ResultSet
*/
public function btasGetInspectionOrder(array $params = []);
/**
* 图片质检送检
* @link https://op.jinritemai.com/docs/api-docs/49/572
* @param array $params
* @return ResultSet
*/
public function btasSaveInspectionOnline(array $params = []);
/**
* 获取订单的质检结果
* @link https://op.jinritemai.com/docs/api-docs/49/573
* @param array $params
* @return ResultSet
*/
public function btasGetOrderInspectionResult(array $params = []);
/**
* 商家送检调用
* @link https://op.jinritemai.com/docs/api-docs/49/574
* @param array $params
* @return ResultSet
*/
public function btasSaveInspectionInfo(array $params = []);
/**
* 获取可图片鉴定的品牌
* @link https://op.jinritemai.com/docs/api-docs/49/1865
* @param array $params
* @return ResultSet
*/
public function btasListBrand(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Buyin;
use Lackoxygen\TiktokShop\Request\Request;
class Buyin extends Request implements BuyinInterface
{
/**
* @inheritDoc
*/
public function buyinSimplePlan(array $params = [])
{
$this->builder->method('POST')
->service('buyin.simplePlan')
->path('/buyin/simplePlan')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinShopActivityList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.ShopActivityList')
->path('/buyin/ShopActivityList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinShopActivityDetail(array $params = [])
{
$this->builder->method('POST')
->service('buyin.shopActivityDetail')
->path('/buyin/shopActivityDetail')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinApplyActivities(array $params = [])
{
$this->builder->method('POST')
->service('buyin.applyActivities')
->path('/buyin/applyActivities')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinActivityProductExtendList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.activityProductExtendList')
->path('/buyin/activityProductExtendList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinActivityProductExtendApprove(array $params = [])
{
$this->builder->method('POST')
->service('buyin.activityProductExtendApprove')
->path('/buyin/activityProductExtendApprove')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinCreateOrUpdateOrienPlan(array $params = [])
{
$this->builder->method('POST')
->service('buyin.createOrUpdateOrienPlan')
->path('/buyin/createOrUpdateOrienPlan')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOrienPlanList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.orienPlanList')
->path('/buyin/orienPlanList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOrienPlanCtrl(array $params = [])
{
$this->builder->method('POST')
->service('buyin.orienPlanCtrl')
->path('/buyin/orienPlanCtrl')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOrienPlanAuthors(array $params = [])
{
$this->builder->method('POST')
->service('buyin.orienPlanAuthors')
->path('/buyin/orienPlanAuthors')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOrienPlanAuthorsAdd(array $params = [])
{
$this->builder->method('POST')
->service('buyin.orienPlanAuthorsAdd')
->path('/buyin/orienPlanAuthorsAdd')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOrienPlanAudit(array $params = [])
{
$this->builder->method('POST')
->service('buyin.orienPlanAudit')
->path('/buyin/orienPlanAudit')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinExclusivePlan(array $params = [])
{
$this->builder->method('POST')
->service('buyin.exclusivePlan')
->path('/buyin/exclusivePlan')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinExclusivePlanAuthorOperate(array $params = [])
{
$this->builder->method('POST')
->service('buyin.exclusivePlanAuthorOperate')
->path('/buyin/exclusivePlanAuthorOperate')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceColonelActivityCreateOrUpdate(array $params = [])
{
$this->builder->method('POST')
->service('alliance.colonelActivityCreateOrUpdate')
->path('/alliance/colonelActivityCreateOrUpdate')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceActivityProductCategoryList(array $params = [])
{
$this->builder->method('POST')
->service('alliance.activityProductCategoryList')
->path('/alliance/activityProductCategoryList')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceInstituteColonelActivityList(array $params = [])
{
$this->builder->method('POST')
->service('alliance.instituteColonelActivityList')
->path('/alliance/instituteColonelActivityList')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceInstituteColonelActivityOperate(array $params = [])
{
$this->builder->method('POST')
->service('alliance.instituteColonelActivityOperate')
->path('/alliance/instituteColonelActivityOperate')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceColonelActivityProduct(array $params = [])
{
$this->builder->method('POST')
->service('alliance.colonelActivityProduct')
->path('/alliance/colonelActivityProduct')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceColonelActivityProductAudit(array $params = [])
{
$this->builder->method('POST')
->service('alliance.colonelActivityProductAudit')
->path('/alliance/colonelActivityProductAudit')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinColonelspecialApplyList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.colonel/specialApplyList')
->path('/buyin/colonel/specialApplyList')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceColonelActivityProductExtension(array $params = [])
{
$this->builder->method('POST')
->service('alliance.colonelActivityProductExtension')
->path('/alliance/colonelActivityProductExtension')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinColonelspecialApplyDeal(array $params = [])
{
$this->builder->method('POST')
->service('buyin.colonel/specialApplyDeal')
->path('/buyin/colonel/specialApplyDeal')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOriginColonelEnrollableActivityList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.originColonelEnrollableActivityList')
->path('/buyin/originColonelEnrollableActivityList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinColonelActivityDetail(array $params = [])
{
$this->builder->method('POST')
->service('buyin.colonelActivityDetail')
->path('/buyin/colonelActivityDetail')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOriginColonelUnappliedProductList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.originColonelUnappliedProductList')
->path('/buyin/originColonelUnappliedProductList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinOriginColonelApplyActivities(array $params = [])
{
$this->builder->method('POST')
->service('buyin.originColonelApplyActivities')
->path('/buyin/originColonelApplyActivities')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinActivityProductList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.activityProductList')
->path('/buyin/activityProductList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinActivityProductCancel(array $params = [])
{
$this->builder->method('POST')
->service('buyin.activityProductCancel')
->path('/buyin/activityProductCancel')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceMaterialsProductsSearch(array $params = [])
{
$this->builder->method('POST')
->service('alliance.materialsProductsSearch')
->path('/alliance/materialsProductsSearch')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinSimplePlanList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.simplePlanList')
->path('/buyin/simplePlanList')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceMaterialsProductsDetails(array $params = [])
{
$this->builder->method('POST')
->service('alliance.materialsProductsDetails')
->path('/alliance/materialsProductsDetails')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinProductSkus(array $params = [])
{
$this->builder->method('POST')
->service('buyin.productSkus')
->path('/buyin/productSkus')
->params($params);
}
/**
* @inheritDoc
*/
public function allianceMaterialsProductCategory(array $params = [])
{
$this->builder->method('POST')
->service('alliance.materialsProductCategory')
->path('/alliance/materialsProductCategory')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinMaterialsProductStatus(array $params = [])
{
$this->builder->method('POST')
->service('buyin.materialsProductStatus')
->path('/buyin/materialsProductStatus')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolMaterialsProductsSearch(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolMaterialsProductsSearch')
->path('/buyin/kolMaterialsProductsSearch')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolMaterialsProductsDetails(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolMaterialsProductsDetails')
->path('/buyin/kolMaterialsProductsDetails')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinQueryInstituteOrders(array $params = [])
{
$this->builder->method('POST')
->service('buyin.queryInstituteOrders')
->path('/buyin/queryInstituteOrders')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteOrderMCN(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteOrderMCN')
->path('/buyin/instituteOrderMCN')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteOrderColonel(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteOrderColonel')
->path('/buyin/instituteOrderColonel')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstPickSourceConvert(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instPickSourceConvert')
->path('/buyin/instPickSourceConvert')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstGmv(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instGmv')
->path('/buyin/instGmv')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstGmvDetail(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instGmvDetail')
->path('/buyin/instGmvDetail')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolPidCreate(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolPidCreate')
->path('/buyin/kolPidCreate')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolPidList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolPidList')
->path('/buyin/kolPidList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolPidEdit(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolPidEdit')
->path('/buyin/kolPidEdit')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolPidDel(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolPidDel')
->path('/buyin/kolPidDel')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinShareCommandParse(array $params = [])
{
$this->builder->method('POST')
->service('buyin.shareCommandParse')
->path('/buyin/shareCommandParse')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolProductShare(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolProductShare')
->path('/buyin/kolProductShare')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstitutePidCreate(array $params = [])
{
$this->builder->method('POST')
->service('buyin.institutePidCreate')
->path('/buyin/institutePidCreate')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstitutePidList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.institutePidList')
->path('/buyin/institutePidList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstitutePidEdit(array $params = [])
{
$this->builder->method('POST')
->service('buyin.institutePidEdit')
->path('/buyin/institutePidEdit')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstitutePidDel(array $params = [])
{
$this->builder->method('POST')
->service('buyin.institutePidDel')
->path('/buyin/institutePidDel')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinLiveShareMaterial(array $params = [])
{
$this->builder->method('POST')
->service('buyin.liveShareMaterial')
->path('/buyin/liveShareMaterial')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinDistributionLiveProductList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.distributionLiveProductList')
->path('/buyin/distributionLiveProductList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteLiveShare(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteLiveShare')
->path('/buyin/instituteLiveShare')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteOrderAds(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteOrderAds')
->path('/buyin/instituteOrderAds')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolOrderAds(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolOrderAds')
->path('/buyin/kolOrderAds')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinShopPidMemberCreate(array $params = [])
{
$this->builder->method('POST')
->service('buyin.shopPidMemberCreate')
->path('/buyin/shopPidMemberCreate')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolLiveShare(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolLiveShare')
->path('/buyin/kolLiveShare')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinMHandleTrusteeshipApply(array $params = [])
{
$this->builder->method('POST')
->service('buyin.mHandleTrusteeshipApply')
->path('/buyin/mHandleTrusteeshipApply')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinColoneltrusteeshipList(array $params = [])
{
$this->builder->method('POST')
->service('buyin.colonel/trusteeshipList')
->path('/buyin/colonel/trusteeshipList')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteOrderPick(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteOrderPick')
->path('/buyin/instituteOrderPick')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinInstituteLivePreviewShare(array $params = [])
{
$this->builder->method('POST')
->service('buyin.instituteLivePreviewShare')
->path('/buyin/instituteLivePreviewShare')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinKolLivePreviewShare(array $params = [])
{
$this->builder->method('POST')
->service('buyin.kolLivePreviewShare')
->path('/buyin/kolLivePreviewShare')
->params($params);
}
/**
* @inheritDoc
*/
public function buyinActivityShareConvert(array $params = [])
{
$this->builder->method('POST')
->service('buyin.activityShareConvert')
->path('/buyin/activityShareConvert')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Buyin;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 精选联盟API
*/
interface BuyinInterface
{
/**
* 创建/修改普通商品推广计划
* @link https://op.jinritemai.com/docs/api-docs/61/923
* @param array $params
* @return ResultSet
*/
public function buyinSimplePlan(array $params = []);
/**
* 商家可参与的团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1671
* @param array $params
* @return ResultSet
*/
public function buyinShopActivityList(array $params = []);
/**
* 商家侧获取团长活动详情
* @link https://op.jinritemai.com/docs/api-docs/61/1797
* @param array $params
* @return ResultSet
*/
public function buyinShopActivityDetail(array $params = []);
/**
* 商品团长活动提报接口
* @link https://op.jinritemai.com/docs/api-docs/61/744
* @param array $params
* @return ResultSet
*/
public function buyinApplyActivities(array $params = []);
/**
* 延长推广待处理/已处理记录查询
* @link https://op.jinritemai.com/docs/api-docs/61/1674
* @param array $params
* @return ResultSet
*/
public function buyinActivityProductExtendList(array $params = []);
/**
* 商家处理团长活动商品的推广延期申请
* @link https://op.jinritemai.com/docs/api-docs/61/1673
* @param array $params
* @return ResultSet
*/
public function buyinActivityProductExtendApprove(array $params = []);
/**
* 创建/修改商品定向计划
* @link https://op.jinritemai.com/docs/api-docs/61/708
* @param array $params
* @return ResultSet
*/
public function buyinCreateOrUpdateOrienPlan(array $params = []);
/**
* 商品定向计划查询
* @link https://op.jinritemai.com/docs/api-docs/61/705
* @param array $params
* @return ResultSet
*/
public function buyinOrienPlanList(array $params = []);
/**
* 商品定向计划管理
* @link https://op.jinritemai.com/docs/api-docs/61/704
* @param array $params
* @return ResultSet
*/
public function buyinOrienPlanCtrl(array $params = []);
/**
* 查询定向计划作者列表
* @link https://op.jinritemai.com/docs/api-docs/61/1879
* @param array $params
* @return ResultSet
*/
public function buyinOrienPlanAuthors(array $params = []);
/**
* 向指定定向计划中添加达人
* @link https://op.jinritemai.com/docs/api-docs/61/1877
* @param array $params
* @return ResultSet
*/
public function buyinOrienPlanAuthorsAdd(array $params = []);
/**
* 定向计划达人申请审核
* @link https://op.jinritemai.com/docs/api-docs/61/1878
* @param array $params
* @return ResultSet
*/
public function buyinOrienPlanAudit(array $params = []);
/**
* 创建/修改商品专属推广计划
* @link https://op.jinritemai.com/docs/api-docs/61/1880
* @param array $params
* @return ResultSet
*/
public function buyinExclusivePlan(array $params = []);
/**
* 店铺专属达人管理
* @link https://op.jinritemai.com/docs/api-docs/61/1935
* @param array $params
* @return ResultSet
*/
public function buyinExclusivePlanAuthorOperate(array $params = []);
/**
* 团长活动创建/编辑接口
* @link https://op.jinritemai.com/docs/api-docs/61/966
* @param array $params
* @return ResultSet
*/
public function allianceColonelActivityCreateOrUpdate(array $params = []);
/**
* 创建活动时候可选择的类目接口
* @link https://op.jinritemai.com/docs/api-docs/61/1882
* @param array $params
* @return ResultSet
*/
public function allianceActivityProductCategoryList(array $params = []);
/**
* 团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1330
* @param array $params
* @return ResultSet
*/
public function allianceInstituteColonelActivityList(array $params = []);
/**
* 专属团长活动删除接口(下线+删除)
* @link https://op.jinritemai.com/docs/api-docs/61/972
* @param array $params
* @return ResultSet
*/
public function allianceInstituteColonelActivityOperate(array $params = []);
/**
* 活动商品查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/968
* @param array $params
* @return ResultSet
*/
public function allianceColonelActivityProduct(array $params = []);
/**
* 专属团长活动商品审核接口
* @link https://op.jinritemai.com/docs/api-docs/61/971
* @param array $params
* @return ResultSet
*/
public function allianceColonelActivityProductAudit(array $params = []);
/**
* 查询团长活动特殊申请
* @link https://op.jinritemai.com/docs/api-docs/61/1552
* @param array $params
* @return ResultSet
*/
public function buyinColonelspecialApplyList(array $params = []);
/**
* 专属团长活动商品延时接口
* @link https://op.jinritemai.com/docs/api-docs/61/1881
* @param array $params
* @return ResultSet
*/
public function allianceColonelActivityProductExtension(array $params = []);
/**
* 团长活动特殊申请审核
* @link https://op.jinritemai.com/docs/api-docs/61/1553
* @param array $params
* @return ResultSet
*/
public function buyinColonelspecialApplyDeal(array $params = []);
/**
* 团长可参与的二级团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1675
* @param array $params
* @return ResultSet
*/
public function buyinOriginColonelEnrollableActivityList(array $params = []);
/**
* 获取团长活动详情
* @link https://op.jinritemai.com/docs/api-docs/61/1670
* @param array $params
* @return ResultSet
*/
public function buyinColonelActivityDetail(array $params = []);
/**
* 团长获取可提报二级团长活动的商品列表
* @link https://op.jinritemai.com/docs/api-docs/61/1677
* @param array $params
* @return ResultSet
*/
public function buyinOriginColonelUnappliedProductList(array $params = []);
/**
* 团长报名二级团长活动
* @link https://op.jinritemai.com/docs/api-docs/61/1672
* @param array $params
* @return ResultSet
*/
public function buyinOriginColonelApplyActivities(array $params = []);
/**
* 一级团长查询提报活动商品
* @link https://op.jinritemai.com/docs/api-docs/61/1926
* @param array $params
* @return ResultSet
*/
public function buyinActivityProductList(array $params = []);
/**
* 一级团长取消活动提报申请接口
* @link https://op.jinritemai.com/docs/api-docs/61/1927
* @param array $params
* @return ResultSet
*/
public function buyinActivityProductCancel(array $params = []);
/**
* 检索精选联盟商品
* @link https://op.jinritemai.com/docs/api-docs/61/924
* @param array $params
* @return ResultSet
*/
public function allianceMaterialsProductsSearch(array $params = []);
/**
* 商品推广 普通计划查询
* @link https://op.jinritemai.com/docs/api-docs/61/349
* @param array $params
* @return ResultSet
*/
public function buyinSimplePlanList(array $params = []);
/**
* 批量查询推广商品详情
* @link https://op.jinritemai.com/docs/api-docs/61/1356
* @param array $params
* @return ResultSet
*/
public function allianceMaterialsProductsDetails(array $params = []);
/**
* 查询商品 SKU
* @link https://op.jinritemai.com/docs/api-docs/61/1626
* @param array $params
* @return ResultSet
*/
public function buyinProductSkus(array $params = []);
/**
* 类目查询
* @link https://op.jinritemai.com/docs/api-docs/61/637
* @param array $params
* @return ResultSet
*/
public function allianceMaterialsProductCategory(array $params = []);
/**
* 商品状态查询
* @link https://op.jinritemai.com/docs/api-docs/61/1497
* @param array $params
* @return ResultSet
*/
public function buyinMaterialsProductStatus(array $params = []);
/**
* 检索精选联盟商品,需达人授权
* @link https://op.jinritemai.com/docs/api-docs/61/1725
* @param array $params
* @return ResultSet
*/
public function buyinKolMaterialsProductsSearch(array $params = []);
/**
* 查询达人视角商品详情
* @link https://op.jinritemai.com/docs/api-docs/61/1589
* @param array $params
* @return ResultSet
*/
public function buyinKolMaterialsProductsDetails(array $params = []);
/**
* 【即将下线】查询机构联盟订单
* @link https://op.jinritemai.com/docs/api-docs/61/1398
* @param array $params
* @return ResultSet
*/
public function buyinQueryInstituteOrders(array $params = []);
/**
* 查询MCN机构订单
* @link https://op.jinritemai.com/docs/api-docs/61/1602
* @param array $params
* @return ResultSet
*/
public function buyinInstituteOrderMCN(array $params = []);
/**
* 机构查询团长订单
* @link https://op.jinritemai.com/docs/api-docs/61/1603
* @param array $params
* @return ResultSet
*/
public function buyinInstituteOrderColonel(array $params = []);
/**
* 商品选品来源转链
* @link https://op.jinritemai.com/docs/api-docs/61/1454
* @param array $params
* @return ResultSet
*/
public function buyinInstPickSourceConvert(array $params = []);
/**
* 机构选品GMV查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1652
* @param array $params
* @return ResultSet
*/
public function buyinInstGmv(array $params = []);
/**
* 机构选品GMV明细查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1653
* @param array $params
* @return ResultSet
*/
public function buyinInstGmvDetail(array $params = []);
/**
* 达人PID创建
* @link https://op.jinritemai.com/docs/api-docs/61/1460
* @param array $params
* @return ResultSet
*/
public function buyinKolPidCreate(array $params = []);
/**
* 达人PID查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1461
* @param array $params
* @return ResultSet
*/
public function buyinKolPidList(array $params = []);
/**
* 达人PID 编辑
* @link https://op.jinritemai.com/docs/api-docs/61/1462
* @param array $params
* @return ResultSet
*/
public function buyinKolPidEdit(array $params = []);
/**
* 达人PID删除
* @link https://op.jinritemai.com/docs/api-docs/61/1463
* @param array $params
* @return ResultSet
*/
public function buyinKolPidDel(array $params = []);
/**
* 商品口令转商品解析
* @link https://op.jinritemai.com/docs/api-docs/61/1726
* @param array $params
* @return ResultSet
*/
public function buyinShareCommandParse(array $params = []);
/**
* 达人商品分销转链
* @link https://op.jinritemai.com/docs/api-docs/61/1464
* @param array $params
* @return ResultSet
*/
public function buyinKolProductShare(array $params = []);
/**
* 机构PID创建
* @link https://op.jinritemai.com/docs/api-docs/61/1273
* @param array $params
* @return ResultSet
*/
public function buyinInstitutePidCreate(array $params = []);
/**
* 机构PID查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1269
* @param array $params
* @return ResultSet
*/
public function buyinInstitutePidList(array $params = []);
/**
* 机构PID 编辑
* @link https://op.jinritemai.com/docs/api-docs/61/1270
* @param array $params
* @return ResultSet
*/
public function buyinInstitutePidEdit(array $params = []);
/**
* 机构PID删除
* @link https://op.jinritemai.com/docs/api-docs/61/1271
* @param array $params
* @return ResultSet
*/
public function buyinInstitutePidDel(array $params = []);
/**
* 直播间分销物料查询
* @link https://op.jinritemai.com/docs/api-docs/61/1396
* @param array $params
* @return ResultSet
*/
public function buyinLiveShareMaterial(array $params = []);
/**
* 分销直播间商品列表
* @link https://op.jinritemai.com/docs/api-docs/61/1770
* @param array $params
* @return ResultSet
*/
public function buyinDistributionLiveProductList(array $params = []);
/**
* 机构获取达人直播间分享链接
* @link https://op.jinritemai.com/docs/api-docs/61/1297
* @param array $params
* @return ResultSet
*/
public function buyinInstituteLiveShare(array $params = []);
/**
* 查询抖客直播间分销订单
* @link https://op.jinritemai.com/docs/api-docs/61/1296
* @param array $params
* @return ResultSet
*/
public function buyinInstituteOrderAds(array $params = []);
/**
* 查询达人的直播间分销、商品分销、活动页分销订单
* @link https://op.jinritemai.com/docs/api-docs/61/1459
* @param array $params
* @return ResultSet
*/
public function buyinKolOrderAds(array $params = []);
/**
* 店铺会员绑定渠道关系创建
* @link https://op.jinritemai.com/docs/api-docs/61/1493
* @param array $params
* @return ResultSet
*/
public function buyinShopPidMemberCreate(array $params = []);
/**
* 获取达人直播间分享链接
* @link https://op.jinritemai.com/docs/api-docs/61/1724
* @param array $params
* @return ResultSet
*/
public function buyinKolLiveShare(array $params = []);
/**
* 团长托管商品审核
* @link https://op.jinritemai.com/docs/api-docs/61/2138
* @param array $params
* @return ResultSet
*/
public function buyinMHandleTrusteeshipApply(array $params = []);
/**
* 团长托管商品查询
* @link https://op.jinritemai.com/docs/api-docs/61/2137
* @param array $params
* @return ResultSet
*/
public function buyinColoneltrusteeshipList(array $params = []);
/**
* 选品订单明细查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/2008
* @param array $params
* @return ResultSet
*/
public function buyinInstituteOrderPick(array $params = []);
/**
* 机构直播预告转链
* @link https://op.jinritemai.com/docs/api-docs/61/2007
* @param array $params
* @return ResultSet
*/
public function buyinInstituteLivePreviewShare(array $params = []);
/**
* 达人直播预告转链
* @link https://op.jinritemai.com/docs/api-docs/61/2006
* @param array $params
* @return ResultSet
*/
public function buyinKolLivePreviewShare(array $params = []);
/**
* 活动页转链接口
* @link https://op.jinritemai.com/docs/api-docs/61/2003
* @param array $params
* @return ResultSet
*/
public function buyinActivityShareConvert(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Coupons;
use Lackoxygen\TiktokShop\Request\Request;
class Coupons extends Request implements CouponsInterface
{
/**
* @inheritDoc
*/
public function couponsCancelVerify(array $params = [])
{
$this->builder->method('POST')
->service('coupons.cancelVerify')
->path('/coupons/cancelVerify')
->params($params);
}
/**
* @inheritDoc
*/
public function couponsAbandon(array $params = [])
{
$this->builder->method('POST')
->service('coupons.abandon')
->path('/coupons/abandon')
->params($params);
}
/**
* @inheritDoc
*/
public function couponsSyncV2(array $params = [])
{
$this->builder->method('POST')
->service('coupons.syncV2')
->path('/coupons/syncV2')
->params($params);
}
/**
* @inheritDoc
*/
public function couponsVerifyV2(array $params = [])
{
$this->builder->method('POST')
->service('coupons.verifyV2')
->path('/coupons/verifyV2')
->params($params);
}
/**
* @inheritDoc
*/
public function couponsCertVerifyUpdate(array $params = [])
{
$this->builder->method('POST')
->service('coupons.certVerifyUpdate')
->path('/coupons/certVerifyUpdate')
->params($params);
}
/**
* @inheritDoc
*/
public function orderSettle(array $params = [])
{
$this->builder->method('POST')
->service('order.settle')
->path('/coupons/list')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Coupons;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 卡券API
*/
interface CouponsInterface
{
/**
* 卡券取消核销接口
* @link https://op.jinritemai.com/docs/api-docs/52/668
* @param array $params
* @return ResultSet
*/
public function couponsCancelVerify(array $params = []);
/**
* 卡券废弃接口
* @link https://op.jinritemai.com/docs/api-docs/52/669
* @param array $params
* @return ResultSet
*/
public function couponsAbandon(array $params = []);
/**
* 卡券同步
* @link https://op.jinritemai.com/docs/api-docs/52/712
* @param array $params
* @return ResultSet
*/
public function couponsSyncV2(array $params = []);
/**
* 卡券核销接口V2版本
* @link https://op.jinritemai.com/docs/api-docs/52/797
* @param array $params
* @return ResultSet
*/
public function couponsVerifyV2(array $params = []);
/**
* 卡券核销次数更新
* @link https://op.jinritemai.com/docs/api-docs/52/900
* @param array $params
* @return ResultSet
*/
public function couponsCertVerifyUpdate(array $params = []);
/**
* 三方卡券列表查询
* @link https://op.jinritemai.com/docs/api-docs/52/369
* @param array $params
* @return ResultSet
*/
public function orderSettle(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Crossborder;
use Lackoxygen\TiktokShop\Request\Request;
class Crossborder extends Request implements CrossborderInterface
{
/**
* @inheritDoc
*/
public function dutyFreeOrderList(array $params = [])
{
$this->builder->method('POST')
->service('dutyFree.orderList')
->path('/dutyFree/orderList')
->params($params);
}
/**
* @inheritDoc
*/
public function crossborderStockTaking(array $params = [])
{
$this->builder->method('POST')
->service('crossborder.stockTaking')
->path('/crossborder/stockTaking')
->params($params);
}
/**
* @inheritDoc
*/
public function crossborderStockTransform(array $params = [])
{
$this->builder->method('POST')
->service('crossborder.stockTransform')
->path('/crossborder/stockTransform')
->params($params);
}
/**
* @inheritDoc
*/
public function crossborderOrderInterception(array $params = [])
{
$this->builder->method('POST')
->service('crossborder.OrderInterception')
->path('/crossborder/OrderInterception')
->params($params);
}
/**
* @inheritDoc
*/
public function crossborderTakingLogisticsInfo(array $params = [])
{
$this->builder->method('POST')
->service('crossborder.takingLogisticsInfo')
->path('/crossborder/takingLogisticsInfo')
->params($params);
}
/**
* @inheritDoc
*/
public function crossborderWarehouseInOutboundEvent(array $params = [])
{
$this->builder->method('POST')
->service('crossborder.warehouseInOutboundEvent')
->path('/crossborder/warehouseInOutboundEvent')
->params($params);
}
/**
* @inheritDoc
*/
public function crossBorderGetTradeOrderStatus(array $params = [])
{
$this->builder->method('POST')
->service('crossBorder.getTradeOrderStatus')
->path('/crossBorder/getTradeOrderStatus')
->params($params);
}
/**
* @inheritDoc
*/
public function crossBorderCustomsTaxInfo(array $params = [])
{
$this->builder->method('POST')
->service('crossBorder.customsTaxInfo')
->path('/crossBorder/customsTaxInfo')
->params($params);
}
/**
* @inheritDoc
*/
public function dutyFreeOrderConfirm(array $params = [])
{
$this->builder->method('POST')
->service('dutyFree.orderConfirm')
->path('/dutyFree/orderConfirm')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Crossborder;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 跨境API
*/
interface CrossborderInterface
{
/**
* 商家拉单
* @link https://op.jinritemai.com/docs/api-docs/53/703
* @param array $params
* @return ResultSet
*/
public function dutyFreeOrderList(array $params = []);
/**
* 库存盘点回告
* @link https://op.jinritemai.com/docs/api-docs/53/883
* @param array $params
* @return ResultSet
*/
public function crossborderStockTaking(array $params = []);
/**
* 库存类型变动回告
* @link https://op.jinritemai.com/docs/api-docs/53/918
* @param array $params
* @return ResultSet
*/
public function crossborderStockTransform(array $params = []);
/**
* 服务商锁单结果回告
* @link https://op.jinritemai.com/docs/api-docs/53/920
* @param array $params
* @return ResultSet
*/
public function crossborderOrderInterception(array $params = []);
/**
* 运单信息回告
* @link https://op.jinritemai.com/docs/api-docs/53/1293
* @param array $params
* @return ResultSet
*/
public function crossborderTakingLogisticsInfo(array $params = []);
/**
* 入库和提货出库回告
* @link https://op.jinritemai.com/docs/api-docs/53/1205
* @param array $params
* @return ResultSet
*/
public function crossborderWarehouseInOutboundEvent(array $params = []);
/**
* 获取交易订单状态
* @link https://op.jinritemai.com/docs/api-docs/53/1650
* @param array $params
* @return ResultSet
*/
public function crossBorderGetTradeOrderStatus(array $params = []);
/**
* 服务商回告海关税费
* @link https://op.jinritemai.com/docs/api-docs/53/1761
* @param array $params
* @return ResultSet
*/
public function crossBorderCustomsTaxInfo(array $params = []);
/**
* 商家接单
* @link https://op.jinritemai.com/docs/api-docs/53/1873
* @param array $params
* @return ResultSet
*/
public function dutyFreeOrderConfirm(array $params = []);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Iop;
use Lackoxygen\TiktokShop\Request\Request;
class Iop extends Request implements IopInterface
{
/**
* @inheritDoc
*/
public function iopOrderList(array $params = [])
{
$this->builder->method('POST')
->service('iop.orderList')
->path('/iop/orderList')
->params($params);
}
/**
* @inheritDoc
*/
public function iopWaybillGet(array $params = [])
{
$this->builder->method('POST')
->service('iop.waybillGet')
->path('/iop/waybillGet')
->params($params);
}
/**
* @inheritDoc
*/
public function iopWaybillCancel(array $params = [])
{
$this->builder->method('POST')
->service('iop.waybillCancel')
->path('/iop/waybillCancel')
->params($params);
}
/**
* @inheritDoc
*/
public function iopWaybillReturn(array $params = [])
{
$this->builder->method('POST')
->service('iop.waybillReturn')
->path('/iop/waybillReturn')
->params($params);
}
/**
* @inheritDoc
*/
public function iopWaybillUpdate(array $params = [])
{
$this->builder->method('POST')
->service('iop.waybillUpdate')
->path('/iop/waybillUpdate')
->params($params);
}
/**
* @inheritDoc
*/
public function iopOrderInfo(array $params = [])
{
$this->builder->method('POST')
->service('iop.orderInfo')
->path('/iop/orderInfo')
->params($params);
}
/**
* @inheritDoc
*/
public function iopSellerDistribute(array $params = [])
{
$this->builder->method('POST')
->service('iop.sellerDistribute')
->path('/iop/sellerDistribute')
->params($params);
}
/**
* @inheritDoc
*/
public function iopSellerOrderList(array $params = [])
{
$this->builder->method('POST')
->service('iop.sellerOrderList')
->path('/iop/sellerOrderList')
->params($params);
}
/**
* @inheritDoc
*/
public function iopGetSellerList(array $params = [])
{
$this->builder->method('POST')
->service('iop.getSellerList')
->path('/iop/getSellerList')
->params($params);
}
/**
* @inheritDoc
*/
public function iopRoleGet(array $params = [])
{
$this->builder->method('POST')
->service('iop.roleGet')
->path('/iop/roleGet')
->params($params);
}
/**
* @inheritDoc
*/
public function iopSellerCancleDistribute(array $params = [])
{
$this->builder->method('POST')
->service('iop.sellerCancleDistribute')
->path('/iop/sellerCancleDistribute')
->params($params);
}
/**
* @inheritDoc
*/
public function iopSellerSupplierList(array $params = [])
{
$this->builder->method('POST')
->service('iop.sellerSupplierList')
->path('/iop/sellerSupplierList')
->params($params);
}
/**
* @inheritDoc
*/
public function iopSellerOrderInfo(array $params = [])
{
$this->builder->method('POST')
->service('iop.sellerOrderInfo')
->path('/iop/sellerOrderInfo')
->params($params);
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Request\Iop;
use Lackoxygen\TiktokShop\Response\ResultSet;
/**
* @note 代发API
*/
interface IopInterface
{
/**
* 【厂商】查询代打订单列表
* @link https://op.jinritemai.com/docs/api-docs/59/673
* @param array $params
* @return ResultSet
*/
public function iopOrderList(array $params = []);
/**
* 【厂商】电子面单取号
* @link https://op.jinritemai.com/docs/api-docs/59/674
* @param array $params
* @return ResultSet
*/
public function iopWaybillGet(array $params = []);
/**
* 【厂商】取消电子面单
* @link https://op.jinritemai.com/docs/api-docs/59/675
* @param array $params
* @return ResultSet
*/
public function iopWaybillCancel(array $params = []);
/**
* 【厂商】代发订单发货接口
* @link https://op.jinritemai.com/docs/api-docs/59/676
* @param array $params
* @return ResultSet
*/
public function iopWaybillReturn(array $params = []);
/**
* 【厂商】代发订单更新发货接口
* @link https://op.jinritemai.com/docs/api-docs/59/677
* @param array $params
* @return ResultSet
*/
public function iopWaybillUpdate(array $params = []);
/**
* 【厂商】订单详情
* @link https://op.jinritemai.com/docs/api-docs/59/678
* @param array $params
* @return ResultSet
*/
public function iopOrderInfo(array $params = []);
/**
* 【商家】分配代发订单
* @link https://op.jinritemai.com/docs/api-docs/59/958
* @param array $params
* @return ResultSet
*/
public function iopSellerDistribute(array $params = []);
/**
* 【商家】查看代发订单列表
* @link https://op.jinritemai.com/docs/api-docs/59/960
* @param array $params
* @return ResultSet
*/
public function iopSellerOrderList(array $params = []);
/**
* 【厂家】查询商家列表
* @link https://op.jinritemai.com/docs/api-docs/59/1752
* @param array $params
* @return ResultSet
*/
public function iopGetSellerList(array $params = []);
/**
* 【厂商】查询店铺身份
* @link https://op.jinritemai.com/docs/api-docs/59/1874
* @param array $params
* @return ResultSet
*/
public function iopRoleGet(array $params = []);
/**
* 【商家】取消分配代发订单
* @link https://op.jinritemai.com/docs/api-docs/59/1876
* @param array $params
* @return ResultSet
*/
public function iopSellerCancleDistribute(array $params = []);
/**
* 【商家】查询厂商管理列表
* @link https://op.jinritemai.com/docs/api-docs/59/1799
* @param array $params
* @return ResultSet
*/
public function iopSellerSupplierList(array $params = []);
/**
* 【商家】查看代发订单详情
* @link https://op.jinritemai.com/docs/api-docs/59/1875
* @param array $params
* @return ResultSet
*/
public function iopSellerOrderInfo(array $params = []);
}
... ...