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.
44 lines
1.0 KiB
44 lines
1.0 KiB
<?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 (isset($res['error'])) {
|
|
return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
|
|
}
|
|
return $this->success($res);
|
|
}
|
|
|
|
public function updateShopCar()
|
|
{
|
|
$res = $this->purchaseLimitService->updateShopCar($this->request->all());
|
|
if (isset($res['error'])) {
|
|
return $this->result(ErrorCode::GOODS_FAILURE, '', $res['error']);
|
|
}
|
|
return $this->success($res);
|
|
}
|
|
|
|
public function test()
|
|
{
|
|
$res = $this->purchaseLimitService->test($this->request->all());
|
|
return $this->success($res);
|
|
}
|
|
|
|
}
|