后台需求 - nongji/wowo GitHub Wiki

参数格式: 1.用户信息接口: content-type:multipart/form-data

name:"data" content:一个json字符串 
{ 
"location":"",
 "token":"", 
"location_coordinate":"xx.xxxxxx,yy.yyyyyy",
"user_type":"" 
} 
name:id_card_1 content:一个png文件 
name:id_card_2 content:一个png文件 
name:certificate_1 content:一个png文件 
name:certificate_2 content:一个png文件 ps:可能没有,在user_type是公司或者合作社时有

2.农机登记接口: content-type:multipart/form-data

name:"data" content:一个json字符串 
{ "token":"", 
"drive_type":"", 
"driver_name":"", 
"driver_age":"", 
"driver_gender":"", 
"license_type":"", 
"machine_type":"", 
"machine_name":"", 
"machine_power":"", 
"passenger_num":"", 
"wheel_distance":"", 
"check_time":"", 
"pay_type":"", 
"lease_month":"", 
"lease_time":"", 
"work_condition":"", 
"need_type":"", 
"with_item":"", ps:可能没有 在need_type是with的时候有 
"house_type":"", 
} 
name:driver_license content:一个png文件 
name:machine_license1 content:一个png文件 
name:machine_license2 content:一个png文件

3.获取登记的农机信息列表的接口:content-type:application/json

{ "token":"" }

返回这个用户登记过的所有农机的信息,每个农机的信息包括农机登记接口中json中的除token外的参数外加上传的图片名和这个农机信息对应的id(不是用户id,是农机信息自身的id)

4.获取图片的接口:content-type:application/json { "token":"", "filename":"" } 返回一个图片

5.获取单个农机信息的接口:content-type:application/json

{ 
"token":"", 
"id":"" ps:农机信息的id 
}

返回这个id对应的农机信息 参数和 4 中单个农机信息的参数一样

6.修改单个农机信息的接口:content-type:multipart/form-data

post请求的参数包含2中的所有参数,json里多一个农机信息的id

7.删除某个农机信息的接口:content-type:application/json

{ "token":"", "id":"" } 

删除对应id的农机信息

8.上传在某个农机信息下进行评论的接口:content-type:application/json

{ 
"token":"", 
"content":"", 
"name":"", 
"time":"", 
"reply_to":"" 
}

reply_to是回复某个评论时被回复用户的name

9.获取某个农机信息下的评论列表的接口:content-type:application/json

{ 
"token":"", 
"id":"" ps:农机信息的id 
} 

返回这个农机信息下的所有评论,单个评论的参数包括8中除token外所有的参数外加这个评论的id

10.获取某个某个区域下的农机需求信息列表的接口:content-type:application/json

{ "token":"", 
"location":"" ps:地址
 "location_coordinate":"" ps:地址的经纬度 格式是latitude,longitude 
  radius:"" ps:距离半径
} 

返回的单个农机需求的参数为

{ "id":"", ps:需求的id 
"publisher_name":"", ps:发布者name 
"time":"", ps:发布时间 格式yyyy-mm-dd hh:mm::ss 
"type":"", ps:农田类型 
"location":"",
 "price":"", 
"machine_type":"", ps:所需的农机类型 
"area":"", ps:农田面积 
"start_time":"", 
"end_time":"" 
}

11.对某个农机需求发布报价:content-type:application/json

{
     "id":"", ps:需求的id 
     "offer_price":"", ps:报价
     "offer_username":"", ps:报价者  
     "offer_machine_id":""  ps:农机id
}

另外 登录时返回的信息加个用户名 用户手机号 是否填写过验证信息

** 更新 **

12.获取我的报价列表:content-type:application/json post的参数是token 返回的单个jsonobject参数名

"id"   //报价的id
"time"   //报价发布时间 
machine_id"    //报价的农机的id                
"location"     //需求的农田地址
"price"      //报价
"machine_name"    //报价农机的name
"demand_id"      //农机需求的id

13.获取我的订单列表:content-type:application/json post的参数是token

返回的单个jsonobject参数名

"id"   //订单的id
"time"   //订单达成的时间
"machine_id"    //农机的id
"location"      //需求中农田的地址
"price"            //价格
"machine_name"      //农机名
"demand_id"        //需求id
"machine_type"     //农机信息中的农机类型
"machine_power"     //农机的马力
"machine_powertype"    //农机的动力类型
"passenger_num"    //最大乘客数
"is_commented"    //订单是否被农机主评论过 1是未被评论 2是已被评论

14.发送评论信息:content-type:application/json post的jsonobject参数

"token" 
"id"   //订单的id
"comment_content"  //评论内容
"rating"   //评分 1-5的整数

15.获取评论信息:content-type:application/json post的jsonobject参数

"token" 
"id"   //订单的id

返回的参数

"comment_content"  //农机主的评论内容
"rating"   //农机主的评分 1-5的整数
"user_comment_content"  //农机用户的评论内容
"user_rating"   //农机用户的评分 1-5的整数
16.获取回复我的评论的列表:content-type:application/json 
post的json参数
"token"
返回评论中reply_to中是token对应的 的username的消息的列表 参数
"id" ps:这个id是回复我的消息所属的评论列表的id 不是这条消息本身的账户
"content": 回复内容
"name"  消息的发布者name
"time" 消息时间
"reply_to" ""  就是token对应的username