天津大学软件工程实践项目
  1. 管理购物车
天津大学软件工程实践项目
  • 管理店铺
    • getBusiness
      GET
    • getBusiness
      GET
    • updateBusiness
      PUT
    • deleteBusiness
      DELETE
    • patchBusiness
      PATCH
    • getBusinesses
      GET
    • addBusiness
      POST
  • 管理用户
    • 新增用户(仅登录帐号)
      POST
    • 注册用户(自然人)
      POST
    • 新增用户(自然人)
      POST
    • 修改密码
      POST
    • 判断当前登录的用户
      GET
  • 管理订单
    • listOrdersByUserId
      GET
    • addOrders
      POST
    • getOrderById
      GET
  • 管理商品
    • getAllFoods
      GET
    • 修改商品的信息
      PATCH
    • addFood
      POST
    • 返回查询到的一条商品记录
      GET
  • 管理购物车
    • addCartItem
      POST
  • 管理认证
    • authorize
      POST
  • 统一结果测试
    • 通用返回成功(没有返回结果)
      GET
    • 返回成功(有返回结果)
      GET
    • 通用返回失败
      GET
  • 管理地址
    • addDeliveryAddress
  • 数据模型
    • Schemas
      • Authority
      • Business
      • User
      • HttpResultBusiness
      • Person
      • LoginDto
      • Order
      • DeliveryAddress
      • HttpResultOrder
      • Food
      • HttpResultFood
      • Cart
      • HttpResultCart
      • JWTToken
      • HttpResult
      • HttpResultListFood
      • HttpResultDeliveryAddress
      • HttpResultListBusiness
      • HttpResultString
  1. 管理购物车

addCartItem

POST
/api/carts

请求参数

Body 参数application/json

示例
{
    "id": 0,
    "createTime": "2019-08-24T14:15:22Z",
    "updateTime": "2019-08-24T14:15:22Z",
    "creator": 0,
    "updater": 0,
    "deleted": true,
    "food": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "foodName": "string",
        "foodExplain": "string",
        "foodImg": "string",
        "foodPrice": 0,
        "business": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "businessName": "string",
            "businessOwner": {
                "id": 0,
                "createTime": "2019-08-24T14:15:22Z",
                "updateTime": "2019-08-24T14:15:22Z",
                "creator": 0,
                "updater": 0,
                "deleted": true,
                "username": "string",
                "authorities": [
                    {
                        "name": "string"
                    }
                ]
            },
            "businessAddress": "string",
            "businessExplain": "string",
            "businessImg": "string",
            "orderTypeId": 0,
            "startPrice": 0,
            "deliveryPrice": 0,
            "remarks": "string"
        },
        "remarks": "string"
    },
    "customer": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "username": "string",
        "authorities": [
            {
                "name": "string"
            }
        ]
    },
    "business": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "businessName": "string",
        "businessOwner": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "username": "string",
            "authorities": [
                {
                    "name": "string"
                }
            ]
        },
        "businessAddress": "string",
        "businessExplain": "string",
        "businessImg": "string",
        "orderTypeId": 0,
        "startPrice": 0,
        "deliveryPrice": 0,
        "remarks": "string"
    },
    "quantity": 0
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST '/api/carts' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": 0,
    "createTime": "2019-08-24T14:15:22Z",
    "updateTime": "2019-08-24T14:15:22Z",
    "creator": 0,
    "updater": 0,
    "deleted": true,
    "food": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "foodName": "string",
        "foodExplain": "string",
        "foodImg": "string",
        "foodPrice": 0,
        "business": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "businessName": "string",
            "businessOwner": {
                "id": 0,
                "createTime": "2019-08-24T14:15:22Z",
                "updateTime": "2019-08-24T14:15:22Z",
                "creator": 0,
                "updater": 0,
                "deleted": true,
                "username": "string",
                "authorities": [
                    {
                        "name": "string"
                    }
                ]
            },
            "businessAddress": "string",
            "businessExplain": "string",
            "businessImg": "string",
            "orderTypeId": 0,
            "startPrice": 0,
            "deliveryPrice": 0,
            "remarks": "string"
        },
        "remarks": "string"
    },
    "customer": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "username": "string",
        "authorities": [
            {
                "name": "string"
            }
        ]
    },
    "business": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "businessName": "string",
        "businessOwner": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "username": "string",
            "authorities": [
                {
                    "name": "string"
                }
            ]
        },
        "businessAddress": "string",
        "businessExplain": "string",
        "businessImg": "string",
        "orderTypeId": 0,
        "startPrice": 0,
        "deliveryPrice": 0,
        "remarks": "string"
    },
    "quantity": 0
}'

返回响应

🟢200成功
*/*
OK
Body

示例
{
    "success": true,
    "code": "string",
    "data": {
        "id": 0,
        "createTime": "2019-08-24T14:15:22Z",
        "updateTime": "2019-08-24T14:15:22Z",
        "creator": 0,
        "updater": 0,
        "deleted": true,
        "food": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "foodName": "string",
            "foodExplain": "string",
            "foodImg": "string",
            "foodPrice": 0,
            "business": {
                "id": 0,
                "createTime": "2019-08-24T14:15:22Z",
                "updateTime": "2019-08-24T14:15:22Z",
                "creator": 0,
                "updater": 0,
                "deleted": true,
                "businessName": "string",
                "businessOwner": {
                    "id": 0,
                    "createTime": "2019-08-24T14:15:22Z",
                    "updateTime": "2019-08-24T14:15:22Z",
                    "creator": 0,
                    "updater": 0,
                    "deleted": true,
                    "username": "string",
                    "authorities": [
                        {
                            "name": "string"
                        }
                    ]
                },
                "businessAddress": "string",
                "businessExplain": "string",
                "businessImg": "string",
                "orderTypeId": 0,
                "startPrice": 0,
                "deliveryPrice": 0,
                "remarks": "string"
            },
            "remarks": "string"
        },
        "customer": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "username": "string",
            "authorities": [
                {
                    "name": "string"
                }
            ]
        },
        "business": {
            "id": 0,
            "createTime": "2019-08-24T14:15:22Z",
            "updateTime": "2019-08-24T14:15:22Z",
            "creator": 0,
            "updater": 0,
            "deleted": true,
            "businessName": "string",
            "businessOwner": {
                "id": 0,
                "createTime": "2019-08-24T14:15:22Z",
                "updateTime": "2019-08-24T14:15:22Z",
                "creator": 0,
                "updater": 0,
                "deleted": true,
                "username": "string",
                "authorities": [
                    {
                        "name": "string"
                    }
                ]
            },
            "businessAddress": "string",
            "businessExplain": "string",
            "businessImg": "string",
            "orderTypeId": 0,
            "startPrice": 0,
            "deliveryPrice": 0,
            "remarks": "string"
        },
        "quantity": 0
    },
    "message": "string"
}
修改于 2025-09-21 09:30:41
上一页
返回查询到的一条商品记录
下一页
authorize
Built with