作者 lackoxygen

feat:结构

正在显示 70 个修改的文件 包含 2419 行增加2792 行删除
... ... @@ -440,7 +440,7 @@ class Main
$metaMethods = array_map(function ($target) {
$name = ucfirst($target);
$interface = sprintf('Passage\\%s\\%sInterface', $name, $name);
$interface = sprintf('Request\\%s\\%sInterface', $name, $name);
$method = lcfirst($target);
return ' * @method ' . $interface . ' ' . $method . '()';
}, $targets);
... ... @@ -477,9 +477,9 @@ class Main
namespace Lackoxygen\TiktokShop\Facade;
use Lackoxygen\TiktokShop\Passage;
use Lackoxygen\TiktokShop\Request;
use Illuminate\Support\Facades\Facade;
use Lackoxygen\TiktokShop\Passage\Verify;
use Lackoxygen\TiktokShop\Support\Verify;
use Lackoxygen\TiktokShop\TiktokShop as TiktokShopKernel;
\${ANNOTATE}
... ... @@ -601,7 +601,7 @@ class CodeWriter
global $src_path;
$baseDir = $src_path . '/Passage';
$baseDir = $src_path . '/Request';
$directory = $baseDir . '/' . $class->toArray()['name'];
... ... @@ -626,9 +626,7 @@ class CodeGenerateInterface
{
protected static string $template = <<<temp
<?php
namespace Lackoxygen\TiktokShop\Passage\\\${SECTION};
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
/**
* @note \${ANNOTATE}
... ... @@ -721,11 +719,11 @@ class CodeGenerateClass
protected static string $template = <<<temp
<?php
namespace Lackoxygen\TiktokShop\Passage\\\${SECTION};
namespace Lackoxygen\TiktokShop\Request\\\${SECTION};
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class \${NAME} extends Passage implements \${INTERFACE}
class \${NAME} extends Request implements \${INTERFACE}
{
\${METHOD}
}
... ...
<?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,38 +2,38 @@
namespace Lackoxygen\TiktokShop\Facade;
use Lackoxygen\TiktokShop\Passage;
use Lackoxygen\TiktokShop\Request;
use Illuminate\Support\Facades\Facade;
use Lackoxygen\TiktokShop\Passage\Verify;
use Lackoxygen\TiktokShop\Support\Verify;
use Lackoxygen\TiktokShop\TiktokShop as TiktokShopKernel;
/**
* @method static TiktokShopKernel setAccessToken(string $accessToken)
* @method static TiktokShopKernel use ($options)
* @method static Verify verify()
* @method static Passage\Pigeon\PigeonInterface pigeon()
* @method static Passage\Sms\SmsInterface sms()
* @method static Passage\SupplyChain\SupplyChainInterface supplyChain()
* @method static Passage\Topup\TopupInterface topup()
* @method static Passage\OpenCloud\OpenCloudInterface openCloud()
* @method static Passage\Btas\BtasInterface btas()
* @method static Passage\Recycle\RecycleInterface recycle()
* @method static Passage\Member\MemberInterface member()
* @method static Passage\Buyin\BuyinInterface buyin()
* @method static Passage\Yunc\YuncInterface yunc()
* @method static Passage\OrderCode\OrderCodeInterface orderCode()
* @method static Passage\Coupons\CouponsInterface coupons()
* @method static Passage\Crossborder\CrossborderInterface crossborder()
* @method static Passage\Iop\IopInterface iop()
* @method static Passage\Antispam\AntispamInterface antispam()
* @method static Passage\Token\TokenInterface token()
* @method static Passage\Order\OrderInterface order()
* @method static Passage\AfterSale\AfterSaleInterface afterSale()
* @method static Passage\Logistics\LogisticsInterface logistics()
* @method static Passage\Warehouse\WarehouseInterface warehouse()
* @method static Passage\Product\ProductInterface product()
* @method static Passage\Material\MaterialInterface material()
* @method static Passage\Address\AddressInterface address()
* @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
... ...
... ... @@ -2,16 +2,13 @@
namespace Lackoxygen\TiktokShop\Mock;
use Lackoxygen\TiktokShop\Attribute\Config;
use Lackoxygen\TiktokShop\Attribute\Request;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Exception\MockException;
use Lackoxygen\TiktokShop\Util\Json;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\GuzzleException;
use GuzzleHttp\Psr7\Response;
use GuzzleHttp\RequestOptions;
use Illuminate\Support\Arr;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Exception\MockException;
use Lackoxygen\TiktokShop\Util\Json;
class Mock
{
... ...
<?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\Address;
namespace Lackoxygen\TiktokShop\Request\Address;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Address extends Passage implements AddressInterface
class Address extends Request implements AddressInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Address;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Address;
/**
* @note 店铺API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\AfterSale;
namespace Lackoxygen\TiktokShop\Request\AfterSale;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class AfterSale extends Passage implements AfterSaleInterface
class AfterSale extends Request implements AfterSaleInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\AfterSale;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\AfterSale;
/**
* @note 售后退款API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Antispam;
namespace Lackoxygen\TiktokShop\Request\Antispam;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Antispam extends Passage implements AntispamInterface
class Antispam extends Request implements AntispamInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Antispam;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Antispam;
/**
* @note 风控安全API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Btas;
namespace Lackoxygen\TiktokShop\Request\Btas;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Btas extends Passage implements BtasInterface
class Btas extends Request implements BtasInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Btas;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Btas;
/**
* @note BTAS质检API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Buyin;
namespace Lackoxygen\TiktokShop\Request\Buyin;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Buyin extends Passage implements BuyinInterface
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);
}
}
/**
* @inheritDoc
*/
function buyinSimplePlan(array $params)
{
$this->builder->method('POST')
->service('buyin.simplePlan')
->path('/buyin/simplePlan')
->params($params);
}
/**
* @inheritDoc
*/
function buyinShopActivityList(array $params)
{
$this->builder->method('POST')
->service('buyin.ShopActivityList')
->path('/buyin/ShopActivityList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinShopActivityDetail(array $params)
{
$this->builder->method('POST')
->service('buyin.shopActivityDetail')
->path('/buyin/shopActivityDetail')
->params($params);
}
/**
* @inheritDoc
*/
function buyinApplyActivities(array $params)
{
$this->builder->method('POST')
->service('buyin.applyActivities')
->path('/buyin/applyActivities')
->params($params);
}
/**
* @inheritDoc
*/
function buyinActivityProductExtendList(array $params)
{
$this->builder->method('POST')
->service('buyin.activityProductExtendList')
->path('/buyin/activityProductExtendList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinActivityProductExtendApprove(array $params)
{
$this->builder->method('POST')
->service('buyin.activityProductExtendApprove')
->path('/buyin/activityProductExtendApprove')
->params($params);
}
/**
* @inheritDoc
*/
function buyinCreateOrUpdateOrienPlan(array $params)
{
$this->builder->method('POST')
->service('buyin.createOrUpdateOrienPlan')
->path('/buyin/createOrUpdateOrienPlan')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOrienPlanList(array $params)
{
$this->builder->method('POST')
->service('buyin.orienPlanList')
->path('/buyin/orienPlanList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOrienPlanCtrl(array $params)
{
$this->builder->method('POST')
->service('buyin.orienPlanCtrl')
->path('/buyin/orienPlanCtrl')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOrienPlanAuthors(array $params)
{
$this->builder->method('POST')
->service('buyin.orienPlanAuthors')
->path('/buyin/orienPlanAuthors')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOrienPlanAuthorsAdd(array $params)
{
$this->builder->method('POST')
->service('buyin.orienPlanAuthorsAdd')
->path('/buyin/orienPlanAuthorsAdd')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOrienPlanAudit(array $params)
{
$this->builder->method('POST')
->service('buyin.orienPlanAudit')
->path('/buyin/orienPlanAudit')
->params($params);
}
/**
* @inheritDoc
*/
function buyinExclusivePlan(array $params)
{
$this->builder->method('POST')
->service('buyin.exclusivePlan')
->path('/buyin/exclusivePlan')
->params($params);
}
/**
* @inheritDoc
*/
function buyinExclusivePlanAuthorOperate(array $params)
{
$this->builder->method('POST')
->service('buyin.exclusivePlanAuthorOperate')
->path('/buyin/exclusivePlanAuthorOperate')
->params($params);
}
/**
* @inheritDoc
*/
function allianceColonelActivityCreateOrUpdate(array $params)
{
$this->builder->method('POST')
->service('alliance.colonelActivityCreateOrUpdate')
->path('/alliance/colonelActivityCreateOrUpdate')
->params($params);
}
/**
* @inheritDoc
*/
function allianceActivityProductCategoryList(array $params)
{
$this->builder->method('POST')
->service('alliance.activityProductCategoryList')
->path('/alliance/activityProductCategoryList')
->params($params);
}
/**
* @inheritDoc
*/
function allianceInstituteColonelActivityList(array $params)
{
$this->builder->method('POST')
->service('alliance.instituteColonelActivityList')
->path('/alliance/instituteColonelActivityList')
->params($params);
}
/**
* @inheritDoc
*/
function allianceInstituteColonelActivityOperate(array $params)
{
$this->builder->method('POST')
->service('alliance.instituteColonelActivityOperate')
->path('/alliance/instituteColonelActivityOperate')
->params($params);
}
/**
* @inheritDoc
*/
function allianceColonelActivityProduct(array $params)
{
$this->builder->method('POST')
->service('alliance.colonelActivityProduct')
->path('/alliance/colonelActivityProduct')
->params($params);
}
/**
* @inheritDoc
*/
function allianceColonelActivityProductAudit(array $params)
{
$this->builder->method('POST')
->service('alliance.colonelActivityProductAudit')
->path('/alliance/colonelActivityProductAudit')
->params($params);
}
/**
* @inheritDoc
*/
function buyinColonel/specialApplyList(array $params)
{
$this->builder->method('POST')
->service('buyin.colonel/specialApplyList')
->path('/buyin/colonel/specialApplyList')
->params($params);
}
/**
* @inheritDoc
*/
function allianceColonelActivityProductExtension(array $params)
{
$this->builder->method('POST')
->service('alliance.colonelActivityProductExtension')
->path('/alliance/colonelActivityProductExtension')
->params($params);
}
/**
* @inheritDoc
*/
function buyinColonel/specialApplyDeal(array $params)
{
$this->builder->method('POST')
->service('buyin.colonel/specialApplyDeal')
->path('/buyin/colonel/specialApplyDeal')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOriginColonelEnrollableActivityList(array $params)
{
$this->builder->method('POST')
->service('buyin.originColonelEnrollableActivityList')
->path('/buyin/originColonelEnrollableActivityList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinColonelActivityDetail(array $params)
{
$this->builder->method('POST')
->service('buyin.colonelActivityDetail')
->path('/buyin/colonelActivityDetail')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOriginColonelUnappliedProductList(array $params)
{
$this->builder->method('POST')
->service('buyin.originColonelUnappliedProductList')
->path('/buyin/originColonelUnappliedProductList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinOriginColonelApplyActivities(array $params)
{
$this->builder->method('POST')
->service('buyin.originColonelApplyActivities')
->path('/buyin/originColonelApplyActivities')
->params($params);
}
/**
* @inheritDoc
*/
function buyinActivityProductList(array $params)
{
$this->builder->method('POST')
->service('buyin.activityProductList')
->path('/buyin/activityProductList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinActivityProductCancel(array $params)
{
$this->builder->method('POST')
->service('buyin.activityProductCancel')
->path('/buyin/activityProductCancel')
->params($params);
}
/**
* @inheritDoc
*/
function allianceMaterialsProductsSearch(array $params)
{
$this->builder->method('POST')
->service('alliance.materialsProductsSearch')
->path('/alliance/materialsProductsSearch')
->params($params);
}
/**
* @inheritDoc
*/
function buyinSimplePlanList(array $params)
{
$this->builder->method('POST')
->service('buyin.simplePlanList')
->path('/buyin/simplePlanList')
->params($params);
}
/**
* @inheritDoc
*/
function allianceMaterialsProductsDetails(array $params)
{
$this->builder->method('POST')
->service('alliance.materialsProductsDetails')
->path('/alliance/materialsProductsDetails')
->params($params);
}
/**
* @inheritDoc
*/
function buyinProductSkus(array $params)
{
$this->builder->method('POST')
->service('buyin.productSkus')
->path('/buyin/productSkus')
->params($params);
}
/**
* @inheritDoc
*/
function allianceMaterialsProductCategory(array $params)
{
$this->builder->method('POST')
->service('alliance.materialsProductCategory')
->path('/alliance/materialsProductCategory')
->params($params);
}
/**
* @inheritDoc
*/
function buyinMaterialsProductStatus(array $params)
{
$this->builder->method('POST')
->service('buyin.materialsProductStatus')
->path('/buyin/materialsProductStatus')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolMaterialsProductsSearch(array $params)
{
$this->builder->method('POST')
->service('buyin.kolMaterialsProductsSearch')
->path('/buyin/kolMaterialsProductsSearch')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolMaterialsProductsDetails(array $params)
{
$this->builder->method('POST')
->service('buyin.kolMaterialsProductsDetails')
->path('/buyin/kolMaterialsProductsDetails')
->params($params);
}
/**
* @inheritDoc
*/
function buyinQueryInstituteOrders(array $params)
{
$this->builder->method('POST')
->service('buyin.queryInstituteOrders')
->path('/buyin/queryInstituteOrders')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteOrderMCN(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteOrderMCN')
->path('/buyin/instituteOrderMCN')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteOrderColonel(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteOrderColonel')
->path('/buyin/instituteOrderColonel')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstPickSourceConvert(array $params)
{
$this->builder->method('POST')
->service('buyin.instPickSourceConvert')
->path('/buyin/instPickSourceConvert')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstGmv(array $params)
{
$this->builder->method('POST')
->service('buyin.instGmv')
->path('/buyin/instGmv')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstGmvDetail(array $params)
{
$this->builder->method('POST')
->service('buyin.instGmvDetail')
->path('/buyin/instGmvDetail')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolPidCreate(array $params)
{
$this->builder->method('POST')
->service('buyin.kolPidCreate')
->path('/buyin/kolPidCreate')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolPidList(array $params)
{
$this->builder->method('POST')
->service('buyin.kolPidList')
->path('/buyin/kolPidList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolPidEdit(array $params)
{
$this->builder->method('POST')
->service('buyin.kolPidEdit')
->path('/buyin/kolPidEdit')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolPidDel(array $params)
{
$this->builder->method('POST')
->service('buyin.kolPidDel')
->path('/buyin/kolPidDel')
->params($params);
}
/**
* @inheritDoc
*/
function buyinShareCommandParse(array $params)
{
$this->builder->method('POST')
->service('buyin.shareCommandParse')
->path('/buyin/shareCommandParse')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolProductShare(array $params)
{
$this->builder->method('POST')
->service('buyin.kolProductShare')
->path('/buyin/kolProductShare')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstitutePidCreate(array $params)
{
$this->builder->method('POST')
->service('buyin.institutePidCreate')
->path('/buyin/institutePidCreate')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstitutePidList(array $params)
{
$this->builder->method('POST')
->service('buyin.institutePidList')
->path('/buyin/institutePidList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstitutePidEdit(array $params)
{
$this->builder->method('POST')
->service('buyin.institutePidEdit')
->path('/buyin/institutePidEdit')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstitutePidDel(array $params)
{
$this->builder->method('POST')
->service('buyin.institutePidDel')
->path('/buyin/institutePidDel')
->params($params);
}
/**
* @inheritDoc
*/
function buyinLiveShareMaterial(array $params)
{
$this->builder->method('POST')
->service('buyin.liveShareMaterial')
->path('/buyin/liveShareMaterial')
->params($params);
}
/**
* @inheritDoc
*/
function buyinDistributionLiveProductList(array $params)
{
$this->builder->method('POST')
->service('buyin.distributionLiveProductList')
->path('/buyin/distributionLiveProductList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteLiveShare(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteLiveShare')
->path('/buyin/instituteLiveShare')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteOrderAds(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteOrderAds')
->path('/buyin/instituteOrderAds')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolOrderAds(array $params)
{
$this->builder->method('POST')
->service('buyin.kolOrderAds')
->path('/buyin/kolOrderAds')
->params($params);
}
/**
* @inheritDoc
*/
function buyinShopPidMemberCreate(array $params)
{
$this->builder->method('POST')
->service('buyin.shopPidMemberCreate')
->path('/buyin/shopPidMemberCreate')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolLiveShare(array $params)
{
$this->builder->method('POST')
->service('buyin.kolLiveShare')
->path('/buyin/kolLiveShare')
->params($params);
}
/**
* @inheritDoc
*/
function buyinMHandleTrusteeshipApply(array $params)
{
$this->builder->method('POST')
->service('buyin.mHandleTrusteeshipApply')
->path('/buyin/mHandleTrusteeshipApply')
->params($params);
}
/**
* @inheritDoc
*/
function buyinColonel/trusteeshipList(array $params)
{
$this->builder->method('POST')
->service('buyin.colonel/trusteeshipList')
->path('/buyin/colonel/trusteeshipList')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteOrderPick(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteOrderPick')
->path('/buyin/instituteOrderPick')
->params($params);
}
/**
* @inheritDoc
*/
function buyinInstituteLivePreviewShare(array $params)
{
$this->builder->method('POST')
->service('buyin.instituteLivePreviewShare')
->path('/buyin/instituteLivePreviewShare')
->params($params);
}
/**
* @inheritDoc
*/
function buyinKolLivePreviewShare(array $params)
{
$this->builder->method('POST')
->service('buyin.kolLivePreviewShare')
->path('/buyin/kolLivePreviewShare')
->params($params);
}
/**
* @inheritDoc
*/
function buyinActivityShareConvert(array $params)
{
$this->builder->method('POST')
->service('buyin.activityShareConvert')
->path('/buyin/activityShareConvert')
->params($params);
}
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Buyin;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Buyin;
/**
* @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);
}
/**
* 创建/修改普通商品推广计划
* @link https://op.jinritemai.com/docs/api-docs/61/923
* @param array $params
* @return ResultSet
*/
function buyinSimplePlan(array $params);
/**
* 商家可参与的团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1671
* @param array $params
* @return ResultSet
*/
function buyinShopActivityList(array $params);
/**
* 商家侧获取团长活动详情
* @link https://op.jinritemai.com/docs/api-docs/61/1797
* @param array $params
* @return ResultSet
*/
function buyinShopActivityDetail(array $params);
/**
* 商品团长活动提报接口
* @link https://op.jinritemai.com/docs/api-docs/61/744
* @param array $params
* @return ResultSet
*/
function buyinApplyActivities(array $params);
/**
* 延长推广待处理/已处理记录查询
* @link https://op.jinritemai.com/docs/api-docs/61/1674
* @param array $params
* @return ResultSet
*/
function buyinActivityProductExtendList(array $params);
/**
* 商家处理团长活动商品的推广延期申请
* @link https://op.jinritemai.com/docs/api-docs/61/1673
* @param array $params
* @return ResultSet
*/
function buyinActivityProductExtendApprove(array $params);
/**
* 创建/修改商品定向计划
* @link https://op.jinritemai.com/docs/api-docs/61/708
* @param array $params
* @return ResultSet
*/
function buyinCreateOrUpdateOrienPlan(array $params);
/**
* 商品定向计划查询
* @link https://op.jinritemai.com/docs/api-docs/61/705
* @param array $params
* @return ResultSet
*/
function buyinOrienPlanList(array $params);
/**
* 商品定向计划管理
* @link https://op.jinritemai.com/docs/api-docs/61/704
* @param array $params
* @return ResultSet
*/
function buyinOrienPlanCtrl(array $params);
/**
* 查询定向计划作者列表
* @link https://op.jinritemai.com/docs/api-docs/61/1879
* @param array $params
* @return ResultSet
*/
function buyinOrienPlanAuthors(array $params);
/**
* 向指定定向计划中添加达人
* @link https://op.jinritemai.com/docs/api-docs/61/1877
* @param array $params
* @return ResultSet
*/
function buyinOrienPlanAuthorsAdd(array $params);
/**
* 定向计划达人申请审核
* @link https://op.jinritemai.com/docs/api-docs/61/1878
* @param array $params
* @return ResultSet
*/
function buyinOrienPlanAudit(array $params);
/**
* 创建/修改商品专属推广计划
* @link https://op.jinritemai.com/docs/api-docs/61/1880
* @param array $params
* @return ResultSet
*/
function buyinExclusivePlan(array $params);
/**
* 店铺专属达人管理
* @link https://op.jinritemai.com/docs/api-docs/61/1935
* @param array $params
* @return ResultSet
*/
function buyinExclusivePlanAuthorOperate(array $params);
/**
* 团长活动创建/编辑接口
* @link https://op.jinritemai.com/docs/api-docs/61/966
* @param array $params
* @return ResultSet
*/
function allianceColonelActivityCreateOrUpdate(array $params);
/**
* 创建活动时候可选择的类目接口
* @link https://op.jinritemai.com/docs/api-docs/61/1882
* @param array $params
* @return ResultSet
*/
function allianceActivityProductCategoryList(array $params);
/**
* 团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1330
* @param array $params
* @return ResultSet
*/
function allianceInstituteColonelActivityList(array $params);
/**
* 专属团长活动删除接口(下线+删除)
* @link https://op.jinritemai.com/docs/api-docs/61/972
* @param array $params
* @return ResultSet
*/
function allianceInstituteColonelActivityOperate(array $params);
/**
* 活动商品查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/968
* @param array $params
* @return ResultSet
*/
function allianceColonelActivityProduct(array $params);
/**
* 专属团长活动商品审核接口
* @link https://op.jinritemai.com/docs/api-docs/61/971
* @param array $params
* @return ResultSet
*/
function allianceColonelActivityProductAudit(array $params);
/**
* 查询团长活动特殊申请
* @link https://op.jinritemai.com/docs/api-docs/61/1552
* @param array $params
* @return ResultSet
*/
function buyinColonel/specialApplyList(array $params);
/**
* 专属团长活动商品延时接口
* @link https://op.jinritemai.com/docs/api-docs/61/1881
* @param array $params
* @return ResultSet
*/
function allianceColonelActivityProductExtension(array $params);
/**
* 团长活动特殊申请审核
* @link https://op.jinritemai.com/docs/api-docs/61/1553
* @param array $params
* @return ResultSet
*/
function buyinColonel/specialApplyDeal(array $params);
/**
* 团长可参与的二级团长活动查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1675
* @param array $params
* @return ResultSet
*/
function buyinOriginColonelEnrollableActivityList(array $params);
/**
* 获取团长活动详情
* @link https://op.jinritemai.com/docs/api-docs/61/1670
* @param array $params
* @return ResultSet
*/
function buyinColonelActivityDetail(array $params);
/**
* 团长获取可提报二级团长活动的商品列表
* @link https://op.jinritemai.com/docs/api-docs/61/1677
* @param array $params
* @return ResultSet
*/
function buyinOriginColonelUnappliedProductList(array $params);
/**
* 团长报名二级团长活动
* @link https://op.jinritemai.com/docs/api-docs/61/1672
* @param array $params
* @return ResultSet
*/
function buyinOriginColonelApplyActivities(array $params);
/**
* 一级团长查询提报活动商品
* @link https://op.jinritemai.com/docs/api-docs/61/1926
* @param array $params
* @return ResultSet
*/
function buyinActivityProductList(array $params);
/**
* 一级团长取消活动提报申请接口
* @link https://op.jinritemai.com/docs/api-docs/61/1927
* @param array $params
* @return ResultSet
*/
function buyinActivityProductCancel(array $params);
/**
* 检索精选联盟商品
* @link https://op.jinritemai.com/docs/api-docs/61/924
* @param array $params
* @return ResultSet
*/
function allianceMaterialsProductsSearch(array $params);
/**
* 商品推广 普通计划查询
* @link https://op.jinritemai.com/docs/api-docs/61/349
* @param array $params
* @return ResultSet
*/
function buyinSimplePlanList(array $params);
/**
* 批量查询推广商品详情
* @link https://op.jinritemai.com/docs/api-docs/61/1356
* @param array $params
* @return ResultSet
*/
function allianceMaterialsProductsDetails(array $params);
/**
* 查询商品 SKU
* @link https://op.jinritemai.com/docs/api-docs/61/1626
* @param array $params
* @return ResultSet
*/
function buyinProductSkus(array $params);
/**
* 类目查询
* @link https://op.jinritemai.com/docs/api-docs/61/637
* @param array $params
* @return ResultSet
*/
function allianceMaterialsProductCategory(array $params);
/**
* 商品状态查询
* @link https://op.jinritemai.com/docs/api-docs/61/1497
* @param array $params
* @return ResultSet
*/
function buyinMaterialsProductStatus(array $params);
/**
* 检索精选联盟商品,需达人授权
* @link https://op.jinritemai.com/docs/api-docs/61/1725
* @param array $params
* @return ResultSet
*/
function buyinKolMaterialsProductsSearch(array $params);
/**
* 查询达人视角商品详情
* @link https://op.jinritemai.com/docs/api-docs/61/1589
* @param array $params
* @return ResultSet
*/
function buyinKolMaterialsProductsDetails(array $params);
/**
* 【即将下线】查询机构联盟订单
* @link https://op.jinritemai.com/docs/api-docs/61/1398
* @param array $params
* @return ResultSet
*/
function buyinQueryInstituteOrders(array $params);
/**
* 查询MCN机构订单
* @link https://op.jinritemai.com/docs/api-docs/61/1602
* @param array $params
* @return ResultSet
*/
function buyinInstituteOrderMCN(array $params);
/**
* 机构查询团长订单
* @link https://op.jinritemai.com/docs/api-docs/61/1603
* @param array $params
* @return ResultSet
*/
function buyinInstituteOrderColonel(array $params);
/**
* 商品选品来源转链
* @link https://op.jinritemai.com/docs/api-docs/61/1454
* @param array $params
* @return ResultSet
*/
function buyinInstPickSourceConvert(array $params);
/**
* 机构选品GMV查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1652
* @param array $params
* @return ResultSet
*/
function buyinInstGmv(array $params);
/**
* 机构选品GMV明细查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1653
* @param array $params
* @return ResultSet
*/
function buyinInstGmvDetail(array $params);
/**
* 达人PID创建
* @link https://op.jinritemai.com/docs/api-docs/61/1460
* @param array $params
* @return ResultSet
*/
function buyinKolPidCreate(array $params);
/**
* 达人PID查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1461
* @param array $params
* @return ResultSet
*/
function buyinKolPidList(array $params);
/**
* 达人PID 编辑
* @link https://op.jinritemai.com/docs/api-docs/61/1462
* @param array $params
* @return ResultSet
*/
function buyinKolPidEdit(array $params);
/**
* 达人PID删除
* @link https://op.jinritemai.com/docs/api-docs/61/1463
* @param array $params
* @return ResultSet
*/
function buyinKolPidDel(array $params);
/**
* 商品口令转商品解析
* @link https://op.jinritemai.com/docs/api-docs/61/1726
* @param array $params
* @return ResultSet
*/
function buyinShareCommandParse(array $params);
/**
* 达人商品分销转链
* @link https://op.jinritemai.com/docs/api-docs/61/1464
* @param array $params
* @return ResultSet
*/
function buyinKolProductShare(array $params);
/**
* 机构PID创建
* @link https://op.jinritemai.com/docs/api-docs/61/1273
* @param array $params
* @return ResultSet
*/
function buyinInstitutePidCreate(array $params);
/**
* 机构PID查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/1269
* @param array $params
* @return ResultSet
*/
function buyinInstitutePidList(array $params);
/**
* 机构PID 编辑
* @link https://op.jinritemai.com/docs/api-docs/61/1270
* @param array $params
* @return ResultSet
*/
function buyinInstitutePidEdit(array $params);
/**
* 机构PID删除
* @link https://op.jinritemai.com/docs/api-docs/61/1271
* @param array $params
* @return ResultSet
*/
function buyinInstitutePidDel(array $params);
/**
* 直播间分销物料查询
* @link https://op.jinritemai.com/docs/api-docs/61/1396
* @param array $params
* @return ResultSet
*/
function buyinLiveShareMaterial(array $params);
/**
* 分销直播间商品列表
* @link https://op.jinritemai.com/docs/api-docs/61/1770
* @param array $params
* @return ResultSet
*/
function buyinDistributionLiveProductList(array $params);
/**
* 机构获取达人直播间分享链接
* @link https://op.jinritemai.com/docs/api-docs/61/1297
* @param array $params
* @return ResultSet
*/
function buyinInstituteLiveShare(array $params);
/**
* 查询抖客直播间分销订单
* @link https://op.jinritemai.com/docs/api-docs/61/1296
* @param array $params
* @return ResultSet
*/
function buyinInstituteOrderAds(array $params);
/**
* 查询达人的直播间分销、商品分销、活动页分销订单
* @link https://op.jinritemai.com/docs/api-docs/61/1459
* @param array $params
* @return ResultSet
*/
function buyinKolOrderAds(array $params);
/**
* 店铺会员绑定渠道关系创建
* @link https://op.jinritemai.com/docs/api-docs/61/1493
* @param array $params
* @return ResultSet
*/
function buyinShopPidMemberCreate(array $params);
/**
* 获取达人直播间分享链接
* @link https://op.jinritemai.com/docs/api-docs/61/1724
* @param array $params
* @return ResultSet
*/
function buyinKolLiveShare(array $params);
/**
* 团长托管商品审核
* @link https://op.jinritemai.com/docs/api-docs/61/2138
* @param array $params
* @return ResultSet
*/
function buyinMHandleTrusteeshipApply(array $params);
/**
* 团长托管商品查询
* @link https://op.jinritemai.com/docs/api-docs/61/2137
* @param array $params
* @return ResultSet
*/
function buyinColonel/trusteeshipList(array $params);
/**
* 选品订单明细查询接口
* @link https://op.jinritemai.com/docs/api-docs/61/2008
* @param array $params
* @return ResultSet
*/
function buyinInstituteOrderPick(array $params);
/**
* 机构直播预告转链
* @link https://op.jinritemai.com/docs/api-docs/61/2007
* @param array $params
* @return ResultSet
*/
function buyinInstituteLivePreviewShare(array $params);
/**
* 达人直播预告转链
* @link https://op.jinritemai.com/docs/api-docs/61/2006
* @param array $params
* @return ResultSet
*/
function buyinKolLivePreviewShare(array $params);
/**
* 活动页转链接口
* @link https://op.jinritemai.com/docs/api-docs/61/2003
* @param array $params
* @return ResultSet
*/
function buyinActivityShareConvert(array $params);
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Coupons;
namespace Lackoxygen\TiktokShop\Request\Coupons;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Coupons extends Passage implements CouponsInterface
class Coupons extends Request implements CouponsInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Coupons;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Coupons;
/**
* @note 卡券API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Crossborder;
namespace Lackoxygen\TiktokShop\Request\Crossborder;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Crossborder extends Passage implements CrossborderInterface
class Crossborder extends Request implements CrossborderInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Crossborder;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Crossborder;
/**
* @note 跨境API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Iop;
namespace Lackoxygen\TiktokShop\Request\Iop;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Iop extends Passage implements IopInterface
class Iop extends Request implements IopInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Iop;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Iop;
/**
* @note 代发API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Logistics;
namespace Lackoxygen\TiktokShop\Request\Logistics;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Logistics extends Passage implements LogisticsInterface
class Logistics extends Request implements LogisticsInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Logistics;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Logistics;
/**
* @note 物流发货API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Material;
namespace Lackoxygen\TiktokShop\Request\Material;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Material extends Passage implements MaterialInterface
class Material extends Request implements MaterialInterface
{
/**
* @inheritDoc
... ... @@ -207,6 +207,17 @@ class Material extends Passage implements MaterialInterface
/**
* @inheritDoc
*/
public function materialMGetPlayInfo(array $params)
{
$this->builder->method('POST')
->service('material.mGetPlayInfo')
->path('/material/mGetPlayInfo')
->params($params);
}
/**
* @inheritDoc
*/
public function materialEasyShuttle(array $params)
{
$this->builder->method('POST')
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Material;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Material;
/**
* @note 素材中心API
... ... @@ -154,6 +152,14 @@ interface MaterialInterface
public function materialGetCapInfo(array $params);
/**
* 批量获取视频信息
* @link https://op.jinritemai.com/docs/api-docs/69/2164
* @param array $params
* @return ResultSet
*/
public function materialMGetPlayInfo(array $params);
/**
* 一键删除
* @link https://op.jinritemai.com/docs/api-docs/69/1955
* @param array $params
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Member;
namespace Lackoxygen\TiktokShop\Request\Member;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Member extends Passage implements MemberInterface
class Member extends Request implements MemberInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Member;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Member;
/**
* @note 会员中心API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\OpenCloud;
namespace Lackoxygen\TiktokShop\Request\OpenCloud;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class OpenCloud extends Passage implements OpenCloudInterface
class OpenCloud extends Request implements OpenCloudInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\OpenCloud;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\OpenCloud;
/**
* @note 电商云API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Order;
namespace Lackoxygen\TiktokShop\Request\Order;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Order extends Passage implements OrderInterface
class Order extends Request implements OrderInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Order;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Order;
/**
* @note 订单API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\OrderCode;
namespace Lackoxygen\TiktokShop\Request\OrderCode;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class OrderCode extends Passage implements OrderCodeInterface
class OrderCode extends Request implements OrderCodeInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\OrderCode;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\OrderCode;
/**
* @note BIC质检API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Pigeon;
namespace Lackoxygen\TiktokShop\Request\Pigeon;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Pigeon extends Passage implements PigeonInterface
class Pigeon extends Request implements PigeonInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Pigeon;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Pigeon;
/**
* @note 飞鸽API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Product;
namespace Lackoxygen\TiktokShop\Request\Product;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Product extends Passage implements ProductInterface
class Product extends Request implements ProductInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Product;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Product;
/**
* @note 商品API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Recycle;
namespace Lackoxygen\TiktokShop\Request\Recycle;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Recycle extends Passage implements RecycleInterface
class Recycle extends Request implements RecycleInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Recycle;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Recycle;
/**
* @note 回收寄卖API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage;
namespace Lackoxygen\TiktokShop\Request;
use Lackoxygen\TiktokShop\Attribute\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Transmit\Builder;
use Lackoxygen\TiktokShop\Support\Client\Builder;
use Psr\Http\Message\ResponseInterface;
abstract class Passage
abstract class Request extends Config
{
protected Config $config;
/**
* @var Builder
*/
protected Builder $builder;
/**
* @param Config $config
* @param Option $config
* @param string $method
*/
public function __construct(Config $config, string $method)
public function __construct(Option $config, string $method)
{
$this->config = $config;
$this->builder = Builder::create($config, get_class($this), $method);
parent::__construct($config);
$this->builder = Builder::create(
$config,
get_class($this),
$method
);
}
/**
... ...
<?php
namespace Lackoxygen\TiktokShop\Request;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Response\ResultSet;
class RequestProxy extends Config
{
/**
* @var string
*/
protected string $request;
/**
* @param Option $config
* @param string $request
*/
protected function __construct(Option $config, string $request)
{
parent::__construct($config);
$this->request = $request;
}
/**
* @param string $request
* @param Option $config
* @return RequestProxy
*/
public static function proxy(string $request, Option $config): RequestProxy
{
return new self($config, $request);
}
/**
* @throws ClientException
*/
public function __call($name, $arguments): ResultSet
{
/**
* @var Request $request
*/
$request = new $this->request($this->config, $name);
$result = call_user_func_array([$request, $name], $arguments);
if (!is_null($result)) {
return new ResultSet($result);
}
return new ResultSet($request());
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Sms;
namespace Lackoxygen\TiktokShop\Request\Sms;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Sms extends Passage implements SmsInterface
class Sms extends Request implements SmsInterface
{
/**
* @inheritDoc
*/
public function smsTemplateapply(array $params)
{
$this->builder->method('POST')
->service('sms.template/apply')
->path('/sms/template/apply')
->params($params);
}
/**
* @inheritDoc
*/
public function smsPublictemplate(array $params)
{
$this->builder->method('POST')
->service('sms.public/template')
->path('/sms/public/template')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSignapply(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply')
->path('/sms/sign/apply')
->params($params);
}
/**
* @inheritDoc
*/
public function smsTemplaterevoke(array $params)
{
$this->builder->method('POST')
->service('sms.template/revoke')
->path('/sms/template/revoke')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSignapplylist(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply/list')
->path('/sms/sign/apply/list')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSend(array $params)
{
$this->builder->method('POST')
->service('sms.send')
->path('/sms/send')
->params($params);
}
/**
* @inheritDoc
*/
public function smsBatchSend(array $params)
{
$this->builder->method('POST')
->service('sms.batchSend')
->path('/sms/batchSend')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSigndelete(array $params)
{
$this->builder->method('POST')
->service('sms.sign/delete')
->path('/sms/sign/delete')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSignapplyrevoke(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply/revoke')
->path('/sms/sign/apply/revoke')
->params($params);
}
/**
* @inheritDoc
*/
public function smsTemplatedelete(array $params)
{
$this->builder->method('POST')
->service('sms.template/delete')
->path('/sms/template/delete')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSendResult(array $params)
{
$this->builder->method('POST')
->service('sms.sendResult')
->path('/sms/sendResult')
->params($params);
}
/**
* @inheritDoc
*/
public function smsTemplateapplylist(array $params)
{
$this->builder->method('POST')
->service('sms.template/apply/list')
->path('/sms/template/apply/list')
->params($params);
}
/**
* @inheritDoc
*/
public function smsSignsearch(array $params)
{
$this->builder->method('POST')
->service('sms.sign/search')
->path('/sms/sign/search')
->params($params);
}
/**
* @inheritDoc
*/
public function smsTemplatesearch(array $params)
{
$this->builder->method('POST')
->service('sms.template/search')
->path('/sms/template/search')
->params($params);
}
}
/**
* @inheritDoc
*/
function smsTemplate/apply(array $params)
{
$this->builder->method('POST')
->service('sms.template/apply')
->path('/sms/template/apply')
->params($params);
}
/**
* @inheritDoc
*/
function smsPublic/template(array $params)
{
$this->builder->method('POST')
->service('sms.public/template')
->path('/sms/public/template')
->params($params);
}
/**
* @inheritDoc
*/
function smsSign/apply(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply')
->path('/sms/sign/apply')
->params($params);
}
/**
* @inheritDoc
*/
function smsTemplate/revoke(array $params)
{
$this->builder->method('POST')
->service('sms.template/revoke')
->path('/sms/template/revoke')
->params($params);
}
/**
* @inheritDoc
*/
function smsSign/apply/list(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply/list')
->path('/sms/sign/apply/list')
->params($params);
}
/**
* @inheritDoc
*/
function smsSend(array $params)
{
$this->builder->method('POST')
->service('sms.send')
->path('/sms/send')
->params($params);
}
/**
* @inheritDoc
*/
function smsBatchSend(array $params)
{
$this->builder->method('POST')
->service('sms.batchSend')
->path('/sms/batchSend')
->params($params);
}
/**
* @inheritDoc
*/
function smsSign/delete(array $params)
{
$this->builder->method('POST')
->service('sms.sign/delete')
->path('/sms/sign/delete')
->params($params);
}
/**
* @inheritDoc
*/
function smsSign/apply/revoke(array $params)
{
$this->builder->method('POST')
->service('sms.sign/apply/revoke')
->path('/sms/sign/apply/revoke')
->params($params);
}
/**
* @inheritDoc
*/
function smsTemplate/delete(array $params)
{
$this->builder->method('POST')
->service('sms.template/delete')
->path('/sms/template/delete')
->params($params);
}
/**
* @inheritDoc
*/
function smsSendResult(array $params)
{
$this->builder->method('POST')
->service('sms.sendResult')
->path('/sms/sendResult')
->params($params);
}
/**
* @inheritDoc
*/
function smsTemplate/apply/list(array $params)
{
$this->builder->method('POST')
->service('sms.template/apply/list')
->path('/sms/template/apply/list')
->params($params);
}
/**
* @inheritDoc
*/
function smsSign/search(array $params)
{
$this->builder->method('POST')
->service('sms.sign/search')
->path('/sms/sign/search')
->params($params);
}
/**
* @inheritDoc
*/
function smsTemplate/search(array $params)
{
$this->builder->method('POST')
->service('sms.template/search')
->path('/sms/template/search')
->params($params);
}
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Sms;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Sms;
/**
* @note 短信API
*/
interface SmsInterface
{
/**
* 提交短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1527
* @param array $params
* @return ResultSet
*/
public function smsTemplateapply(array $params);
/**
* 公共模版查询接口
* @link https://op.jinritemai.com/docs/api-docs/163/1526
* @param array $params
* @return ResultSet
*/
public function smsPublictemplate(array $params);
/**
* 提交短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1525
* @param array $params
* @return ResultSet
*/
public function smsSignapply(array $params);
/**
* 撤销短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1524
* @param array $params
* @return ResultSet
*/
public function smsTemplaterevoke(array $params);
/**
* 查看短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1523
* @param array $params
* @return ResultSet
*/
public function smsSignapplylist(array $params);
/**
* 短信发送
* @link https://op.jinritemai.com/docs/api-docs/163/1522
* @param array $params
* @return ResultSet
*/
public function smsSend(array $params);
/**
* 批量短信发送
* @link https://op.jinritemai.com/docs/api-docs/163/1521
* @param array $params
* @return ResultSet
*/
public function smsBatchSend(array $params);
/**
* 删除短信签名
* @link https://op.jinritemai.com/docs/api-docs/163/1520
* @param array $params
* @return ResultSet
*/
public function smsSigndelete(array $params);
/**
* 撤销短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1519
* @param array $params
* @return ResultSet
*/
public function smsSignapplyrevoke(array $params);
/**
* 删除短信模板
* @link https://op.jinritemai.com/docs/api-docs/163/1518
* @param array $params
* @return ResultSet
*/
public function smsTemplatedelete(array $params);
/**
* 查询短信发送结果
* @link https://op.jinritemai.com/docs/api-docs/163/1517
* @param array $params
* @return ResultSet
*/
public function smsSendResult(array $params);
/**
* 查询短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1516
* @param array $params
* @return ResultSet
*/
public function smsTemplateapplylist(array $params);
/**
* 查看短信签名
* @link https://op.jinritemai.com/docs/api-docs/163/1515
* @param array $params
* @return ResultSet
*/
public function smsSignsearch(array $params);
/**
* 查询短信模板
* @link https://op.jinritemai.com/docs/api-docs/163/1514
* @param array $params
* @return ResultSet
*/
public function smsTemplatesearch(array $params);
}
/**
* 提交短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1527
* @param array $params
* @return ResultSet
*/
function smsTemplate/apply(array $params);
/**
* 公共模版查询接口
* @link https://op.jinritemai.com/docs/api-docs/163/1526
* @param array $params
* @return ResultSet
*/
function smsPublic/template(array $params);
/**
* 提交短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1525
* @param array $params
* @return ResultSet
*/
function smsSign/apply(array $params);
/**
* 撤销短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1524
* @param array $params
* @return ResultSet
*/
function smsTemplate/revoke(array $params);
/**
* 查看短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1523
* @param array $params
* @return ResultSet
*/
function smsSign/apply/list(array $params);
/**
* 短信发送
* @link https://op.jinritemai.com/docs/api-docs/163/1522
* @param array $params
* @return ResultSet
*/
function smsSend(array $params);
/**
* 批量短信发送
* @link https://op.jinritemai.com/docs/api-docs/163/1521
* @param array $params
* @return ResultSet
*/
function smsBatchSend(array $params);
/**
* 删除短信签名
* @link https://op.jinritemai.com/docs/api-docs/163/1520
* @param array $params
* @return ResultSet
*/
function smsSign/delete(array $params);
/**
* 撤销短信签名申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1519
* @param array $params
* @return ResultSet
*/
function smsSign/apply/revoke(array $params);
/**
* 删除短信模板
* @link https://op.jinritemai.com/docs/api-docs/163/1518
* @param array $params
* @return ResultSet
*/
function smsTemplate/delete(array $params);
/**
* 查询短信发送结果
* @link https://op.jinritemai.com/docs/api-docs/163/1517
* @param array $params
* @return ResultSet
*/
function smsSendResult(array $params);
/**
* 查询短信模板申请单
* @link https://op.jinritemai.com/docs/api-docs/163/1516
* @param array $params
* @return ResultSet
*/
function smsTemplate/apply/list(array $params);
/**
* 查看短信签名
* @link https://op.jinritemai.com/docs/api-docs/163/1515
* @param array $params
* @return ResultSet
*/
function smsSign/search(array $params);
/**
* 查询短信模板
* @link https://op.jinritemai.com/docs/api-docs/163/1514
* @param array $params
* @return ResultSet
*/
function smsTemplate/search(array $params);
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\SupplyChain;
namespace Lackoxygen\TiktokShop\Request\SupplyChain;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class SupplyChain extends Passage implements SupplyChainInterface
class SupplyChain extends Request implements SupplyChainInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\SupplyChain;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\SupplyChain;
/**
* @note 供销平台API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Token;
namespace Lackoxygen\TiktokShop\Request\Token;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Token extends Passage implements TokenInterface
class Token extends Request implements TokenInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Token;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Token;
/**
* @note 工具API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Topup;
namespace Lackoxygen\TiktokShop\Request\Topup;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Topup extends Passage implements TopupInterface
class Topup extends Request implements TopupInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Topup;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Topup;
/**
* @note 虚拟充值API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Warehouse;
namespace Lackoxygen\TiktokShop\Request\Warehouse;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Warehouse extends Passage implements WarehouseInterface
class Warehouse extends Request implements WarehouseInterface
{
/**
* @inheritDoc
*/
public function skuStockNum(array $params)
{
$this->builder->method('POST')
->service('sku.stockNum')
->path('/sku/stockNum')
->params($params);
}
/**
* @inheritDoc
*/
public function skuSyncStock(array $params)
{
$this->builder->method('POST')
->service('sku.syncStock')
->path('/sku/syncStock')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseadjustInventory(array $params)
{
$this->builder->method('POST')
->service('/warehouse/adjustInventory')
->path('/warehouse/adjustInventory')
->params($params);
}
/**
* @inheritDoc
*/
public function skuSyncStockBatch(array $params)
{
$this->builder->method('POST')
->service('sku.syncStockBatch')
->path('/sku/syncStockBatch')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseSetFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.setFence')
->path('/warehouse/setFence')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseGetFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.getFences')
->path('/warehouse/getFences')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseCreateFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.createFence')
->path('/warehouse/createFence')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseUnbindFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.unbindFences')
->path('/warehouse/unbindFences')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseRemoveAddr(array $params)
{
$this->builder->method('POST')
->service('warehouse.removeAddr')
->path('/warehouse/removeAddr')
->params($params);
}
/**
* @inheritDoc
*/
public function promiseSetSkuShipTime(array $params)
{
$this->builder->method('POST')
->service('promise.setSkuShipTime')
->path('/promise/setSkuShipTime')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseInfo(array $params)
{
$this->builder->method('POST')
->service('warehouse.info')
->path('/warehouse/info')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseEdit(array $params)
{
$this->builder->method('POST')
->service('warehouse.edit')
->path('/warehouse/edit')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseCreate(array $params)
{
$this->builder->method('POST')
->service('warehouse.create')
->path('/warehouse/create')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseSetAddr(array $params)
{
$this->builder->method('POST')
->service('warehouse.setAddr')
->path('/warehouse/setAddr')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseList(array $params)
{
$this->builder->method('POST')
->service('warehouse.list')
->path('/warehouse/list')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseSetAddrBatch(array $params)
{
$this->builder->method('POST')
->service('warehouse.setAddrBatch')
->path('/warehouse/setAddrBatch')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseCreateBatch(array $params)
{
$this->builder->method('POST')
->service('warehouse.createBatch')
->path('/warehouse/createBatch')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseSetPriority(array $params)
{
$this->builder->method('POST')
->service('warehouse.setPriority')
->path('/warehouse/setPriority')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseDelFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.delFence')
->path('/warehouse/delFence')
->params($params);
}
/**
* @inheritDoc
*/
public function warehouseBindFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.bindFences')
->path('/warehouse/bindFences')
->params($params);
}
}
/**
* @inheritDoc
*/
function skuStockNum(array $params)
{
$this->builder->method('POST')
->service('sku.stockNum')
->path('/sku/stockNum')
->params($params);
}
/**
* @inheritDoc
*/
function skuSyncStock(array $params)
{
$this->builder->method('POST')
->service('sku.syncStock')
->path('/sku/syncStock')
->params($params);
}
/**
* @inheritDoc
*/
function /warehouse/adjustInventory(array $params)
{
$this->builder->method('POST')
->service('/warehouse/adjustInventory')
->path('/warehouse/adjustInventory')
->params($params);
}
/**
* @inheritDoc
*/
function skuSyncStockBatch(array $params)
{
$this->builder->method('POST')
->service('sku.syncStockBatch')
->path('/sku/syncStockBatch')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseSetFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.setFence')
->path('/warehouse/setFence')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseGetFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.getFences')
->path('/warehouse/getFences')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseCreateFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.createFence')
->path('/warehouse/createFence')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseUnbindFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.unbindFences')
->path('/warehouse/unbindFences')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseRemoveAddr(array $params)
{
$this->builder->method('POST')
->service('warehouse.removeAddr')
->path('/warehouse/removeAddr')
->params($params);
}
/**
* @inheritDoc
*/
function promiseSetSkuShipTime(array $params)
{
$this->builder->method('POST')
->service('promise.setSkuShipTime')
->path('/promise/setSkuShipTime')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseInfo(array $params)
{
$this->builder->method('POST')
->service('warehouse.info')
->path('/warehouse/info')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseEdit(array $params)
{
$this->builder->method('POST')
->service('warehouse.edit')
->path('/warehouse/edit')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseCreate(array $params)
{
$this->builder->method('POST')
->service('warehouse.create')
->path('/warehouse/create')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseSetAddr(array $params)
{
$this->builder->method('POST')
->service('warehouse.setAddr')
->path('/warehouse/setAddr')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseList(array $params)
{
$this->builder->method('POST')
->service('warehouse.list')
->path('/warehouse/list')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseSetAddrBatch(array $params)
{
$this->builder->method('POST')
->service('warehouse.setAddrBatch')
->path('/warehouse/setAddrBatch')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseCreateBatch(array $params)
{
$this->builder->method('POST')
->service('warehouse.createBatch')
->path('/warehouse/createBatch')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseSetPriority(array $params)
{
$this->builder->method('POST')
->service('warehouse.setPriority')
->path('/warehouse/setPriority')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseDelFence(array $params)
{
$this->builder->method('POST')
->service('warehouse.delFence')
->path('/warehouse/delFence')
->params($params);
}
/**
* @inheritDoc
*/
function warehouseBindFences(array $params)
{
$this->builder->method('POST')
->service('warehouse.bindFences')
->path('/warehouse/bindFences')
->params($params);
}
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Warehouse;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Warehouse;
/**
* @note 库存API
*/
interface WarehouseInterface
{
/**
* 查询库存
* @link https://op.jinritemai.com/docs/api-docs/34/936
* @param array $params
* @return ResultSet
*/
public function skuStockNum(array $params);
/**
* 修改sku库存
* @link https://op.jinritemai.com/docs/api-docs/34/155
* @param array $params
* @return ResultSet
*/
public function skuSyncStock(array $params);
/**
* 库存调整(盘点和转移)
* @link https://op.jinritemai.com/docs/api-docs/34/760
* @param array $params
* @return ResultSet
*/
public function warehouseadjustInventory(array $params);
/**
* 批量同步接口
* @link https://op.jinritemai.com/docs/api-docs/34/298
* @param array $params
* @return ResultSet
*/
public function skuSyncStockBatch(array $params);
/**
* 修改围栏信息
* @link https://op.jinritemai.com/docs/api-docs/34/1784
* @param array $params
* @return ResultSet
*/
public function warehouseSetFence(array $params);
/**
* 获取电子围栏信息/列表
* @link https://op.jinritemai.com/docs/api-docs/34/1783
* @param array $params
* @return ResultSet
*/
public function warehouseGetFences(array $params);
/**
* 创建电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/1778
* @param array $params
* @return ResultSet
*/
public function warehouseCreateFence(array $params);
/**
* 接绑电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/1913
* @param array $params
* @return ResultSet
*/
public function warehouseUnbindFences(array $params);
/**
* 地址与区域仓解绑
* @link https://op.jinritemai.com/docs/api-docs/34/1899
* @param array $params
* @return ResultSet
*/
public function warehouseRemoveAddr(array $params);
/**
* 设置sku发货时效
* @link https://op.jinritemai.com/docs/api-docs/34/1864
* @param array $params
* @return ResultSet
*/
public function promiseSetSkuShipTime(array $params);
/**
* 查询区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1857
* @param array $params
* @return ResultSet
*/
public function warehouseInfo(array $params);
/**
* 编辑区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1856
* @param array $params
* @return ResultSet
*/
public function warehouseEdit(array $params);
/**
* 创建单个区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1855
* @param array $params
* @return ResultSet
*/
public function warehouseCreate(array $params);
/**
* 绑定单个地址到区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1859
* @param array $params
* @return ResultSet
*/
public function warehouseSetAddr(array $params);
/**
* 批量查询区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1858
* @param array $params
* @return ResultSet
*/
public function warehouseList(array $params);
/**
* 批量绑定地址与区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1861
* @param array $params
* @return ResultSet
*/
public function warehouseSetAddrBatch(array $params);
/**
* 批量创建区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1862
* @param array $params
* @return ResultSet
*/
public function warehouseCreateBatch(array $params);
/**
* 设置指定地址下的仓的优先级
* @link https://op.jinritemai.com/docs/api-docs/34/1863
* @param array $params
* @return ResultSet
*/
public function warehouseSetPriority(array $params);
/**
* 删除电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/2065
* @param array $params
* @return ResultSet
*/
public function warehouseDelFence(array $params);
/**
* 仓绑定电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/2062
* @param array $params
* @return ResultSet
*/
public function warehouseBindFences(array $params);
}
/**
* 查询库存
* @link https://op.jinritemai.com/docs/api-docs/34/936
* @param array $params
* @return ResultSet
*/
function skuStockNum(array $params);
/**
* 修改sku库存
* @link https://op.jinritemai.com/docs/api-docs/34/155
* @param array $params
* @return ResultSet
*/
function skuSyncStock(array $params);
/**
* 库存调整(盘点和转移)
* @link https://op.jinritemai.com/docs/api-docs/34/760
* @param array $params
* @return ResultSet
*/
function /warehouse/adjustInventory(array $params);
/**
* 批量同步接口
* @link https://op.jinritemai.com/docs/api-docs/34/298
* @param array $params
* @return ResultSet
*/
function skuSyncStockBatch(array $params);
/**
* 修改围栏信息
* @link https://op.jinritemai.com/docs/api-docs/34/1784
* @param array $params
* @return ResultSet
*/
function warehouseSetFence(array $params);
/**
* 获取电子围栏信息/列表
* @link https://op.jinritemai.com/docs/api-docs/34/1783
* @param array $params
* @return ResultSet
*/
function warehouseGetFences(array $params);
/**
* 创建电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/1778
* @param array $params
* @return ResultSet
*/
function warehouseCreateFence(array $params);
/**
* 接绑电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/1913
* @param array $params
* @return ResultSet
*/
function warehouseUnbindFences(array $params);
/**
* 地址与区域仓解绑
* @link https://op.jinritemai.com/docs/api-docs/34/1899
* @param array $params
* @return ResultSet
*/
function warehouseRemoveAddr(array $params);
/**
* 设置sku发货时效
* @link https://op.jinritemai.com/docs/api-docs/34/1864
* @param array $params
* @return ResultSet
*/
function promiseSetSkuShipTime(array $params);
/**
* 查询区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1857
* @param array $params
* @return ResultSet
*/
function warehouseInfo(array $params);
/**
* 编辑区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1856
* @param array $params
* @return ResultSet
*/
function warehouseEdit(array $params);
/**
* 创建单个区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1855
* @param array $params
* @return ResultSet
*/
function warehouseCreate(array $params);
/**
* 绑定单个地址到区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1859
* @param array $params
* @return ResultSet
*/
function warehouseSetAddr(array $params);
/**
* 批量查询区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1858
* @param array $params
* @return ResultSet
*/
function warehouseList(array $params);
/**
* 批量绑定地址与区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1861
* @param array $params
* @return ResultSet
*/
function warehouseSetAddrBatch(array $params);
/**
* 批量创建区域仓
* @link https://op.jinritemai.com/docs/api-docs/34/1862
* @param array $params
* @return ResultSet
*/
function warehouseCreateBatch(array $params);
/**
* 设置指定地址下的仓的优先级
* @link https://op.jinritemai.com/docs/api-docs/34/1863
* @param array $params
* @return ResultSet
*/
function warehouseSetPriority(array $params);
/**
* 删除电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/2065
* @param array $params
* @return ResultSet
*/
function warehouseDelFence(array $params);
/**
* 仓绑定电子围栏
* @link https://op.jinritemai.com/docs/api-docs/34/2062
* @param array $params
* @return ResultSet
*/
function warehouseBindFences(array $params);
}
\ No newline at end of file
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Yunc;
namespace Lackoxygen\TiktokShop\Request\Yunc;
use Lackoxygen\TiktokShop\Passage\Passage;
use Lackoxygen\TiktokShop\Request\Request;
class Yunc extends Passage implements YuncInterface
class Yunc extends Request implements YuncInterface
{
/**
* @inheritDoc
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage\Yunc;
use Lackoxygen\TiktokShop\Passage\ResultSet;
namespace Lackoxygen\TiktokShop\Request\Yunc;
/**
* @note 仓库作业API
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage;
namespace Lackoxygen\TiktokShop\Response;
use Lackoxygen\TiktokShop\Util\Json;
use GuzzleHttp\Psr7\Response;
use Illuminate\Support\Arr;
use Lackoxygen\TiktokShop\Util\Json;
class ResultSet
{
/**
* @var array|mixed
*/
protected array $items = [];
protected $result;
/**
* @var Response
*/
protected Response $response;
public function __construct($result)
/**
* @param Response $response
*/
public function __construct(Response $response)
{
$this->result = $result;
$this->response = $response;
if ($this->isResponse()) {
$this->items = Json::unmarshal($result->getBody()->getContents());
} else {
$this->items = is_array($result) ? $result : [$result];
}
}
protected function isResponse(): bool
{
return $this->result instanceof Response;
}
public function toArray(): array
{
return $this->items;
$this->items = Json::unmarshal($response->getBody()->getContents());
}
/**
* @return bool
*/
public function isSuccess(): bool
{
$array = $this->toArray();
if ($this->isResponse()) {
return 10000 === $array['code'];
}
return true === Arr::first($array);
return 10000 === $array['code'];
}
/**
* @return string
*/
public function getMessage(): string
{
$array = $this->toArray();
... ... @@ -52,6 +48,9 @@ class ResultSet
return (string)$array['message'] ?? '';
}
/**
* @return array
*/
public function getData(): array
{
$array = $this->toArray();
... ... @@ -59,8 +58,41 @@ class ResultSet
return (array)Arr::get($array, 'data', []);
}
public function get(string $key, $default = '')
/**
* @param string $key
* @param string $default
* @return array|\ArrayAccess|mixed
*/
public function get(string $key, string $default = '')
{
return Arr::get($this->getData(), $key, $default);
}
/**
* @return array
*/
public function toArray(): array
{
return $this->items;
}
/**
* @return false|string
*/
public function toJson()
{
return Json::marshal($this->toArray());
}
/**
* @return string
*/
public function raw(): string
{
$body = $this->response->getBody();
$body->rewind();
return $body->getContents();
}
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Lackoxygen\TiktokShop\Util\Json;
class Factory
{
protected \Closure $callback;
public function __construct(\Closure $callback)
{
$this->callback = $callback;
}
public function load(string $raw)
{
if (!$raw) {
return;
}
$array = Json::unmarshal($raw);
$callback = $this->callback;
foreach ($array as $row) {
$callback($this->create($row));
}
}
protected function create($row)
{
return unserialize($row);
}
}
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Carbon\Carbon;
use Lackoxygen\TiktokShop\Contracts\SessionInterface;
class Session implements SessionInterface
{
use Swap;
protected Store $store;
protected string $index = '';
protected string $appKey = '';
public function __construct(string $appKey, Store $store)
{
$this->appKey = $appKey;
$this->store = $store;
$this->index = $this->id();
}
public function id(): string
{
return md5(serialize($this->store));
}
public function unEffective(): bool
{
return !$this->effective();
}
public function effective(): bool
{
return $this->store->getExpiredAt()->gt(Carbon::now());
}
public function discard()
{
$this->store->setExpiredAt(Carbon::now()->subMinutes(30));
}
public function watch(): bool
{
return $this->index !== $this->id();
}
public function appKey(): string
{
return $this->appKey;
}
}
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Lackoxygen\TiktokShop\Contracts\SessionInterface;
use Lackoxygen\TiktokShop\Util\Json;
class SessionHeart
{
protected static ?SessionHeart $sessionHeart = null;
public function __construct()
{
SessionMemory::init();
}
public static function new(): SessionHeart
{
if (is_null(static::$sessionHeart)) {
static::$sessionHeart = new static();
}
return static::$sessionHeart;
}
public function keepalive()
{
SessionMemory::each(function (SessionInterface $session) {
if ($session->effective()) {
return;
}
$session->refresh();
});
}
public function __destruct()
{
$watch = false;
$serializes = [];
SessionMemory::each(function (SessionInterface $session) use (&$watch, &$serializes) {
$serializes[] = serialize($session);
if (!$watch && $session->watch()) {
$watch = true;
}
});
if ($watch) {
SessionMemory::persistence(Json::marshal($serializes));
}
}
}
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Lackoxygen\TiktokShop\Contracts\SessionInterface;
class SessionMemory
{
/**
* @var Session [] $sessions
*/
protected static array $sessions = [];
/**
* @var string
*/
protected static string $cachePrefix = 'tiktok.shop:session:';
protected static function cache()
{
static $cacheManager;
if (is_null($cacheManager)) {
$cacheManager = app('cache');
}
return $cacheManager;
}
public static function init()
{
$factory = new Factory(function (Session $session) {
static::$sessions[$session->appKey()] = $session;
});
if ($raw = static::persistence()) {
$factory->load($raw);
}
}
public static function persistence()
{
$key = static::$cachePrefix . 'keepalive_table';
try {
if (func_get_args()) {
static::cache()->set($key, func_get_arg(0));
} else {
$raw = static::cache()->get($key);
if (is_null($raw)) {
return null;
}
return $raw;
}
} catch (\Exception $e) {
}
}
public static function each(\Closure $callback)
{
foreach (static::$sessions as $session) {
$callback($session);
}
}
public static function get(string $appKey = null)
{
if (is_null($appKey)) {
return static::$sessions;
}
return static::exist($appKey) ? static::$sessions[$appKey] : null;
}
public static function exist(string $appKey): bool
{
return array_key_exists($appKey, static::$sessions);
}
public static function put(SessionInterface $session, $force = true)
{
if (static::exist($session->appKey()) && !$force) {
return;
}
static::$sessions[$session->appKey()] = $session;
}
}
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Carbon\Carbon;
use Illuminate\Queue\SerializesModels;
class Store
{
use SerializesModels;
/**
* The ID.
*
* @var string
*/
protected string $id;
/**
* The access token.
*
* @var string
*/
protected string $accessToken;
/**
* The refresh token.
*
* @var string
*/
protected string $refreshToken;
/**
* The created at.
*
* @var Carbon
*/
protected Carbon $createdAt;
/**
* The expired at.
*
* @var Carbon
*/
protected Carbon $expiredAt;
/**
* The expires in.
*
* @var int
*/
protected int $expiresIn;
/**
* the more data.
*
* @var array
*/
protected array $extras = [];
/**
* the refresh num.
*
* @var int
*/
protected int $refreshNum = 0;
/**
* @return string
*/
public function getId(): string
{
return $this->id;
}
/**
* @param string $id
*/
public function setId(string $id): void
{
$this->id = $id;
}
/**
* @return string
*/
public function getAccessToken(): string
{
return $this->accessToken;
}
/**
* @param string $accessToken
*/
public function setAccessToken(string $accessToken): void
{
$this->accessToken = $accessToken;
}
/**
* @return string
*/
public function getRefreshToken(): string
{
return $this->refreshToken;
}
/**
* @param string $refreshToken
*/
public function setRefreshToken(string $refreshToken): void
{
$this->refreshToken = $refreshToken;
}
/**
* @return Carbon
*/
public function getCreatedAt(): Carbon
{
return $this->createdAt;
}
/**
* @param Carbon $createdAt
*/
public function setCreatedAt(Carbon $createdAt): void
{
$this->createdAt = $createdAt;
}
/**
* @return Carbon
*/
public function getExpiredAt(): Carbon
{
return $this->expiredAt;
}
/**
* @param Carbon $expiredAt
*/
public function setExpiredAt(Carbon $expiredAt): void
{
$this->expiredAt = $expiredAt;
}
/**
* @return int
*/
public function getExpiresIn(): int
{
return $this->expiresIn;
}
/**
* @param int $expiresIn
*/
public function setExpiresIn(int $expiresIn): void
{
$this->expiresIn = $expiresIn;
}
/**
* @return array
*/
public function getExtras(): array
{
return $this->extras;
}
/**
* @param array $extras
*/
public function setExtras(array $extras): void
{
$this->extras = $extras;
}
/**
* @return int
*/
public function getRefreshNum(): int
{
return $this->refreshNum;
}
/**
* @param int $refreshNum
*/
public function setRefreshNum(int $refreshNum): void
{
$this->refreshNum = $refreshNum;
}
}
<?php
namespace Lackoxygen\TiktokShop\Supervisor\Session;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Passage\ResultSet;
trait Swap
{
public function refresh()
{
$app = app('tiktok.shop');
try {
/**
* @var ResultSet $result
*/
$result = $app->authorize->refresh($this->store->getRefreshToken());
if ($result->isSuccess()) {
$this->store->setAccessToken($result->get('access_token'));
$this->store->setRefreshToken($result->get('refresh_token'));
$this->store->setRefreshNum($this->store->getRefreshNum() + 1);
$this->store->setCreatedAt(now());
$this->store->setExpiredAt(now()->addMicroseconds($result->get('expired_in')));
}
} catch (ClientException $exception) {
$this->discard();
}
}
}
<?php
namespace Lackoxygen\TiktokShop\Transmit;
namespace Lackoxygen\TiktokShop\Support\Client;
use Lackoxygen\TiktokShop\Attribute\Config;
use GuzzleHttp\Exception\GuzzleException;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Attribute\Request;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Mock\Mock;
use GuzzleHttp\Exception\GuzzleException;
use Psr\Http\Message\ResponseInterface;
class Builder
class Builder extends Config
{
protected Request $request;
protected Config $config;
/**
* @var Request
*/
protected Request $requestHandler;
protected string $passage;
/**
* @var string
*/
protected string $request;
/**
* @var string
*/
protected string $method;
public function __construct(Config $config, string $passage, string $method)
public function __construct(Option $config, string $request, string $method)
{
$this->request = new Request();
$this->config = $config;
$this->request->setConfig($config);
$this->passage = $passage;
parent::__construct($config);
$this->requestHandler = new Request($config);
$this->request = $request;
$this->method = $method;
}
public static function create(Config $config, string $passage, string $method): Builder
/**
* @param Option $config
* @param string $passage
* @param string $method
* @return Builder
*/
public static function create(Option $config, string $passage, string $method): Builder
{
return new static(...func_get_args());
}
/**
* @param string $method
* @return $this
*/
public function method(string $method): Builder
{
$this->request->setMethod($method);
$this->requestHandler->setMethod($method);
return $this;
}
/**
* @param array $params
* @return $this
*/
public function params(array $params): Builder
{
$this->request->setParams($params);
$this->requestHandler->setParams($params);
return $this;
}
/**
* @param string $v
* @return $this
*/
public function v(string $v): Builder
{
$this->request->setV($v);
$this->requestHandler->setV($v);
return $this;
}
/**
* @param $timestamp
* @return $this
*/
public function timestamp($timestamp): Builder
{
$this->request->setTimestamp($timestamp);
$this->requestHandler->setTimestamp($timestamp);
return $this;
}
/**
* @param string|null $service
* @return $this
*/
public function service(?string $service): Builder
{
$this->request->setService($service);
$this->requestHandler->setService($service);
return $this;
}
/**
* @param bool $signature
* @return $this
*/
public function signature(bool $signature): Builder
{
$this->request->setSignature($signature);
$this->requestHandler->setSignature($signature);
return $this;
}
/**
* @param string $path
* @return $this
*/
public function path(string $path): Builder
{
$this->request->setPath($path);
$this->requestHandler->setPath($path);
return $this;
}
... ... @@ -80,7 +121,7 @@ class Builder
*/
public function getRequest(): Request
{
return $this->request;
return $this->requestHandler;
}
/**
... ... @@ -91,11 +132,11 @@ class Builder
{
$client = Client::create();
if ($this->config->isEnableMock()) {
$mock = new Mock($this->passage, $this->method);
$mock = new Mock($this->request, $this->method);
return $mock->response();
}
try {
return $client->request($this->request);
return $client->request($this->requestHandler);
} catch (GuzzleException $e) {
throw new ClientException($e);
}
... ...
<?php
namespace Lackoxygen\TiktokShop\Transmit;
namespace Lackoxygen\TiktokShop\Support\Client;
use Lackoxygen\TiktokShop\Attribute\Config;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ServerException;
use GuzzleHttp\RequestOptions;
use Illuminate\Support\Str;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Attribute\Request;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Exception\RetryException;
use Lackoxygen\TiktokShop\Util\Json;
use Lackoxygen\TiktokShop\Util\Signature;
use Lackoxygen\TiktokShop\Util\Sort;
use GuzzleHttp\Exception\ConnectException;
use GuzzleHttp\Exception\ServerException;
use GuzzleHttp\RequestOptions;
use Illuminate\Support\Str;
use Psr\Http\Message\ResponseInterface;
class Client
{
/**
* @return Client
*/
public static function create(): Client
{
return new self();
... ... @@ -74,6 +77,10 @@ class Client
];
}
/**
* @param Request $request
* @return array
*/
protected function withQuery(Request $request): array
{
return [
... ... @@ -82,7 +89,11 @@ class Client
];
}
public function guzzleHttp(Config $config): \GuzzleHttp\Client
/**
* @param Option $config
* @return \GuzzleHttp\Client
*/
public function guzzleHttp(Option $config): \GuzzleHttp\Client
{
return new \GuzzleHttp\Client([
'base_uri' => $config->getBaseUri(),
... ...
<?php
namespace Lackoxygen\TiktokShop\Transmit;
namespace Lackoxygen\TiktokShop\Support\Client;
use Lackoxygen\TiktokShop\Exception\ClientException;
use Lackoxygen\TiktokShop\Exception\RetryException;
class Retry
{
/**
* @var \Closure
*/
protected \Closure $execute;
/**
* @var \Closure
*/
protected \Closure $when;
/**
... ...
<?php
namespace Lackoxygen\TiktokShop\Passage;
namespace Lackoxygen\TiktokShop\Support;
class Verify extends Passage
use Lackoxygen\TiktokShop\Attribute\Config\Config;
class Verify extends Config
{
/**
* @param $sign
* @param string $body
* @return bool
*/
public function md5($sign, string $body): bool
{
$md5 = md5($this->config->getAppKey() .
$md5 = md5(
$this->config->getAppKey() .
$body .
$this->config->getAppSecret());
$this->config->getAppSecret()
);
return $md5 === $sign;
}
}
... ...
... ... @@ -3,47 +3,48 @@
namespace Lackoxygen\TiktokShop;
use Illuminate\Support\Arr;
use Lackoxygen\TiktokShop\Attribute\Config;
use Lackoxygen\TiktokShop\Passage\PassageProxy;
use Lackoxygen\TiktokShop\Passage\Verify;
use Lackoxygen\TiktokShop\Attribute\Config\Config;
use Lackoxygen\TiktokShop\Attribute\Config\Option;
use Lackoxygen\TiktokShop\Request\RequestProxy;
use Lackoxygen\TiktokShop\Support\Verify;
/**
* @method Verify verify()
* @method Passage\Pigeon\PigeonInterface pigeon()
* @method Passage\Sms\SmsInterface sms()
* @method Passage\SupplyChain\SupplyChainInterface supplyChain()
* @method Passage\Topup\TopupInterface topup()
* @method Passage\OpenCloud\OpenCloudInterface openCloud()
* @method Passage\Btas\BtasInterface btas()
* @method Passage\Recycle\RecycleInterface recycle()
* @method Passage\Member\MemberInterface member()
* @method Passage\Buyin\BuyinInterface buyin()
* @method Passage\Yunc\YuncInterface yunc()
* @method Passage\OrderCode\OrderCodeInterface orderCode()
* @method Passage\Coupons\CouponsInterface coupons()
* @method Passage\Crossborder\CrossborderInterface crossborder()
* @method Passage\Iop\IopInterface iop()
* @method Passage\Antispam\AntispamInterface antispam()
* @method Passage\Token\TokenInterface token()
* @method Passage\Order\OrderInterface order()
* @method Passage\AfterSale\AfterSaleInterface afterSale()
* @method Passage\Logistics\LogisticsInterface logistics()
* @method Passage\Warehouse\WarehouseInterface warehouse()
* @method Passage\Product\ProductInterface product()
* @method Passage\Material\MaterialInterface material()
* @method Passage\Address\AddressInterface address()
* @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
{
/**
* @var Config
* @var Option
*/
protected Config $config;
protected Option $config;
/**
* @var array|string[]
*/
protected array $fixedPassages = [
protected array $fixedPriority = [
'verify' => Verify::class
];
... ... @@ -76,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'),
... ... @@ -113,40 +114,45 @@ class TiktokShop
/**
* @param string $name
* @return string
* @return RequestProxy|object
*/
private function guide(string $name): string
private function guide(string $name)
{
if (isset($this->fixedPassages[$name])) {
return $this->fixedPassages[$name];
if (array_key_exists($name, $this->fixedPriority)) {
return new $this->fixedPriority[$name]($this->config);
}
$name = ucfirst($name);
$target = '\Lackoxygen\TiktokShop\Passage\\' . $name . '\\' . $name;
$request = '\Lackoxygen\TiktokShop\Request\\' . $name . '\\' . $name;
if (!class_exists($target)) {
throw new \OverflowException('class file(' . $target . ') not found');
if (!class_exists($request)) {
throw new \OverflowException('class file(' . $request . ') not found');
}
return $target;
return RequestProxy::proxy($request, $this->config);
}
/**
* @param $name
* @param array $arguments
*
* @return PassageProxy
* @return RequestProxy
*/
public function __call($name, array $arguments = [])
{
$passage = $this->guide($name);
try {
return PassageProxy::proxy($passage, $this->config);
} finally {
register_shutdown_function(function () {
$this->config->setAccessToken('');
});
$guide = $this->guide($name);
if ($guide instanceof RequestProxy) {
try {
return $guide;
} finally {
register_shutdown_function(function () {
$this->config->setAccessToken('');
});
}
}
return call_user_func_array([$guide, $name], $arguments);
}
}
... ...
... ... @@ -3,8 +3,6 @@
namespace Lackoxygen\TiktokShop;
use Illuminate\Support\ServiceProvider;
use Lackoxygen\TiktokShop\Command\RefreshToken;
use Release;
class TiktokShopProvider extends ServiceProvider
{
... ... @@ -16,9 +14,7 @@ class TiktokShopProvider extends ServiceProvider
/**
* @var array|string[]
*/
protected array $commands = [
RefreshToken::class
];
protected array $commands = [];
/**
* @return void
... ...