仿微同商城后台API

仿微同商城后台API

      • 1.介绍
      • 2.接口文档
      • 3.接口
        • 3.1.登陆
        • 3.2.注册
        • 3.3.用户信息
        • 3.4.邮箱激活
        • 3.5.邮箱验证
        • 3.6.获取广告
        • 3.7.获取公告
        • 3.8.获取制造商
        • 3.9.获取商品列表
        • 3.10.获取商品详情
        • 3.11.获取主题信息
        • 3.12.获取分类信息
        • 3.13.添加购物车
        • 3.14.删除购物车
        • 3.15.添加地址
        • 3.16.删除地址
        • 3.17.我的足迹
        • 3.18.创建订单
        • 3.19.我的订单
        • 3.20.我的收藏
        • 3.21.支付宝支付

1.介绍

原项目:https://gitee.com/fuyang_lipengjun/platform
本项目:https://gitee.com/zouchengxin/nide-shop-nest
由于本人比较倾向于MVC模式,所以选择nestjs来开发api接口。
nestjs开发文档:https://docs.nestjs.cn/7/firststeps
主要用到的模块:

  • @nestjs/passport:认证
  • @nestjs/typeorm:TypeORM它是 TypeScript 中最成熟的对象关系映射器( ORM )
  • compression:压缩
  • helmet:安全(CORS)
  • @nestjs/swagger:OpenAPI(Swagger)规范是一种用于描述 RESTful API 的强大定义格式
  • @nestjsx/CRUD:帮助您轻松创建 CRUD 控制器和服务
  • moment:时间插件
  • alipay-sdk:Alipay SDK对支付宝开放平台开放的所有能力提供了最全面和完整的支持
  • dotenv:配置
  • nodemailer:发送邮箱
  • mysql:连接mysql数据库

2.接口文档

Swagger UI:http://39.106.207.193:3000/api/
仿微同商城后台API_第1张图片

3.接口

3.1.登陆

  • 地址:http://39.106.207.193:3000/api/auth/login
  • 请求方式:POST
  • body参数:
{
  "username": "test",
  "password": "test"
}
  • 响应:
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8",
  "expires_time": "2h"
}

3.2.注册

  • 地址:http://39.106.207.193:3000/api/user
  • 请求方式:POST
  • body参数:
{
  "username": "test",
  "nickname": "test",
  "mobile": "17777777777",
  "password": "test",
  "gender": 0,
  "birthday": "1999-09-09"
}
  • 响应:
{
  "username": "test",
  "nickname": "test",
  "mobile": "17777777777",
  "password": "098f6bcd4621d373cade4e832627b4f6",
  "birthday": "1999-09-09",
  "gender": 0,
  "register_ip": "127.0.0.1",
  "id": 66,
  "register_time": "2020-04-14T07:13:48.000Z",
  "last_login_time": null,
  "email_token_exptime": null,
  "email_status": 0
}

3.3.用户信息

  • 地址:http://39.106.207.193:3000/api/user/66
  • 请求方式:GET
  • 响应:
{
  "id": 66,
  "username": "test",
  "nickname": "test",
  "avatar": "",
  "mobile": "17777777777",
  "gender": 0,
  "birthday": "1999-09-09",
  "user_level_id": null,
  "email": null,
  "email_status": 0
}

3.4.邮箱激活

  • 地址:http://39.106.207.193:3000/api/email/active?user_id=66
  • 请求方式:GET
  • query参数:user_id(用户ID)
  • 响应:
{
  "code": 200,
  "msg": "邮箱已发送",
  "activeUrl": "http://0.0.0.0:3000/api/email/verify?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMxLCJ1c2VyRW1haWwiOiIxNzQxNzUwNTkxQHFxLmNvbSIsImlhdCI6MTU4Njg1MTEyOCwiZXhwIjoxNTg2ODU4MzI4fQ.pobyhlP4mlGx0uQ-5eF44l7P04a-UV45B_YBpqQBlZ0"
}

