Table of Contents
5.11 获取当前用户【未授权拦截通过,待登录态联调】
GET /tieup/api/v1/me
鉴权:需要 Authorization: Bearer <access_token>。
响应字段:
| 字段 | 类型 | 说明 |
|---|---|---|
id |
integer | 用户 ID |
rong_user_id |
string | 当前使用端对应的融云用户 ID:粉丝端为 tieup_fan_{user_id},偶像端为 tieup_artist_{artist_id} |
group_code |
string | 应用分组编码 |
channel_code |
string | 渠道编码 |
phone |
string | 手机号 |
nickname |
string | 用户昵称 |
avatar |
string/null | 头像 URL |
profile_completion_step |
integer | 当前资料完善步骤:0=未上传头像,1=已上传头像但核心资料未完善,2=核心资料已完善 |
gender |
integer | 性别:0=未知,1=男,2=女 |
age |
integer/null | 年龄 |
province_code / province_name |
string/null | 省份编码和名称 |
city_code / city_name |
string/null | 城市编码和名称 |
district_code / district_name |
string/null | 区县编码和名称 |
signature |
string/null | 个性签名 |
status |
integer | 账号状态:1=正常,2=禁用,3=最终注销,4=注销中 |
is_idol |
integer | 是否开通艺人身份:1=是,2=否 |
is_scout |
integer | 是否绑定星探:1=是,2=否;只要存在 tieup_scout.user_id 绑定记录即返回 1,不受星探状态影响 |
candy_balance |
string | 糖果余额 |
online_status |
integer | 在线状态:0=离线,1=在线 |
current_identity |
string | 当前使用端:fan=粉丝端,artist=艺人端 |
available_identities |
array | 当前账号可切换的使用端列表 |
question_count |
integer | 当前身份为 fan 时返回;我的主提问数量,不含追问,统计 tieup_question.parent_question_id IS NULL |
follow_up_question_count |
integer | 当前身份为 fan 时返回;我的追问数量,不含主提问,统计 tieup_question.parent_question_id IS NOT NULL |
pending_video_call_count |
integer | 当前身份为 fan 时返回;待通话数量,统计 tieup_video_call_booking.status IN (1,2,3),即待通话、等待进入和通话中总数 |
active_subscription_artist_count |
integer | 当前身份为 fan 时返回;我当前订阅中的偶像数量,统计 tieup_subscription.status = 1 AND expires_at > 当前时间 的去重 artist_id |
响应示例:
{
"code": 200,
"message": "成功",
"data": {
"id": 10001,
"rong_user_id": "tieup_fan_10001",
"group_code": "tieup",
"channel_code": "appstore",
"phone": "13800138000",
"nickname": "Tieup用户",
"avatar": "https://cdn.example.com/avatar.png",
"profile_completion_step": 2,
"gender": 2,
"age": 24,
"province_code": null,
"province_name": null,
"city_code": null,
"city_name": null,
"district_code": null,
"district_name": null,
"signature": "保持热爱",
"status": 1,
"is_idol": 2,
"is_scout": 2,
"candy_balance": "1000.00",
"online_status": 1,
"current_identity": "fan",
"available_identities": [
"fan"
],
"question_count": 3,
"follow_up_question_count": 2,
"pending_video_call_count": 1,
"active_subscription_artist_count": 4
}
}
业务规则:
-
question_count、follow_up_question_count、pending_video_call_count、active_subscription_artist_count只在当前 Token 的current_identity = fan时返回;当前身份为artist时省略。 -
is_scout无论当前 Token 的current_identity为fan还是artist均返回;只按当前用户是否存在星探绑定档案判断。 - 提问和追问均按当前账号作为粉丝的
fan_user_id统计;切换到偶像端不会统计该偶像收到的问题。 - 待通话数量与视频预约待通话页签保持一致,包含
1=待通话、2=等待进入、3=通话中,不包含已完成、爽约或取消记录。 - 当前订阅中的偶像数量按有效订阅去重偶像统计;过期、取消订阅不计入,同一偶像多条有效续期订阅只计 1 个偶像。
-
profile_completion_step由服务端根据当前资料实时计算:头像为空返回0;头像非空但昵称仍为注册默认昵称用户{手机号后四位}、性别不是1/2或年龄为空时返回1;上述核心资料全部满足时返回2。地区和个性签名不影响步骤。 - 该字段不保存数据库,也不表示历史完成状态;用户清空头像后回退为
0,清空其他核心资料后回退为1。
测试状态:已完成代码实现和 PHP 语法检查,待登录态联调。