接口文档信息
使用常用的get/post请求方式,且涉及cookies和接口数据依赖,尽量模拟实际项目场景。
1.登录
url:http://localhost:8888/login
请求方式:POST
Content-Type: application/json
request:
{ "username": "zhang", "password": "123456" }
response:
{ "msg": "login success", "status": "200" }
2.提交订单
url:http://localhost:8888/shop/submitOrder
请求方式:POST
Content-Type: application/json
request:
{ "goodsId": "11000", "addressId": "99", "cardId": 0, "buynum": 1 }
response:
{ "msg": "提交订单成功", "orderNumber": "1343359743", "tradestatus": 1 }
3.余额支付
url:http://localhost:8888/shop/payOrder
请求方式:POST
Content-Type: application/json
request:
{ "addressId": "99", "cardId": 0, "orderId": "1343359743", --- 此参数为变量, 从提交订单接口获取 "pay_password": "123456", "pay_type": 3, "weixin_type": "h5" }
response:
{ "msg": "提交订单成功", "orderNumber": "1343359743", "tradestatus": 1 }
3.取消订单
url:http://localhost:8888/shop/cancelOrder
请求方式:POST
Content-Type: application/json
request:
{ "orderId": "1343359743", ---此参数为变量,从提交订单接口获取 "reason": "Don't like" }
response:
{ "msg": "取消订单成功", "tradestatus": 3 }
4.获取个人信息
url:http://localhost:8888/user/getUserInfo
请求方式:GET
Content-Type: application/json
request:
{ "orgid": "666" }
response:
{ "uid": "71536528", "name": "zhangsan", "nickname": "zhangsanfen", "age": 88 }
5.修改昵称
url:http://localhost:8888/user/modUserInfo
请求方式:POST
Content-Type: multipart/form-data
request:
{ "uid": "71536528", ---此参数为变量,从获取个人信息接口获取 "nickname": "zhangsifeng" }
response:
{ "msg": "修改昵称成功" }
接口请求流程
版权声明:如无特殊说明,文章均为本站原创,转载请注明出处
本文链接:http://example.com/article/java_interface2/