@yibo
2016-01-21T03:02:46.000000Z
字数 2097
阅读 657
H5接口
所有的请求均需要带"票",服务端的会将"票"以p
为键传回,前端用${p}
的方式取出票,发送请求时加一下就 OK 了(p=${p}
)
后端会向第一个页面传以下参数:
字段 | 类型 | 说明 |
---|---|---|
p | String | ticket (所有请求均要带票) |
school | UUID | 学校 id (请求数据要用到) |
user | UUID | 当前用户的 id (加好友要用到) |
username | String | 当前用户的名字(加好友要用到) |
photo | String | 当前学校的封面图,可能没有 |
bgColor | String | 背景色 |
/superstar/school/star
GET AJAX
参数名 | 必选 | 类型及范围 | 说明 |
---|---|---|---|
cursor | false | String | 第一次不用传,之后直接传返回结果中的nextCursor 就行了 |
count | false | int | 默认20 |
school | true | String | ${school} |
p | true | String | ${p} |
* 返回结果:
{
"list": [
{
"uuid": "2GTN7V9nu7DW16qv20-Hlg",
"name": "王二哈",
"headImg": "http://p-test.jiemosrc.com/ID6dvrn9MZLo7csz1RiiBg.jpeg@640w_640h_75q.jpeg",
"school": "北京大学/数学科学学院/2100级",
"time": "15小时前",
"superstar": true,
"new": true,
"faverCount": 59,
"footprintCount": 53,
"photoCount": 6,
"photo": "http://p-test.jiemosrc.com/ID6dvrn9MZLo7csz1RiiBg.jpeg",
"relationStatus": 1
},
{
"uuid": "A5r4q6AoALzW16qv20-Hlg",
"name": "慕魚3",
"headImg": "http://p-test.jiemosrc.com/Te9xqGzn1xro7csz1RiiBg.jpeg@640w_640h_75q.jpeg",
"school": "北京大学/马克思主义学院/2015级",
"time": "刚刚",
"superstar": true,
"new": false,
"faverCount": 7,
"footprintCount": 13,
"photoCount": 8,
"photo": "http://p-test.jiemosrc.com/Te9xqGzn1xro7csz1RiiBg.jpeg",
"relationStatus": 6
}
],
"hasMore": true,
"nextCursor": "1444902453258"
}
字段 | 类型 | 说明 |
---|---|---|
uuid | String | 用户的 UUID |
name | String | 名字 |
headImg | String | 头像 |
school | String | 学校信息 |
time | String | 右上角那个时间 |
superstar | boolean | 是否是校园之星 |
new | boolean | 是否是新晋校园之星,如果为 true,右上角不显示那个时间,显示“新” |
faverCount | int | 点赞数 |
footprintCount | int | 访客数 |
photoCount | int | 照片数 |
photo | String | 用户照片 |
relationStatus | int | 好友关系:1请求加好友中(我发出好友请求) 6等待同意(我收到好友请求) |
* hasMore: true
还有下一页,false
没有下一页了并且不返回nextCursor
* nextCursor: 只有在 hasMore
为 true
时才有(这个值在请求下一页时直接原样传入即可)
url 直接用下面这个就行了(这个不用带票,会自动跳到客户端对应页面)
jiemoapp://j/smart?t=7&i=uuid
调用 API。API 内网 host:http://api798.jiemoapp.com
,外网 host:http://api.jiemoapp.com
当 relationStatus==6
时,调用
/api/friend/success/greet
POST
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
user | true | UUID | 对方的 UUID |
{
"meta": {
"code": 1,
"errInfo": "...."
}
}
code
值有以下几种可能,
成为好友
因为TA的权限设置,你的互动被芥末君吃掉了。
errInfo
的内容并显示errInfo
的内容并显示errInfo
的内容并显示当 relationStatus==1
时,显示“已申请”
其他情况时,调用以下接口发好友请求:
/api/greet/text
POST
参数名 | 必选 | 类型 | 说明 |
---|---|---|---|
session | true | UUID.UUID | from.to |
text | true | String | "hi,我是***" |
code
: