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
933 B

<?php
namespace App\Service\v3\Implementations;
use App\Constants\v3\ErrorCode;
use App\Exception\ErrorCodeException;
use App\Service\v3\Interfaces\ShopCartUpdateServiceInterface;
class ShopCartUpdateService implements ShopCartUpdateServiceInterface
{
public function do($params)
{
switch ($params['goods_id'])
{
case 1000:
throw new ErrorCodeException(ErrorCode::GOODS_INVENTORY_ERROR);
break;
case 2000:
throw new ErrorCodeException(ErrorCode::GOODS_RESTRICT_LIMIT);
break;
case 3000:
throw new ErrorCodeException(ErrorCode::GOODS_ACTIVITY_BUY);
break;
default:
return true;
}
}
public function check()
{
// TODO: Implement check() method.
}
public function undo($params)
{
return true;
}
}