60 lines
1.2 KiB
PHP
60 lines
1.2 KiB
PHP
<?php
|
|
namespace App\Services\Platform;
|
|
|
|
use App\Models\ShopAuth;
|
|
use Illuminate\Support\Facades\Http;
|
|
use Illuminate\Support\Facades\Log;
|
|
|
|
class KuaishouClient
|
|
{
|
|
protected $shopAuth;
|
|
protected $appKey;
|
|
protected $appSecret;
|
|
|
|
public function __construct(ShopAuth $shopAuth)
|
|
{
|
|
$this->shopAuth = $shopAuth;
|
|
$this->appKey = config('platforms.kuaishou.app_key');
|
|
$this->appSecret = config('platforms.kuaishou.app_secret');
|
|
}
|
|
|
|
/**
|
|
* 拉取订单列表(待实现)
|
|
*
|
|
* @param array $params
|
|
* @return array
|
|
*/
|
|
public function getOrders(array $params = [])
|
|
{
|
|
Log::warning('快手订单拉取尚未实现');
|
|
return [];
|
|
}
|
|
|
|
protected function refreshToken()
|
|
{
|
|
// TODO: 实现快手 token 刷新
|
|
}
|
|
|
|
protected function ensureToken()
|
|
{
|
|
if ($this->shopAuth->expires_at && $this->shopAuth->expires_at->isPast()) {
|
|
$this->refreshToken();
|
|
}
|
|
}
|
|
|
|
protected function generateSign($params)
|
|
{
|
|
// TODO: 实现快手签名算法
|
|
return '';
|
|
}
|
|
|
|
protected function transformOrders($orders)
|
|
{
|
|
return [];
|
|
}
|
|
|
|
protected function transformItems($items)
|
|
{
|
|
return [];
|
|
}
|
|
} |