Friends API文档
Friends API文档
基本信息
- 标题: Passport
- 版本: 1.0
API Endpoint
https://p.unity.cn
API 接口
GET /v1/personas/{personaID}/friends
摘要: 获取好友列表
路径参数
| 参数名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| personaID | string | 是 | 角色ID |
查询参数
| 参数名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| start | integer | int64 | 否 | 起始点 |
| count | integer | int64 | 否 | 数量 |
响应
200 A successful response.
响应结构: passportGetFriendListByPersonaIDResponse
响应示例
{
"friends": [
{
"id": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"displayName": "Jack",
"iconUrl": "http://example.com/xx.png",
"idDomainID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"sourcePersonaID": "10000000054",
"targetPersonaID": "10000000055",
"sourceRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"targetRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"Alias": "exampleAlias",
"createdAt": "2023-08-16T07:17:07.363Z",
"modifiedAt": "2023-08-16T07:17:07.364Z",
"properties": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
}
],
"start": 0,
"count": 20,
"total": 1
}default An unexpected error response.
响应结构: rpcStatus
GET /v1/personas/{personaID}/friend-blacklist
摘要: 获取拉黑列表
路径参数
| 参数名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| personaID | string | 是 | 角色ID |
查询参数
| 参数名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| start | integer | int64 | 否 | 起始点 |
| count | integer | int64 | 否 | 数量 |
响应
200 A successful response.
响应结构: passportGetBlacklistByPersonaIDResponse
响应示例
{
"blacklist": [
{
"id": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"idDomainID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"sourcePersonaID": "10000000054",
"targetPersonaID": "10000000055",
"sourceRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"targetRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"createdAt": "2023-08-16T07:34:50.408Z",
"modifiedAt": "2023-08-16T07:34:50.408Z"
}
],
"start": 0,
"count": 20,
"total": 1
}default An unexpected error response.
响应结构: rpcStatus
数据模型定义
passportBlacklist
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| id | string | 否 | @gotags: bson:"_id" | |
| idDomainID | string | 否 | @gotags: bson:"id_domain_id" | |
| sourcePersonaID | string | 否 | @gotags: bson:"source_persona_id" | |
| targetPersonaID | string | 否 | @gotags: bson:"target_persona_id" | |
| createdAt | string | date-time | 否 | @gotags: bson:"created_at" create time stamp |
| modifiedAt | string | date-time | 否 | @gotags: bson:"modified_at" update time stamp |
| displayName | string | 否 | 黑名单名称 | |
| iconUrl | string | 否 | 黑名单头像地址 | |
| sourceProperties | object | 否 | 发起者的自定义信息 | |
| targetProperties | object | 否 | 接受者的自定义信息 |
passportFriendInfo
标题: 好友记录,对于每个好友关系存在两条记录(A->B) (B->A)
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| id | string | 否 | @gotags: bson:"_id" | |
| idDomainID | string | 否 | @gotags: bson:"id_domain_id" | |
| sourcePersonaID | string | 否 | @gotags: bson:"source_persona_id" | |
| targetPersonaID | string | 否 | @gotags: bson:"target_persona_id" | |
| sourceRealmID | string | 否 | @gotags: bson:"source_realm_id" | |
| targetRealmID | string | 否 | @gotags: bson:"target_realm_id" | |
| Alias | string | 否 | @gotags: bson:"alias" | |
| createdAt | string | date-time | 否 | @gotags: bson:"created_at" create time stamp |
| modifiedAt | string | date-time | 否 | @gotags: bson:"modified_at" update time stamp |
| properties | object | 否 | 自定义信息 | |
| status | string | 否 | 状态 | |
| displayName | string | 否 | 好友名称 | |
| iconUrl | string | 否 | 头像地址 | |
| sourceRealmName | string | 否 | 自己的Realm名称 | |
| targetRealmName | string | 否 | 好友的Realm名称 | |
| targetPersonaProperties | object | 否 | 好友的角色自定义信息 | |
| lastLogin | string | date-time | 否 | 好友最后上线时间 |
| sourceUserID | string | 否 | 自己的UserID | |
| targetUserID | string | 否 | 好友的UserID | |
| mutual | boolean | 否 | @gotags: bson:"mutual" |
passportGetBlacklistByPersonaIDResponse
标题: GetBlacklistByPersonaIDResponse
获取黑名单列表响应
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| blacklists | array<passportBlacklist> | 否 | - | |
| start | integer | int64 | 否 | 起始点 |
| count | integer | int64 | 否 | 数量 |
| total | integer | int64 | 否 | 总数 |
模型示例
{
"blacklist": [
{
"id": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"idDomainID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"sourcePersonaID": "10000000054",
"targetPersonaID": "10000000055",
"sourceRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"targetRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"createdAt": "2023-08-16T07:34:50.408Z",
"modifiedAt": "2023-08-16T07:34:50.408Z"
}
],
"start": 0,
"count": 20,
"total": 1
}passportGetFriendListByPersonaIDResponse
标题: GetFriendListByPersonaIDResponse
获取好友列表响应
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| friends | array<passportFriendInfo> | 否 | 好友列表 | |
| start | integer | int64 | 否 | 起始点 |
| count | integer | int64 | 否 | 数量 |
| total | integer | int64 | 否 | 总数 |
模型示例
{
"friends": [
{
"id": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"displayName": "Jack",
"iconUrl": "http://example.com/xx.png",
"idDomainID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"sourcePersonaID": "10000000054",
"targetPersonaID": "10000000055",
"sourceRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"targetRealmID": "7bba5ff1-b4a3-498c-9c0b-24cad73cff54",
"Alias": "exampleAlias",
"createdAt": "2023-08-16T07:17:07.363Z",
"modifiedAt": "2023-08-16T07:17:07.364Z",
"properties": {
"key1": "value1",
"key2": "value2",
"key3": "value3"
}
}
],
"start": 0,
"count": 20,
"total": 1
}protobufAny
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| @type | string | 否 | - |
rpcStatus
| 属性名 | 类型 | 格式 | 必填 | 说明 |
|---|---|---|---|---|
| code | integer | int32 | 否 | - |
| message | string | 否 | - | |
| details | array<protobufAny> | 否 | - |