|
|
|
@ -0,0 +1,29 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
declare(strict_types=1); |
|
|
|
|
|
|
|
namespace App\Controller; |
|
|
|
|
|
|
|
use Hyperf\Di\Annotation\Inject; |
|
|
|
use App\Service\PurchaseLimitServiceInterface; |
|
|
|
use App\Constants\ErrorCode; |
|
|
|
class PurchaseLimitController extends BaseController |
|
|
|
{ |
|
|
|
|
|
|
|
/** |
|
|
|
* @Inject |
|
|
|
* @var PurchaseLimitServiceInterface |
|
|
|
*/ |
|
|
|
protected $purchaseLimitService; |
|
|
|
|
|
|
|
|
|
|
|
public function addShopCar() |
|
|
|
{ |
|
|
|
$res = $this->purchaseLimitService->addShopCar($this->request->all()); |
|
|
|
if (!$res) { |
|
|
|
return $this->result(ErrorCode::GOODS_FAILURE, '', '商品已超过购买数量'); |
|
|
|
} |
|
|
|
return $this->success($res); |
|
|
|
} |
|
|
|
|
|
|
|
} |