/** * * @SWG\Api( * path="/shopping_cart", * @SWG\Operation( * method="POST", summary="添加到购物车", notes="添加到购物车", * @SWG\ResponseMessage(code=0, message="成功"), * @SWG\Parameter( * name="shopping_cart_info", * description="提交的商品信息", * paramType="body", * required=true, * type="newShoppingCartParams" * ) * ) * ) */ public function store(Request $request) { $response = new BaseResponse(); $content = json_decode($request->getContent(false)); $content->properties = json_encode($content->properties); ShoppingCart::create((array) $content); return $response->toJson(); }