linsir6 / JD-shopping-mall-server

一款高仿京东商城的安卓项目的后台系统,目前采用typescript + node + egg(koa2) + typeORM

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JD-shopping-mall-server

一款高仿京东商城的安卓项目的后台系统,目前采用 typescript + node + egg(koa2) + typeORM

Api接口:

baseUrl : xxxx

  1. 注册:

method : post

url : /user/register

入参:
{
    "phone" : 17645168888,
    "password" : "qwe123"
}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {}
}

  1. 登录

method : post

url : /user/login

入参:
{
    "phone" : 17645168888,
    "password" : "qwe123"
}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {
      "userInfo" : {
          "img" : "xxx",
          "name" : "xxx",
          "token" : "xxx"
      }
    }
}

  1. 获取首页数据

method : get

url : /home/index

入参:
{

}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {
      "goods" : [
          {
             "id": 1,
             "name": "书1",
             "price": 100,
             "count": 199,
             "type": 1,
             "describe": "书"
          },
          {},
          {}    
      ]
    }
}

  1. 获取商品详情

method : get

url : ``/goods/details`

入参:

query: ?goodId=2

出参:
{
    "code": 0,
    "msg": "",
    "data": {
        "details": {
            "id": 2,
            "name": "书2",
            "price": 100,
            "count": 199,
            "type": 1,
            "describe": "书"
        }
    }
}

  1. 分类页面数据展示

method : get

url : /sort/index

入参:
{

}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {
      "goods" : [
          {
            "name" : "xxx",
            "price" : 100,
            "count" : 100,
            "describe" : "",
            "type" : 1
            },
          {},
          {}    
      ]
    }
}

  1. 购物车列表

method : get

url : /shopping/index

入参:
{

}

query : ?userId=1

出参:
{
    "code": 0,
    "msg": "",
    "data": {
        "goods": [
            {
                "id": 1,
                "userId": 1,
                "goodsId": 1,
                "count": 2,
                "goodsDetails": {
                    "id": 1,
                    "name": "书1",
                    "price": 100,
                    "count": 199,
                    "type": 1,
                    "describe": "书"
                }
            },
            {},
            {}
        ]
    }
}

  1. 加入购物车

method : post

url : /shopping/add

入参:
{
  "goods": [
    {
      "name" : "xxx",
      "price" : 100,
      "count" : 100,
      "describe" : "",
      "type" : 1 //1.添加 2.删除
    },
    {},
    {}    
  ]
}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {}
}

  1. 从购物车删除

method : post

url : /shopping/delete

入参:
{
  "id" : 12345
}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {}
}

  1. 结算购物车

method : post

url : /shopping/pay

入参:
{
    "id" : 1
}
出参:
{
    "code" : 0,
    "msg" : "success",
    "data" : {}
}

About

一款高仿京东商城的安卓项目的后台系统,目前采用typescript + node + egg(koa2) + typeORM

License:Apache License 2.0


Languages

Language:TypeScript 100.0%