3.5.邮箱验证

  • 地址:http://39.106.207.193:3000/api/email/verify?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMxLCJ1c2VyRW1haWwiOiIxNzQxNzUwNTkxQHFxLmNvbSIsImlhdCI6MTU4Njg1MTEyOCwiZXhwIjoxNTg2ODU4MzI4fQ.pobyhlP4mlGx0uQ-5eF44l7P04a-UV45B_YBpqQBlZ0
  • 请求方式:GET
  • query参数:token(凭证)
  • 响应:
{
	code:200,
	msg:"[email protected]邮箱激活成功"
}

3.6.获取广告

  • 地址:http://39.106.207.193:3000/api/ad?limit=4&offset=0
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 4,
      "name": "商业版",
      "link": "",
      "image_url": "https://platform-wxmall.oss-cn-beijing.aliyuncs.com/platform-plus-mall/banner/38a0b23950b79611fb565bae14351a11.jpg",
      "content": "商业版",
      "end_time": "2020-01-30T04:49:25.000Z",
      "adPosition": {
        "id": 1,
        "name": "移动端首页轮播广告",
        "width": 750,
        "height": 200
      }
    },
    {
      "id": 5,
      "name": "双十一",
      "link": "",
      "image_url": "https://platform-wxmall.oss-cn-beijing.aliyuncs.com/platform-plus-mall/banner/aa860e44fbd468a7804c1a84796c4827.jpg",
      "content": "",
      "end_time": "2020-01-30T05:49:50.000Z",
      "adPosition": {
        "id": 1,
        "name": "移动端首页轮播广告",
        "width": 750,
        "height": 200
      }
    },
    {
      "id": 6,
      "name": "纷格新品",
      "link": "",
      "image_url": "https://platform-wxmall.oss-cn-beijing.aliyuncs.com/platform-plus-mall/banner/f02a4f8d5bbaf7f32e131c1f08ff21ae.jpg",
      "content": "",
      "end_time": "2020-01-30T06:49:59.000Z",
      "adPosition": {
        "id": 1,
        "name": "移动端首页轮播广告",
        "width": 750,
        "height": 200
      }
    },
    {
      "id": 7,
      "name": "居家生活",
      "link": "",
      "image_url": "https://platform-wxmall.oss-cn-beijing.aliyuncs.com/platform-plus-mall/banner/79b2dbf762217e6e532f335bda4c85b3.jpg",
      "content": "",
      "end_time": "2020-01-30T07:50:02.000Z",
      "adPosition": {
        "id": 1,
        "name": "移动端首页轮播广告",
        "width": 750,
        "height": 200
      }
    }
  ],
  "count": 4,
  "total": 11,
  "page": 1,
  "pageCount": 3
}

3.7.获取公告

  • 地址:http://39.106.207.193:3000/api/bulletin
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 1,
      "title": "。。。。。。",
      "content": "。。。。。。",
      "add_time": "1504933578"
    },
    {
      "id": 2,
      "title": "。。。。。。",
      "content": "。。。。。。",
      "add_time": "1504933999"
    }
  ],
  "count": 2,
  "total": 2,
  "page": 1,
  "pageCount": 1
}

