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.
38 lines
955 B
38 lines
955 B
<?php
|
|
|
|
namespace App\Service\v3\Implementations;
|
|
|
|
use App\Constants\v3\ErrorCode;
|
|
use App\Exception\ErrorCodeException;
|
|
use App\Service\v3\Interfaces\UpdateShopCartServiceInterface;
|
|
|
|
class UpdateShopCartService implements UpdateShopCartServiceInterface
|
|
{
|
|
public function do($params)
|
|
{
|
|
switch ($params['goods_id'])
|
|
{
|
|
case 1000:
|
|
throw new ErrorCodeException(ErrorCode::GOODS_INVENTORY_ERROR);
|
|
break;
|
|
case 2000:
|
|
throw new ErrorCodeException(ErrorCode::PURCHASE_LIMIT_ERROR);
|
|
break;
|
|
case 3000:
|
|
throw new ErrorCodeException(ErrorCode::SPERCIAL_OFFER_GOODS_ERROR);
|
|
break;
|
|
default:
|
|
return true;
|
|
}
|
|
}
|
|
|
|
public function check()
|
|
{
|
|
// TODO: Implement check() method.
|
|
}
|
|
|
|
public function undo()
|
|
{
|
|
// TODO: Implement undo() method.
|
|
}
|
|
}
|