api接口文档

api

    • 首页
      • 每日推荐
      • 最新挂出
      • 最新需求
    • 商品
      • 商品列表
      • 商品详情
      • 购买
      • 确认收货
    • 需求
      • 需求列表
      • 需求接单
      • 确认接单
    • 我的
      • 注册
      • 登录检查
      • 修改个人信息
      • 我的收藏
      • 我挂出的
      • 我买到的
      • 全部订单

首页

每日推荐

  • 简要描述:随便2个商品
  • 请求URL:
    https://yuyangstudy.xyz/home/recommend
  • 请求方式: GET
  • 参数: 无
  • 返回参数:
参数名 类型 说明
goods_name string 商品名字
image_src string 图片路径
goods_id number 商品id
goods_price number 价格
  • 返回示例:
{
	"message":[
		{
			"image_src":"https://yuyangstudy.xyz/static/picture1.jpg"
			"goods_name": "二手相机"
			"goods_id":1
			"goods_price":100
		}
		{
			"image_src":"https://yuyangstudy.xyz/static/picture1.jpg"
			"goods_name": "二手相机"
			"goods_id":1
			"goods_price":100
		}
	]
}

最新挂出

  • 简要描述: 最新挂出的2个商品
  • 请求URL:
    https://yuyangstudy.xyz/home/newgoods
  • 请求方式: GET
  • 参数: 无
  • 返回参数, 返回示例同上

最新需求

  • 描述: 最新挂出的2个需求
  • URL:
    /home/newdemand
  • 请求方式: GET
  • 参数: 无
  • 返回参数
参数名 类型 说明
demands_detail string 需求基本信息
demands_time string 发布时间
demands_position string 需求地点
demands_id number 需求id
salary number 佣金价格
  • 返回示例
{
	"message":[
		{
			"demands_detail":"代取快递"
			"demands_time":"2020.5.19 21:00"
			"demands_position":"沙河校区"
			"demands_id:1324
			"salary":10
		}
		{
			"demands_detail":"代取快递"
			"demands_time":"2020.5.19 21:00"
			"demands_position":"沙河校区"
			"demands_id:1324
			"salary":10
		}
		
	]
}

商品

商品列表

  • 描述: 20个商品
  • URL:
    /goods/query
  • 参数:
参数名 类型 必选 说明
query string 商品关键字
pagenum number 页码, 一个页面最多20条数据
classid 分类id 类型id
  • 请求方法: GET
  • 返回参数
参数名 类型 说明
goods_name string 商品名字
image_src string 图片路径
goods_id number 商品id
goods_price number 价格

商品详情

  • 描述: 商品的详细信息
  • URL:
    /goods/detail
  • 请求方式: GET
  • 参数列表
参数名 类型 必选 说明
goods_id number 商品id
  • 返回参数
参数名 类型 说明
goods_id number 商品id
classid number 类型id
goods_name string 商品名称
goods_price number 价格
goods_image string 商品图片地址
goods_introduce string 商品介绍
goods_image_list Array 商品详细图片url列表
  • 返回示例:
{
	"message":{
		"goods_id":1
		"classid":1
		"goods_name":"数学分析下"
		"goods_price":10
		"goods_image":"https://yuyangstudy.xyz/static/picture1.jpg"	"goods_introduce":
		"goods_image_list":[
			"https://yuyangstudy.xyz/static/picture1.jpg",
			"https://yuyangstudy.xyz/static/picture1.jpg",
			"https://yuyangstudy.xyz/static/picture1.jpg",
		]
	}
		
}

购买

  • 描述: 购买商品
  • 请求方式: POST
  • URL:
    /goods/buy
  • 参数列表
参数名 类型 必选 说明
goods_id number 商品id
user_id number 用户id
  • 返回参数
参数名 类型 说明
contact_way string 商品主人QQ号

确认收货

  • 描述: 购买者收到货后确认收货, 确认收货后商品状态变成已售出, 不在向用户推荐该商品
  • 请求方式: POST
  • URL:
    /goods/confirm
  • 参数列表
参数名 类型 必选 说明
goods_id number 商品id
user_id number 用户id

需求

需求列表

  • 描述: 20个需求
  • 请求方式: GET
  • URL:
    /demands/all
  • 参数:
参数名 类型 必选 说明
pagenum number 页码, 一页最多二十条数据
  • 返回参数
参数名 类型 说明
demands_detail string 需求基本信息
demands_time string 发布时间
demands_position string 需求地点
demands_id number 需求id
salary number 佣金价格
  • 返回示例
{
	"message":[
		{
			"demands_detail":"代取快递"
			"demands_time":"2020.5.19 21:00"
			"demands_position":"沙河校区"
			"demands_id:1324
			"salary":10
		}
		{
			"demands_detail":"代取快递"
			"demands_time":"2020.5.19 21:00"
			"demands_position":"沙河校区"
			"demands_id:1324
			"salary":10
		}
		...
		
	]
}

需求接单

  • 描述: 接单
  • 请求方式: POST
  • URL:
    /demands/takeorder
  • 请求参数
参数名 类型 必选 说明
demands_id number 需求id
user_id number 用户id
  • 返回参数
参数名 类型 说明
contact_way string 需求主人QQ号

确认接单

  • 描述: 确认接单后, 需求状态变成已完成
  • 请求方式: POST
  • URL:
    /demands/confirm
  • 参数:
参数名 类型 必选 说明
goods_id number 商品id
user_id number 用户id

我的

注册

  • 描述: 用户注册. 后端需要向这里 接口 (点击查看详情)发送请求来获取用户openid, 需要后端发起http请求. (appid与appsecret我发到qq群里)
  • 请求方式: post
  • URL:
    /user/login
  • 参数
参数名 类型 说明
username string 用户真实名字
student_id string 学号
code string 微信生成的随机码, 用来获取用户的openid
qqnumber number qq号
phone_num number 手机号
position number 用户所在校区(0:沙河 1:本部 2:宏福)
  • 返回参数
参数名 类型 说明
userid number 用户id

登录检查

  • 描述: 登录检查, 后端发送请求查询该code对应openid是否已注册, 若已注册, state为1, 并返回用户信息, 若未注册, state为0.
  • 请求方式: GET
  • URL:
    /user/register
  • 参数
参数名 类型 必选 说明
code string 微信生成的随机码, 用来获取用户的openid
  • 返回参数:
参数名 类型 说明
state number 是否已注册(0或1)
userid number 用户id
qqnumber number qq号
phone_num number 手机号
position number 用户所在校区(0:沙河 1:本部 2:宏福)
username string 用户真实名字
student_id string 学号

修改个人信息

  • 描述: 修改信息
  • 请求方式: POST
  • URL
    user/edit
  • 请求参数:
参数名 类型 说明
userid number 用户id
username string 用户真实名字
student_id string 学号
qqnumber number qq号
phone_num number 手机号
position number 用户所在校区(0:沙河 1:本部 2:宏福)

我的收藏

我挂出的

我买到的

全部订单

你可能感兴趣的:(api接口文档)