You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
915 B
39 lines
915 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Controller;
|
|
|
|
use App\Service\ShopCarService;
|
|
use Hyperf\Di\Annotation\Inject;
|
|
use App\Service\ShopCarServiceInterface;
|
|
use App\Constants\ErrorCode;
|
|
class ShopCarController extends BaseController
|
|
{
|
|
|
|
/**
|
|
* @Inject
|
|
* @var ShopCarServiceInterface
|
|
*/
|
|
protected $shopCarService;
|
|
|
|
|
|
public function addShopCar()
|
|
{
|
|
$res = $this->shopCarService->addShopCar($this->request->all());
|
|
if (isset($res['error'])) {
|
|
return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
|
|
}
|
|
return $this->success($res);
|
|
}
|
|
|
|
public function updateShopCar()
|
|
{
|
|
$res = $this->shopCarService->updateShopCar($this->request->all());
|
|
if (isset($res['error'])) {
|
|
return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
|
|
}
|
|
return $this->success($res);
|
|
}
|
|
|
|
}
|