Browse Source
Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix
master
Merge branch 'phoenix' of ssh://120.24.33.109:11022/hyzjshwo/lanzu_api_hyperf into phoenix
master
14 changed files with 200 additions and 28 deletions
-
6app/Constants/v3/ErrorCode.php
-
2app/Constants/v3/OrderState.php
-
10app/Controller/v3/ShopCartController.php
-
7app/Controller/v3/ShopCartUpdateController.php
-
10app/JsonRpc/SeparateAccountsServiceInterface.php
-
28app/JsonRpc/SeparateaccountsService.php
-
44app/Request/v3/ShopCartUpdateRequest.php
-
5app/Service/v3/Implementations/GoodsService.php
-
75app/Service/v3/Implementations/ShopCartService.php
-
9app/Service/v3/Implementations/ShopCartUpdateService.php
-
24app/Service/v3/Implementations/StoreService.php
-
4app/Service/v3/Interfaces/ShopCartServiceInterface.php
-
2app/Service/v3/Interfaces/ShopCartUpdateServiceInterface.php
-
2app/Service/v3/Interfaces/StoreServiceInterface.php
@ -0,0 +1,10 @@ |
|||
<?php |
|||
|
|||
|
|||
namespace App\JsonRpc; |
|||
|
|||
|
|||
interface SeparateAccountsServiceInterface |
|||
{ |
|||
public function orderOnlineCompleted($orderMainId, $userId); |
|||
} |
|||
@ -0,0 +1,28 @@ |
|||
<?php |
|||
|
|||
|
|||
namespace App\JsonRpc; |
|||
|
|||
use Hyperf\RpcServer\Annotation\RpcService; |
|||
|
|||
use Hyperf\Di\Annotation\Inject; |
|||
/** |
|||
* @RpcService(name="SeparateaccountsService", protocol="jsonrpc-http", server="jsonrpc-http", publishTo="") |
|||
* Class SeparateAccountsService |
|||
* @package App\JsonRpc |
|||
*/ |
|||
class SeparateaccountsService implements SeparateAccountsServiceInterface |
|||
{ |
|||
/** |
|||
* @Inject |
|||
* @var \App\Service\v3\Interfaces\SeparateAccountsServiceInterface |
|||
*/ |
|||
private $separateaccountsService; |
|||
|
|||
public function orderOnlineCompleted($orderMainId, $userId) |
|||
{ |
|||
// TODO: Implement orderOnlineCompleted() method.
|
|||
return $this->separateaccountsService->orderOnlineCompleted($orderMainId, $userId); |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,44 @@ |
|||
<?php |
|||
|
|||
declare(strict_types=1); |
|||
|
|||
namespace App\Request\v3; |
|||
|
|||
use App\Request\BaseFormRequest; |
|||
|
|||
class ShopCartUpdateRequest extends BaseFormRequest |
|||
{ |
|||
|
|||
/** |
|||
* Get the validation rules that apply to the request. |
|||
*/ |
|||
public function rules(): array |
|||
{ |
|||
return [ |
|||
'goods_id' => 'required|nonempty|integer', |
|||
'num' => 'required|nonempty|integer', |
|||
'user_id' => 'required|nonempty|integer|exists:lanzu_user,id', |
|||
]; |
|||
} |
|||
|
|||
/** |
|||
* @return array |
|||
*/ |
|||
public function messages(): array |
|||
{ |
|||
return [ |
|||
'user_id.*' => ':attribute无效', |
|||
'goods_id.*' => ':attribute无效', |
|||
'num.*' => ':attribute无效', |
|||
]; |
|||
} |
|||
|
|||
public function attributes(): array |
|||
{ |
|||
return [ |
|||
'user_id' => '用户id', |
|||
'goods_id' => '商品ID', |
|||
'num' => '数量', |
|||
]; |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue