完善 注释
This commit is contained in:
parent
186e05311e
commit
35e0df7d33
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
use App\helpers\apiRequest;
|
use App\helpers\apiRequest;
|
||||||
use App\Models\Notice;
|
use App\Models\Notice;
|
||||||
|
use Exception;
|
||||||
use GuzzleHttp\Exception\GuzzleException;
|
use GuzzleHttp\Exception\GuzzleException;
|
||||||
use Illuminate\Console\Command;
|
use Illuminate\Console\Command;
|
||||||
use Illuminate\Contracts\Console\Isolatable;
|
use Illuminate\Contracts\Console\Isolatable;
|
||||||
|
@ -32,7 +33,7 @@ class HandleNotice extends Command implements Isolatable
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();;
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +46,7 @@ public function handle(): int
|
||||||
{
|
{
|
||||||
$chunk = $this->argument('chunk');
|
$chunk = $this->argument('chunk');
|
||||||
$this->info(date('Y-m-d H:i:s') . ' 开始消息队列');
|
$this->info(date('Y-m-d H:i:s') . ' 开始消息队列');
|
||||||
$res = apiRequest::api('/Notic/getNotics', []);
|
$res = apiRequest::api('/Notic/getNotics');
|
||||||
if (!$res['result'] || $res['errCode'] != '0000') {
|
if (!$res['result'] || $res['errCode'] != '0000') {
|
||||||
$this->error('request err: ' . $res['desc'] ?? '');
|
$this->error('request err: ' . $res['desc'] ?? '');
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -84,7 +85,7 @@ public function handle(): int
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Notice::insert($notices);
|
Notice::insert($notices);
|
||||||
} catch (\Exception $exception) {
|
} catch (Exception $exception) {
|
||||||
$this->error('insert err:' . $exception->getMessage());
|
$this->error('insert err:' . $exception->getMessage());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,6 +144,10 @@ public function addGoods(): void
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws GuzzleException
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
public function updateGoods(): void
|
public function updateGoods(): void
|
||||||
{
|
{
|
||||||
$this->client = new Client();
|
$this->client = new Client();
|
||||||
|
|
|
@ -5,6 +5,18 @@
|
||||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @property int $itemid
|
||||||
|
* @property int $typeid
|
||||||
|
* @property string $product_name
|
||||||
|
* @property string $product_code
|
||||||
|
* @property string $product_group
|
||||||
|
* @property float $market_price
|
||||||
|
* @property float $settlement
|
||||||
|
* @property int $category_id
|
||||||
|
* @property string $category_name
|
||||||
|
* @property int $state
|
||||||
|
* @property string $created_at
|
||||||
|
* @property string $updated_at
|
||||||
* @property GoodsItem $item
|
* @property GoodsItem $item
|
||||||
*/
|
*/
|
||||||
class Good extends Base
|
class Good extends Base
|
||||||
|
|
|
@ -6,6 +6,19 @@
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @property int $item_id
|
||||||
|
* @property string $brand
|
||||||
|
* @property string $color_name
|
||||||
|
* @property string $sell_point
|
||||||
|
* @property string $specifications
|
||||||
|
* @property string $shop_url
|
||||||
|
* @property string $product_images
|
||||||
|
* @property string $images
|
||||||
|
* @property string $product_infos
|
||||||
|
* @property string $app_introduce
|
||||||
|
* @property string $applet_introduce
|
||||||
|
* @property string $created_at
|
||||||
|
* @property string $updated_at
|
||||||
* @property Good $good
|
* @property Good $good
|
||||||
*/
|
*/
|
||||||
class GoodsItem extends Base
|
class GoodsItem extends Base
|
||||||
|
|
|
@ -2,9 +2,14 @@
|
||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
/**
|
||||||
use Illuminate\Database\Eloquent\Model;
|
* @property int $notice_id
|
||||||
|
* @property int $notice_type
|
||||||
|
* @property string $raw_content
|
||||||
|
* @property int $state
|
||||||
|
* @property string $created_at
|
||||||
|
* @property string $updated_at
|
||||||
|
*/
|
||||||
class Notice extends Base
|
class Notice extends Base
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user