3.8.获取制造商

  • 地址:http://39.106.207.193:3000/api/brand?limit=5&page=1
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 1026000,
      "name": "CK制造商",
      "list_pic_url": "http://yanxuan.nosdn.127.net/658f09b7ec522d31742b47b914d64338.png",
      "simple_desc": "严选寻访Calvin Klein品牌的制造商,\n深入世界领带第一生产地,设计与品质并重,\n致力于给消费者带来优质典雅的服饰用品。",
      "pic_url": "http://yanxuan.nosdn.127.net/fb139c9f11a10deb41beeb42aaad488e.png",
      "is_new": 1,
      "floor_price": "39.00"
    },
    {
      "id": 1001000,
      "name": "MUJI制造商",
      "list_pic_url": "http://yanxuan.nosdn.127.net/1541445967645114dd75f6b0edc4762d.png",
      "simple_desc": "严选精选了MUJI制造商和生产原料,\n用几乎零利润的价格,剔除品牌溢价,\n让用户享受原品牌的品质生活。",
      "pic_url": "http://yanxuan.nosdn.127.net/4ea3f1e60dd77c45c218e503d721a1ed.jpg",
      "is_new": 1,
      "floor_price": "12.90"
    },
    {
      "id": 1001038,
      "name": "Coach制造商",
      "list_pic_url": "http://yanxuan.nosdn.127.net/1b1cc16135fd8467d40983f75f644127.png",
      "simple_desc": "严选为制作高品质高颜值皮具配件,\n由Coach、MK等品牌制造商生产,\n由严选360度全程监制,给你带来优质皮具。",
      "pic_url": "http://yanxuan.nosdn.127.net/c933a662bb79b2a47280363e35ab994b.png",
      "is_new": 1,
      "floor_price": "49.00"
    },
    {
      "id": 1028003,
      "name": "Burberry制造商",
      "list_pic_url": "http://yanxuan.nosdn.127.net/07af01e281c7e0b912d162d611e22c32.jpg",
      "simple_desc": "为打造时尚舒适的童装系列,\n严选选择Burberry制造商,优化版型配色\n英伦风情融入经典格纹,百搭优雅气质款。",
      "pic_url": "http://yanxuan.nosdn.127.net/1a874a6b8cf8c17ef7420b2449179eae.jpg",
      "is_new": 0,
      "floor_price": "99.00"
    },
    {
      "id": 1001037,
      "name": "新秀丽制造商",
      "list_pic_url": "http://yanxuan.nosdn.127.net/80dce660938931956ee9a3a2b111bd37.jpg",
      "simple_desc": "严选为制作品质与颜值兼具的箱包,\n选定新秀丽、CK、Ricardo等品牌合作的制造商,\n拥有国内先进流水线20余条,实力保障品质。",
      "pic_url": "http://yanxuan.nosdn.127.net/af5719e20bdbd214a9ce7d961e9031c5.png",
      "is_new": 0,
      "floor_price": "59.00"
    }
  ],
  "count": 5,
  "total": 49,
  "page": 1,
  "pageCount": 10
}

3.9.获取商品列表

  • 地址:http://39.106.207.193:3000/api/goods?fields=name,goods_brief,retail_price,market_price&filter=is_new||$eq||1&limit=5&page=1
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 1134032,
      "goods_brief": "慢回弹海绵的呵护,萌趣添彩。",
      "name": "趣味粉彩系列记忆棉坐垫",
      "market_price": "53.90",
      "retail_price": "49.00"
    },
    {
      "id": 1134030,
      "goods_brief": "慢回弹海绵,时尚设计。",
      "name": "简约知性记忆棉坐垫",
      "market_price": "50.60",
      "retail_price": "46.00"
    },
    {
      "id": 1155015,
      "goods_brief": "细腻松软,入口绵柔",
      "name": "绿豆糕 80克(4枚入)",
      "market_price": "14.19",
      "retail_price": "12.90"
    },
    {
      "id": 1152161,
      "goods_brief": "3重透气,清爽柔滑",
      "name": "竹语丝麻印花四件套",
      "market_price": "504.90",
      "retail_price": "459.00"
    },
    {
      "id": 1166008,
      "goods_brief": "钻石涂层,不粘锅锅具组",
      "name": "Carat钻石 不粘厨具组合",
      "market_price": "504.90",
      "retail_price": "459.00"
    }
  ],
  "count": 5,
  "total": 11,
  "page": 1,
  "pageCount": 3
}

3.10.获取商品详情

  • 地址:http://39.106.207.193:3000/api/goods?filter=id||$eq||1181000&join=brand&join=goodsAttribute&join=goodsAttribute.attribute&join=goodsSpecification&join=goodsSpecification.specification
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 1181000,
      "sort_order": 1,
      "goods_number": 100,
      "goods_sn": "1181000",
      "goods_brief": "安心舒适是最好的礼物",
      "name": "母亲节礼物-舒适安睡组合",
      "goods_desc": "

