获取购物车列表接口

API 调用地址

{域名地址}/api/cart/list

说明:{域名地址} 需要替换成你的域名地址,如 https://www.anqicms.com/api/cart/list

调用方法

GET

Header 或者 Cookie

字段名 类型 必填 说明
cart string 当没有登录的时候,用此token作为用户判断

请求参数

字段名 类型 必填 说明
current int 获取指定分页数据,当前页码
pageSize int 显示数量,每页数量

返回参数

字段名 类型 说明
code int 错误码
msg string 错误原因说明
data object[] 结果内容
total int 文档数量

data 结果 item 参数

字段名 类型 说明
id int 文档 ID
cart_id int 购物车ID
quantity int 数量
amount int 金额,单位分
origin_amount int 原始金额,单位分
order_extra object 订单扩展信息
is_wholesale bool 是否是批发商品
title string 文档标题
seo_title string 文档 SEO 标题
url_token string 文档 URL 别名
keywords string 文档关键词
description string 文档简介
module_id int 文档模型 ID
category_id int 文档分类 ID
views int 文档浏览量
comment_count int 文档评论量
images string[] 文档组图
logo string 文档 Logo
thumb string 文档缩略图
flag string 文档推荐属性,头条[h]推荐[c]幻灯[f]特荐[a]滚动[s]加粗[h]图片[p]跳转[j]
canonical_url string canonical url
fixed_link string 文档固定链接
created_time int 文档发布时间戳
updated_time int 文档更新时间戳
status int 文档显示状态
user_id int 用户 ID
price int 价格,单位分
stock int 库存量
user_id int 用户 ID

请求数据示例

参数
current 1
pageSize 20

返回数据示例

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "created_time": 1607308159,
      "updated_time": 1662717106,
      "title": "关于AnqiCMS",
      "seo_title": "",
      "url_token": "design",
      "keywords": "",
      "description": "安企内容管理系统(AnqiCMS),是一款使用 GoLang 开发的企业站内容管理系统,它部署简单,软件安全,界面优雅,小巧,执行速度飞快,使用 AnqiCMS 搭建的网站可以防止众多安全问题发生。",
      "module_id": 1,
      "category_id": 1,
      "views": 1338,
      "comment_count": 0,
      "images": null,
      "template": "",
      "status": 1,
      "canonical_url": "",
      "fixed_link": "",
      "flag": "",
      "user_id": 0,
      "price": 0,
      "stock": 9999999,
      "has_pseudo": 0,
      "keyword_id": 0,
      "origin_url": "",
      "origin_title": "",
      "category": null,
      "module_name": "",
      "data": null,
      "logo": "https://www.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
      "thumb": "https://www.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
      "extra": {
        "author": {
          "name": "作者",
          "value": "AnqiCMS",
          "default": null
        },
        "certificate": {
          "name": "学历",
          "value": null,
          "default": null
        },
        "city": {
          "name": "城市",
          "value": null,
          "default": null
        }
      },
      "link": "https://www.anqicms.com/design"
    },
    {
      "id": 2,
      "created_time": 1607308247,
      "updated_time": 1611373941,
      "title": "AnqiCMS使用帮助",
      "seo_title": "",
      "url_token": "help",
      "keywords": "",
      "description": "anqicms常见问题汇总",
      "module_id": 1,
      "category_id": 1,
      "views": 1655,
      "comment_count": 0,
      "images": null,
      "template": "",
      "status": 1,
      "canonical_url": "",
      "fixed_link": "",
      "flag": "",
      "user_id": 0,
      "price": 0,
      "stock": 9999999,
      "has_pseudo": 0,
      "keyword_id": 0,
      "origin_url": "",
      "origin_title": "",
      "category": null,
      "module_name": "",
      "data": null,
      "logo": "https://www.anqicms.com/uploads/202012/7/bd36c37ef742c7be.webp",
      "thumb": "https://www.anqicms.com/uploads/202012/7/thumb_bd36c37ef742c7be.webp",
      "extra": null,
      "link": "https://www.anqicms.com/help"
    }
  ],
  "msg": "",
  "total": 2
}

错误代码

错误码 说明
0 OK
-1 错误,错误原因在 msg 中指出
1001 未登录
1002 未授权
200 API 请求 OK