用户关系
1. 设置用户好友关系
设置为好友和取消好友是双向关系
1.0.1. 地址
http://domain:18080/admin/friend/status
1.0.2. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
userId | string | 是 | 用户ID |
friendUid | string | 是 | 对方ID |
status | int | 是 | 双方关系,0为好友,1为陌生人 |
好友关系与黑名单关系是分开的,如果处理黑名单请用黑名单接口
1.0.3. 响应
N/A
1.0.4. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"userId\":\"a\",\"friendUid\":\"b\",\"status\":0}" http://localhost:18080/admin/friend/status
{
"code":0,
"msg":"success",
}
1.0.5. 获取好友列表
1.0.6. 地址
http://domain:18080/admin/friend/list
1.0.7. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
userId | string | 是 | 用户ID |
1.0.8. 响应
N/A
1.0.9. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"userId\":\"a\"}" http://localhost:18080/admin/friend/status
{
"code":0,
"msg":"success",
"result":[
"b"
]
}
2. 设置黑名单
设置为黑名单是单向关系
2.0.1. 地址
http://domain:18080/admin/blacklist/status
2.0.2. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
userId | string | 是 | 用户ID |
targetUid | string | 是 | 对方ID |
status | int | 是 | 双方关系,0为取消黑名单,1为设置为黑名单 |
2.0.3. 响应
N/A
2.0.4. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"userId\":\"a\",\"targetUid\":\"b\",\"status\":1}" http://localhost:18080/admin/blacklist/status
{
"code":0,
"msg":"success",
}
2.0.5. 获取黑名单列表
2.0.6. 地址
http://domain:18080/admin/blacklist/list
2.0.7. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
userId | string | 是 | 用户ID |
2.0.8. 响应
N/A
2.0.9. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"userId\":\"a\"}" http://localhost:18080/admin/blacklist/status
{
"code":0,
"msg":"success",
"result":[
"b"
]
}
3. 设置备注
设置某个用户对另外一个用户的备注名,比如用户A设置用户B的备注名为“领导”
3.0.1. 地址
http://domain:18080/admin/friend/set_alias
3.0.2. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
operator | string | 是 | 用户ID |
targetId | string | 是 | 对方ID |
alias | string | 否 | 备注名 |
3.0.3. 响应
N/A
3.0.4. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"operator\":\"a\",\"targetId\":\"b\",\"alias\":\"Mr.Hello\"}" http://localhost:18080/admin/friend/set_alias
{
"code":0,
"msg":"success"
}
3.0.5. 获取备注
3.0.6. 地址
http://domain:18080/admin/friend/get_alias
3.0.7. body
参数 | 类型 | 必需 | 描述 |
---|---|---|---|
operator | string | 是 | 用户ID |
targetId | string | 是 | 用户ID |
3.0.8. 响应
N/A
3.0.9. 示例
curl -X POST -H "nonce:76616" -H "timestamp":"1558350862502" -H "sign":"b98f9b0717f59febccf1440067a7f50d9b31bdde" -H "Content-Type:application/json" -d "{\"operator\":\"a\",\"targetId\":\"a\"}" http://localhost:18080/admin/friend/get_alias
{
"code":0,
"msg":"success",
"result":{
"operator":"a",
"targetId":"b",
"alias":"Mr.Hello"
}
}