......"
, "goods_unit": "", "primary_pic_url": "https://mp123.oss-cn-shenzhen.aliyuncs.com/upload/20170908/092741972ad4b4.jpg", "list_pic_url": "http://yanxuan.nosdn.127.net/1f67b1970ee20fd572b7202da0ff705d.png", "promotion_desc": "限时购", "market_price": "2857.80", "retail_price": "2598.00", "sell_volume": 1533, "primary_product_id": 1194000, "brand": { "id": 1001020, "name": "Ralph Lauren制造商", "list_pic_url": "http://yanxuan.nosdn.127.net/9df78eb751eae2546bd3ee7e61c9b854.png", "simple_desc": "我们与Ralph Lauren Home的制造商成功接洽,掌握先进的生产设备,传承品牌工艺和工序。追求生活品质的你,值得拥有。", "pic_url": "http://yanxuan.nosdn.127.net/089e4066f0c2bc6b062d17c6292735dc.png", "floor_price": "29.00" }, "goodsAttribute": [ { "id": 870, "value": "组合一:AB面独立弹簧床垫 进口乳胶150*200cm*1+可水洗抗菌防螨丝羽绒枕*2。\n组合二:AB面独立弹簧床垫 进口乳胶180*200cm*1+可水洗抗菌防螨丝羽绒枕*2", "attribute": { "id": 16, "name": "规格" } }, { "id": 871, "value": "活动时间:5月8日0点-5月14日24点。\n请在以上时间段内购买,其余时间均不可享受组合装优惠。", "attribute": null } ], "goodsSpecification": [ { "id": 1, "value": "1.5m床垫*1+枕头*2", "pic_url": "", "specification": { "id": 2, "name": "规格" } }, { "id": 2, "value": "1.8m床垫*1+枕头*2", "pic_url": "", "specification": { "id": 2, "name": "规格" } }, { "id": 3, "value": "浅杏粉", "pic_url": "http://yanxuan.nosdn.127.net/10022c73fa7aa75c2c0d736e96cc56d5.png?quality=90&thumbnail=200x200&imageView", "specification": { "id": 1, "name": "颜色" } }, { "id": 4, "value": "玛瑙红", "pic_url": "http://yanxuan.nosdn.127.net/29442127f431a1a1801c195905319427.png?quality=90&thumbnail=200x200&imageView", "specification": { "id": 1, "name": "颜色" } }, { "id": 5, "value": "烟白灰", "pic_url": "http://yanxuan.nosdn.127.net/36f64a7161b67e7fb8ea45be32ecfa25.png?quality=90&thumbnail=200x200&imageView", "specification": { "id": 1, "name": "颜色" } } ] } ], "count": 1, "total": 1, "page": 1, "pageCount": 1 }

3.11.获取主题信息

  • 地址:http://39.106.207.193:3000/api/topic?limit=5&page=1
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 314,
      "title": "关爱他成长的每一个足迹",
      "content": "

......

