@lina
2016-05-20T03:55:29.000000Z
字数 4787
阅读 1061
益宠公益 api 1.0 iOS Android
token: [string] 登录后获取的登录认证信息
error_code: [int] 服务器状态码,0 为正常状态,异常状态待定。error_message:[string] 错误信息,仅error_code不为 0 时返回
data: [object] 数据字段,所有响应数据都在此字段中list: [array],当返回数据为列表时会将数据放在该字段
pageInfo: [object] 分页信息,当返回数组数据时会携带该字段
currentPage: [int] 当前页码totalPage: [int] 总页数pageSize: [int] 每页数量
示例
{error_code: 0,data: {key: value,list: [{key: value}],pageInfo {}}}
通用上传文件服务
请求URL
POST
请求参数
tokenfile: 文件
响应
{errorCode: 0,data: {id: "9d377b10ce778c4938b3c7e2c63a229a.jpg",w: 1024,h: 768}}
id: [string] 头像名称w: [int] 头像宽度h: [int]头像宽度
{id: 123,name: '白色'}
id: [int] 颜色idname: [string] 颜色显示名称:全部|白色|黑色|棕色|黄色|灰色|花色
{id: 123,name: '大型犬'}
id: [int] 体型idname: [string] 体型显示名称:全部|小型犬|中型犬|大型犬
{id: 123,name: '女孩'}
id: [int] 性别id:0|1|2name: [string] 性别显示名称:全部|男孩|女孩
{name: '鼓楼大街小区',fullAddress: '北京市鼓楼大街小区23号楼',latitude:106.3,longitude:39.6}
name: [string]fullAddress: [string]latitude: [float] 维度longitude: [float] 经度
{id: 123,pet_code: 'YC00001',name : '帅帅',age: '1岁5个月',profile: 'http://xxxxx',is_immuned : 1,is_sterilization: 1,color : '@宠物颜色',sex: '@性别',figure : '@犬体型',is_adopted: 0,adoption_time: 14839000,distance:13000,publisher: {helper:'@救助人',organization:'@救助机构',public_time: 1429549593193,},}
id: [int] 宠物IDpet_code: [string] 宠物编码:【规则】YC大写00001~99999name: [string] 名字age: [string] 年龄profile: [string] 头像Url(领养后由宠物主人上传;领养前为救助人或者机构上传)16:9is_immuned: [bool] 是否免疫is_sterilization: [bool] 是否绝育color: [object] '@宠物颜色'sex: [object] '@性别'figure: [object] '@犬体形'is_adopted: [bool] 是否被领养adoption_time: [int] 领养时间戳distance: [float]距离本手机定位的距离publisher: [object] helper和organization人选其一public_time: [int]发布时间
{pet: '@宠物列表信息',publisher_comment : '这只狗狗非常的活泼温顺,xxxx'shop: ['@爱心商盟','@爱心商盟'],detail_image : ['http://xxxxx','http://xxxxx'],video: '@视频',}
pet: [object]宠物信息helper_comment: [string] 发布者对狗狗的评价shop: [array]商铺数组detail_image:[array]详情图片16:9video: [object] 视频对象
{id: 1,name: '李娜',nickname:'老板',profile: 'http://xxxxxx',sex: '@性别',is_married:1is_allergy:1has_pet:1pet_habit:2moving_affect:3}
id: [int] 人 IDname: [string] 名字nickname: [string] 昵称profile: [string] 头像地址is_married: [bool] 是否已婚is_allergy: [bool] 是否过敏has_pet: [bool] 是否有宠物pet_habit: [int] 是否了解宠物习惯:1:熟悉 2:一般 3:不知道moving_affect: [int] 搬家是否有影响:1:没影响 2:有影响 3:不好说
{id: 1,name: '李娜',nickname:'老板',profile: 'http://xxxxxx',sex: '@性别',telephone: '010-8900077',address: '@地址'}
id: [int] 人 IDname: [string] 名字nickname: [string] 昵称profile: [string] 头像地址sex: [object] 性别telephone: [string] 电话可以是座机或者手机address: [object]'@地址'
{id: 1,name: '北京领养日公益机构',logo: 'http://xxxxxx',telephone: '010-8900077',address: '@地址'}
id: [int] 机构 IDname: [string] 名字logo: [string] 机构图片1:1telephone: [string] 电话可以是座机或者手机address: [object]'@地址'
{id: 1,name: '北京领养日公益机构',logo: 'http://xxxxxx',telephone: '010-8900077',address: '@地址'introduction: '本医院位于xxx',service: '本宠物的洗澡美容由本医院免费提供,如果领养成功,本店继续提供',type: 1}
id: [int] 机构 IDname: [string] 名字logo: [string] 机构图片1:1telephone: [string] 电话可以是座机或者手机address: [object]'@地址'introduction: [string] 简介service: [string]爱心服务type: [int] 1:宠物店 2:宠物医院
{id: 1,content: '益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动',public_time: 14899000,publisher:'@用户',pet:'@宠物列表信息',images:['http://xxxxxx','http://xxxxxx'],agree_num:100}
id: [int] 故事 IDcontent: [string] 发布内容public_time: [int] 发表时间:时间戳publisher: [object] 发布人Userpet: [object]images: [array] 发布图片数组1:1agree_num: [int] 被赞的数目
{id: 1,title: '益宠公益开展领养人宠物知识培训活动',content: '益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动益宠公益开展领养人宠物知识培训活动',summary: '益宠公益开展领养人宠物知识培训活动',address: '@地址',telephone: '010-8900077',person_incharge: '李娜',thumbnail: 'http://xxxxxx',detail_image: 'http://xxxxxx',start_time: 14899000,public_time: 14899000detail_image: 'http://xxxxxx',}
id: [int] 活动 IDtitle: [string] 活动名称content: [string] 活动内容详情summary: [string] 活动摘要address: [object]'@地址'telephone: [string] 电话可以是座机或者手机person_incharge: [string]负责人thumbnail: [string] 缩略图1:1detail_image: [string] 详情图start_time: [int] 活动时间public_time: [int] 发表时间
{cover: 'http://xxxxxx',video: 'http://xxxxxx'}
cover: [string] 视频封面video: [string] 视频地址
【测试Base】http://huiyangche.duapp.com/yc/mock
【线上Base】
请求 header Content-Type:application/json
请求URL
POST /pet/list/dog
POST /pet/list/cat
【测试】狗
【测试】猫
【正式】
响应
{error_code: 0,data: {list: ['@宠物列表信息'],pageInfo: ['@分页字段']}}
请求URL
POST /pet/detail/{id}
【测试】
【正式】
响应
{error_code: 0,data: {'@宠物详情'}}
请求URL
POST /story/list
【测试】
【正式】
响应
{error_code: 0,data: {list: ['@故事'],pageInfo: ['@分页字段']}}
请求URL
POST /my/stories
【测试】
【正式】
响应
{error_code: 0,data: {list: ['@故事'],pageInfo: ['@分页字段']}}
请求URL
POST /activity/list
【测试】
【正式】
响应
{error_code: 0,data: {list: ['@活动'],pageInfo: ['@分页字段']}}
请求URL
/activity/detail/{id}
POST
【测试】
【正式】
响应
{error_code: 0,data: {'@活动'}}
请求URL
POST /my/pets
【测试】
【正式】
响应
{error_code: 0,data: {list: ['@宠物列表']}
请求URL
POST /shop/list
【测试】
【正式】
响应
{error_code: 0,data: {list: ['@爱心商盟'],pageInfo: ['@分页字段']}}