Giter VIP home page Giter VIP logo

car_wash's Introduction

接口

登录

Request

{
	"user":"user",
	"password":"password"
}

Response

返回一个token,后面的请求的header需要添加Authorization: token

{
    "success": true,
    "msg": "",
    "obj": "Basic token"
}

用户

添加用户

http POST请求

url: http://host:port/car_wash/v1/user

Request

{
    "user":{
        "name":"zyx", //姓名
        "phone":13788888888, //电话
        "type":1,  //类型
        "restMoney":1000  //余额
        "vehicleLicense": "苏J12345" //车牌
    }
}

Response

{
    "success": true,
    "msg": "",
    "obj": ""
}

查询用户

http GET请求

url: http://host:port/car_wash/v1/user

Response

{
    "success": true,
    "msg": "",
    "obj": [
        {
            "id": 3,
            "name": "zyx",
            "phone": 13788888888,
            "type": 1,
            "restMoney": 1000,
            "vehicleLicense": ""
        }
    ]
}

修改用户

http PUT请求

url: http://host:port/car_wash/v1/user

Request

{
	"phone":1375108989,
	"user": {
	    "name":"zyx",
	    "phone":13788888888,
	    "type":2,
	    "restMoney":3000
	}
}

Response

{"success":true,"msg":"","obj":null}

删除用户

http DELETE请求

url: http://host:port/car_wash/v1/user/{id}

Response

{"success":true,"msg":"","obj":null}

充值

http POST请求

url: http://host:port/car_wash/v1/user/money

Request

{
    "phone":13788889898,
    "money":1000
}

Response

{"success":true,"msg":"","obj":null}

交易

查询交易

http GET请求

url: http://host:port/car_wash/v1/transaction

Response

{
    "success": true,
    "msg": "",
    "obj": [
        {
            "id": 1, //主键
            "type": "精洗",  //交易类型
            "cost": 150,   //交易金额
            "date": "2018-08-06 15:00:00",  //交易时间
            "license": "苏J12345",  //车牌
            "phone": 13888888888,   //会员手机
            "payMethod": 2  //支付方式
        }
    ]
}

新增交易

http POST请求

url: http://host:port/car_wash/v1/transaction

Request

{
    "transaction":{
            "type": "精洗",
            "cost": 150,
            "date": "2018-08-06 15:00:00",
            "license": "苏J88099",
            "phone": 13751089898,
            "payMethod": 2
    }
}

Response

{"success":true,"msg":"","obj":null}

修改交易

http PUT请求

url: http://host:port/car_wash/v1/transaction

Request

{   
    "id":1,
    "transaction":{
            "type": "精洗",
            "cost": 200,
            "date": "2018-08-06 15:00:00",
            "license": "苏J88099",
            "phone": 13788888888,
            "payMethod": 2
    }
}

Response

{"success":true,"msg":"","obj":null}

删除交易

http DELETE请求

url: http://host:port/car_wash/v1/transaction/1

Response

{"success":true,"msg":"","obj":null}

car_wash's People

Contributors

zyx8375699 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.