"
, "avatar": "https://yanxuan.nosdn.127.net/14943186689221563.png", "item_pic_url": "https://yanxuan.nosdn.127.net/14943267735961674.jpg", "subtitle": "专业运动品牌同厂,毛毛虫鞋买二送一", "price_info": "0.00", "read_count": "6.4k", "scene_pic_url": "https://yanxuan.nosdn.127.net/14943267735961674.jpg" }, { "id": 313, "title": "一次解决5个节日送礼难题", "content": "\n ......", "avatar": "https://yanxuan.nosdn.127.net/14942967243991290.png", "item_pic_url": "https://yanxuan.nosdn.127.net/14942996754171334.jpg", "subtitle": "这些就是他们想要的礼物清单", "price_info": "59.90", "read_count": "7.8k", "scene_pic_url": "https://yanxuan.nosdn.127.net/14942996754171334.jpg" }, { "id": 300, "title": "秒杀化学洗涤剂的纯天然皂", "content": "\n ......", "avatar": "https://yanxuan.nosdn.127.net/14939843011001088.png", "item_pic_url": "https://yanxuan.nosdn.127.net/14939843143621089.jpg", "subtitle": "前段时间有朋友跟我抱怨,和婆婆住到一起才发现生活理念有太多不和。别的不提,光是洗...", "price_info": "0.00", "read_count": "15.3k", "scene_pic_url": "https://yanxuan.nosdn.127.net/14939843143621089.jpg" }, { "id": 299, "title": "买过的人都说它是差旅神器", "content": "\n ......", "avatar": "https://yanxuan.nosdn.127.net/14938873720850678.png", "item_pic_url": "https://yanxuan.nosdn.127.net/14938873919030679.jpg", "subtitle": "许多人经历过旅途中内裤洗晾不便的烦恼,尤其与旅伴同居一室时,晾在卫生间里的内裤更...", "price_info": "0.00", "read_count": "28.7k", "scene_pic_url": "https://yanxuan.nosdn.127.net/14938873919030679.jpg" }, { "id": 295, "title": "他们在严选遇见的新生活", "content": "\n ......", "avatar": "https://yanxuan.nosdn.127.net/14937987677390284.png", "item_pic_url": "https://yanxuan.nosdn.127.net/14938092956370380.jpg", "subtitle": "多款商品直减中,最高直减400元", "price_info": "35.80", "read_count": "36.6k", "scene_pic_url": "https://yanxuan.nosdn.127.net/14938092956370380.jpg" } ], "count": 5, "total": 21, "page": 1, "pageCount": 5 }

3.12.获取分类信息

  • 地址:http://39.106.207.193:3000/api/category?filter=level||$eq||L1&join=children&limit=2&page=1
  • 请求方式:GET
  • 响应:
{
  "data": [
    {
      "id": 1005000,
      "name": "居家",
      "sort_order": 2,
      "front_desc": "回家,放松身心",
      "front_name": "回家,放松身心",
      "banner_url": "http://yanxuan.nosdn.127.net/92357337378cce650797444bc107b0f7.jpg",
      "icon_url": "http://yanxuan.nosdn.127.net/a45c2c262a476fea0b9fc684fed91ef5.png",
      "img_url": "//nos.netease.com/yanxuan/f0d0e1a542e2095861b42bf789d948ce.jpg",
      "wap_banner_url": "http://yanxuan.nosdn.127.net/e8bf0cf08cf7eda21606ab191762e35c.png",
      "children": [
        {
          "id": 1008002,
          "name": "布艺软装",
          "front_desc": "换个软装,换个家",
          "front_name": "各种风格软装装点你的家",
          "banner_url": "http://yanxuan.nosdn.127.net/8bbcd7de60a678846664af998f57e71c.png",
          "wap_banner_url": "http://yanxuan.nosdn.127.net/2e2fb4f2856a021bbcd1b4c8400f2b06.png"
        },
        ......
      ]
    },
    {
      "id": 1005001,
      "name": "餐厨",
      "sort_order": 3,
      "front_desc": "厨房",
      "front_name": "爱,囿于厨房",
      "banner_url": "http://yanxuan.nosdn.127.net/f4ff8b3d5b0767d4e578575c1fd6b921.jpg",
      "icon_url": "http://yanxuan.nosdn.127.net/ad8b00d084cb7d0958998edb5fee9c0a.png",
      "img_url": "//nos.netease.com/yanxuan/88855173a0cfcfd889ee6394a3259c4f.jpg",
      "wap_banner_url": "http://yanxuan.nosdn.127.net/3708dbcb35ad5abf9e001500f73db615.png",
      "children": [
        {
          "id": 1005007,
          "name": "锅具",
          "front_desc": "中华铸铁、精选不锈钢、进口珐琅",
          "front_name": "一口好锅,炖煮生活一日三餐",
          "banner_url": "http://yanxuan.nosdn.127.net/4aab4598017b5749e3b63309d25e9f6b.png",
          "wap_banner_url": "http://yanxuan.nosdn.127.net/d2db0d1d0622c621a8aa5a7c06b0fc6d.png"
        },
        ......
      ]
    }
  ],
  "count": 2,
  "total": 9,
  "page": 1,
  "pageCount": 5
}

