完善 注释

This commit is contained in:
zhouchangcheng 2024-05-27 16:03:31 +08:00
parent 186e05311e
commit 35e0df7d33
5 changed files with 41 additions and 6 deletions

View File

@ -4,6 +4,7 @@
use App\helpers\apiRequest;
use App\Models\Notice;
use Exception;
use GuzzleHttp\Exception\GuzzleException;
use Illuminate\Console\Command;
use Illuminate\Contracts\Console\Isolatable;
@ -32,7 +33,7 @@ class HandleNotice extends Command implements Isolatable
*/
public function __construct()
{
parent::__construct();;
parent::__construct();
}
/**
@ -45,7 +46,7 @@ public function handle(): int
{
$chunk = $this->argument('chunk');
$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') {
$this->error('request err: ' . $res['desc'] ?? '');
return 1;
@ -84,7 +85,7 @@ public function handle(): int
}
try {
Notice::insert($notices);
} catch (\Exception $exception) {
} catch (Exception $exception) {
$this->error('insert err:' . $exception->getMessage());
continue;
}

View File

@ -144,6 +144,10 @@ public function addGoods(): void
}
}
/**
* @throws GuzzleException
* @throws Exception
*/
public function updateGoods(): void
{
$this->client = new Client();

View File

@ -5,6 +5,18 @@
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
*/
class Good extends Base

View File

@ -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
*/
class GoodsItem extends Base

View File

@ -2,9 +2,14 @@
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
{
}