POST api/v1/User/ShoppingCarAdd

[需登录]新增购物车

请求信息(Request)

URI 参数

None.

Body 参数

UserShoppingCarDTO
名称描述类型备注
ID

购物车ID

integer

None.

UserId

用户ID

integer

None.

Amount

商品数量

integer

Required

DealID

商品ID

integer

Required

CreateTime

添加时间

date

Required

DealDTO

商品详情

DealDTO

None.

SpecificationKey

规格关键字(Specification中的ID从小到大排列,中间以-分隔)

string

None.

SpecificationName

规格名称,格式: 规格父类1名称:规格子类1名称,规格父类2名称:规格子类2名称。例:套餐:3-5人餐,位置:包厢

string

None.

Images

图片ID

string

None.

FullPathImages

商品图片

string 集合

None.

Price

当前规格单价

decimal number

None.

Stock

当前规格单价

integer

None.

请求格式

application/json

Sample:

An exception has occurred while using the formatter 'JsonMediaTypeFormatter' to generate sample for media type 'application/json'. Exception message: Self referencing loop detected with type 'WLife.Application.DTOs.DealSpecificationDTO'. Path 'DealDTO.DealSpecifications[0].ChildrenSpecification1'.

text/json

Sample:

An exception has occurred while using the formatter 'JsonMediaTypeFormatter' to generate sample for media type 'text/json'. Exception message: Self referencing loop detected with type 'WLife.Application.DTOs.DealSpecificationDTO'. Path 'DealDTO.DealSpecifications[0].ChildrenSpecification1'.

application/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'application/xml'. Exception message: “WLife.Application.DTOs.DealSpecificationDTO”类型的对象图包含循环,如果禁用引用跟踪,择无法对其进行序列化。

text/xml

Sample:

An exception has occurred while using the formatter 'XmlMediaTypeFormatter' to generate sample for media type 'text/xml'. Exception message: “WLife.Application.DTOs.DealSpecificationDTO”类型的对象图包含循环,如果禁用引用跟踪,择无法对其进行序列化。

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'JQueryMvcFormUrlEncodedFormatter' to write type 'UserShoppingCarDTO'.

响应信息(Response)

资源描述

RequestResultOfInt32
名称描述类型备注
Data

integer

None.

Status

状态(0:成功,1:失败)

integer

None.

Message

导致失败的相关消息

string

None.

Total

集合总数,用于分页时使用

integer

None.

响应格式

application/json, text/json

Sample:
{
  "Data": 1,
  "Status": 2,
  "Message": "sample string 3",
  "Total": 4
}

application/xml, text/xml

Sample:
<RequestResultOfint xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WLife.Application">
  <Message>sample string 3</Message>
  <Status>2</Status>
  <Total>4</Total>
  <Data>1</Data>
</RequestResultOfint>