3.13.添加购物车

  • 地址:http://39.106.207.193:3000/api/cart
  • 请求方式:POST
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • Body参数:
{
  "goods_id": 1006002,
  "number": 3
}
  • 响应:
{
  "id": 156,
  "user_id": 66,
  "session_id": "",
  "goods_sn": "1006002",
  "product_id": 7,
  "goods_name": "轻奢纯棉刺绣水洗四件套",
  "market_price": "988.90",
  "retail_price": "899.00",
  "number": 3,
  "goods_specifition_name_value": "",
  "goods_specifition_ids": "",
  "checked": 0,
  "list_pic_url": ""
}

3.14.删除购物车

  • 地址:http://39.106.207.193:3000/api/cart/155
  • 请求方式:DELETE
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "id": 155,
  "user_id": 66,
  "session_id": "string",
  "goods_id": 0,
  "goods_sn": "string",
  "product_id": 0,
  "goods_name": "string",
  "market_price": "0.00",
  "retail_price": "0.00",
  "number": 0,
  "goods_specifition_name_value": "string",
  "goods_specifition_ids": "string",
  "checked": 0,
  "list_pic_url": "string"
}

3.15.添加地址

  • 地址:http://39.106.207.193:3000/api/address
  • 请求方式:POST
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • Body参数:
{
  "user_name": "郝某某",
  "tel_number": "17777777777",
  "postal_Code": "610000",
  "national_Code": "86",
  "province_Name": "四川省",
  "city_Name": "成都市",
  "county_Name": "武侯区",
  "detail_Info": "滨江北路3段",
  "is_default": 0
}
  • 响应:
{
  "id": 12,
  "user_name": "郝某某",
  "tel_number": "17777777777",
  "postal_Code": "610000",
  "national_Code": "86",
  "province_Name": "四川省",
  "city_Name": "成都市",
  "county_Name": "武侯区",
  "detail_Info": "滨江北路3段",
  "is_default": 0
}

3.16.删除地址

  • 地址:http://39.106.207.193:3000/api/address/12
  • 请求方式:DELETE
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "id": 12,
  "user_id": 66,
  "user_name": "郝某某",
  "tel_number": "17777777777",
  "postal_Code": "610000",
  "national_Code": "86",
  "province_Name": "四川省",
  "city_Name": "成都市",
  "county_Name": "武侯区",
  "detail_Info": "滨江北路3段",
  "is_default": 0
}

3.17.我的足迹

  • 地址:http://39.106.207.193:3000/api/footprint?limit=5&page=1
  • 请求方式:GET
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "data": [
    {
      "id": 1,
      "add_time": 1586942733,
      "referrer": null,
      "goods": {
        "id": 1006002,
        "goods_number": 100,
        "goods_sn": "1006002",
        "goods_brief": "设计师原款,精致绣花",
        "name": "轻奢纯棉刺绣水洗四件套",
        "goods_desc": "

......


"
, "goods_unit": "件", "primary_pic_url": "http://yanxuan.nosdn.127.net/599ee624350ecb9e70c32375c0cd4807.jpg", "list_pic_url": "http://yanxuan.nosdn.127.net/8ab2d3287af0cefa2cc539e40600621d.png", "promotion_desc": "限时购", "promotion_tag": "", "market_price": "988.90", "unit_price": "0.00", "retail_price": "899.00", "counter_price": "0.00", "extra_price": "0.00", "sell_volume": 168, "primary_product_id": 1006003, "add_time": "2017-08-30T03:40:11.000Z", "update_time": null } }, { "id": 2, "add_time": 1586942752, "referrer": null, "goods": { "id": 1127024, "goods_number": 100, "goods_sn": "1127024", "goods_brief": "德国热帖工艺无痕无缝", "name": "女式无痕真丝内裤", "goods_desc": "", "goods_unit": "件", "primary_pic_url": "http://yanxuan.nosdn.127.net/a89fcd110c582c28a5f6cd821effb37a.png", "list_pic_url": "http://yanxuan.nosdn.127.net/0a70f12a712e90d7d93beec4f686fe8e.png", "promotion_desc": "限时购", "promotion_tag": "", "market_price": "42.90", "unit_price": "0.00", "retail_price": "39.00", "counter_price": "0.00", "extra_price": "0.00", "sell_volume": 14193, "primary_product_id": 1127044, "add_time": "2017-08-30T03:40:11.000Z", "update_time": null } } ], "count": 2, "total": 2, "page": 1, "pageCount": 1 }

3.18.创建订单

  • 地址:http://39.106.207.193:3000/api/order
  • 请求方式:POST
  • Body参数:
{
  "consignee": "陈某",
  "city": "成都市",
  "country": "86",
  "province": "四川省",
  "district": "武侯区",
  "address": "滨江北路2段",
  "mobile": "17777777777",
  "shipping_fee": "10.00",
  "actual_price": "107.00",
  "order_price": "107.00",
  "goods_price": "117.00",
  "orderGoods":[
	{"product_id":178,"number":2},
	{"product_id":179,"number":1}
  ]
}
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "id": 25,
  "order_sn": "alipay_20200415174841",
  "order_status": 0,
  "shipping_status": 0,
  "pay_status": 0,
  "consignee": "陈某",
  "city": "成都市",
  "country": "86",
  "province": "四川省",
  "district": "武侯区",
  "address": "滨江北路2段",
  "mobile": "17777777777",
  "postscript": "",
  "shipping_name": "",
  "pay_id": "0",
  "pay_name": "",
  "shipping_fee": "10.00",
  "actual_price": "107.00",
  "integral": 0,
  "integral_money": "0.00",
  "order_price": "107.00",
  "goods_price": "117.00",
  "add_time": "2020-04-15T09:48:42.000Z",
  "confirm_time": null,
  "pay_time": null,
  "freight_price": 0,
  "coupon_price": null,
  "callback_status": "true",
  "full_cut_price": null,
  "shipping_no": null,
  "order_type": null
}

3.19.我的订单

  • 地址:http://39.106.207.193:3000/api/order?join=orderGoods&join=orderGoods.product&join=orderGoods.product.goods&limit=5&page=1
  • 请求方式:GET
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "data": [
    {
      "id": 25,
      "order_sn": "alipay_20200415174841",
      "order_status": 0,
      "shipping_status": 0,
      "pay_status": 0,
      "consignee": "陈某",
      "city": "成都市",
      "country": "86",
      "province": "四川省",
      "district": "武侯区",
      "address": "滨江北路2段",
      "mobile": "17777777777",
      "postscript": "",
      "shipping_name": "",
      "pay_id": "0",
      "pay_name": "",
      "shipping_fee": "10.00",
      "actual_price": "107.00",
      "integral": 0,
      "integral_money": "0.00",
      "order_price": "107.00",
      "goods_price": "117.00",
      "add_time": "2020-04-15T09:48:42.000Z",
      "confirm_time": null,
      "pay_time": null,
      "freight_price": 0,
      "coupon_price": null,
      "callback_status": "true",
      "full_cut_price": null,
      "shipping_no": null,
      "order_type": null,
      "orderGoods": [
        {
          "id": 36,
          "goods_name": "女式无痕真丝内裤",
          "goods_sn": "1127024",
          "number": 2,
          "market_price": "42.90",
          "retail_price": "39.00",
          "goods_specifition_name_value": null,
          "is_real": 0,
          "goods_specifition_ids": "",
          "list_pic_url": "http://yanxuan.nosdn.127.net/0a70f12a712e90d7d93beec4f686fe8e.png"
        },
        {
          "id": 37,
          "goods_name": "女式蝶边真丝内裤",
          "goods_sn": "1127025",
          "number": 1,
          "market_price": "42.90",
          "retail_price": "39.00",
          "goods_specifition_name_value": null,
          "is_real": 0,
          "goods_specifition_ids": "",
          "list_pic_url": "http://yanxuan.nosdn.127.net/b2fe79c872a8a7f647264b5e51bcc802.png"
        }
      ]
    }
  ],
  "count": 1,
  "total": 1,
  "page": 1,
  "pageCount": 1
}

3.20.我的收藏

  • 地址:http://39.106.207.193:3000/api/collect?join=product&join=product.goods&limit=5&page=1
  • 请求方式:GET
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{
  "data": [
    {
      "id": 75,
      "value_id": 7,
      "add_time": 1586946095,
      "is_attention": 0,
      "type_id": 0,
      "product": {
        "id": 7,
        "goods_id": 1006002,
        "goods_specification_ids": "",
        "goods_sn": "1006002",
        "goods_number": 100,
        "retail_price": "899.00",
        "market_price": "0.00",
        "goods": {
          "id": 1006002,
          "sort_order": 23,
          "goods_number": 100,
          "goods_sn": "1006002",
          "goods_brief": "设计师原款,精致绣花",
          "name": "轻奢纯棉刺绣水洗四件套",
          "goods_desc": "

......


"
, "goods_unit": "件", "primary_pic_url": "http://yanxuan.nosdn.127.net/599ee624350ecb9e70c32375c0cd4807.jpg", "list_pic_url": "http://yanxuan.nosdn.127.net/8ab2d3287af0cefa2cc539e40600621d.png", "promotion_desc": "限时购", "market_price": "988.90", "retail_price": "899.00", "sell_volume": 168, "primary_product_id": 1006003 } } } ], "count": 1, "total": 1, "page": 1, "pageCount": 1 }

3.21.支付宝支付

  • 地址:http://39.106.207.193:3000/api/alipay/aliPay?order_id=25
  • 请求方式:GET
  • 请求头:
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3QiLCJ1c2VyX2lkIjo2NiwiZW1haWxfc3RhdHVzIjowLCJpYXQiOjE1ODY4NzEwMzgsImV4cCI6MTU4Njg3ODIzOH0.vwlwGV2gdJiBo7RVqv-xwKs5STcjdnOKgqtlXjgqWt8
  • 响应:
{"code":200,"msg":"success","data":{"url":"https://openapi.alipaydev.com/gateway.do?method=alipay.trade.page.pay&app_id=2016092000556038&charset=utf-8&version=1.0&sign_type=RSA2×tamp=2020-04-15%2018%3A32%3A48¬ify_url=http%3A%2F%2F0.0.0.0%3A3000%2Fapi%2Falipay%2Fnotify&sign=xjmweW9MxkCwO2hWTEbc7olyE4GeTe7q5n4arXcjduYaH3Tf%2BawG1yl1n1JsBTdnUgEBZE8H%2Fh3CaSoS88nwGl4IWX5%2FBZckdcDOsw2SYYb5AF1sJhtS%2Bjm28mrgbtbxNzxJXoHPvdeJitcL23BrsVpG67ifuYa69SMtgIes6nhrwJFHQAmJ4C4KwP3Dhvmht36LfFYvYASRL017GTYSAnxB2tJL%2BxDe5fnlqXmZUxHx2H1FyOdPrgEdVpd5FCBpU2633o09qBahjBJ8L513eYaVQV9x3fjMU%2B57OL0gzTO05V51bnJSmPzcYC5luJCVU715XIm1qzoN26H9eCtz%2Fg%3D%3D&alipay_sdk=alipay-sdk-nodejs-3.0.8&biz_content=%7B%22out_trade_no%22%3A%22alipay_20200415174841%22%2C%22product_code%22%3A%22FAST_INSTANT_TRADE_PAY%22%2C%22total_amount%22%3A%22107.00%22%2C%22subject%22%3A%22%E5%A5%B3%E5%BC%8F%E6%97%A0%E7%97%95%E7%9C%9F%E4%B8%9D%E5%86%85%E8%A3%A4%22%2C%22body%22%3A%22%E5%A5%B3%E5%BC%8F%E6%97%A0%E7%97%95%E7%9C%9F%E4%B8%9D%E5%86%85%E8%A3%A4%22%7D"}}

注:支付宝支付在沙箱环境中,必须使用特定账号登陆支付,沙箱环境不支持退款功能。

沙箱账号 : amqjcs8585@sandbox.com
沙箱账号密码 : 111111
沙箱账号支付密码 : 111111

你可能感兴趣的:(项目)