膳逸用户端:关注用户模块(生成邀请码、关注用户、置顶或取消置顶用户、取消关注用户和查询已关注的用户),接口文档
文章目录
Base URLs:
Authentication
shanyi-api
POST 关注用户
POST /user/followUser
前端提交userId与要关注的用户的uuid以及邀请码,后端实现关注用户。
要注意1、自己不能关注自己,也不能关注不存在的人
2、还不能关注关注过的人
3、邀请码设计
Body 请求参数
{
"userId": 4,
"uuid": "c948897c4ace4268aa2a1922ea7bba18",
"invitedCode": "I9SeuY2ETZF3ZkXnQ6lU4W3kNkvhUF39YFAH516pLgs=////1706552641245"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | integer | 是 | 我的id |
| » uuid | body | string | 是 | 要关注的那个人的uuid |
| » invitedCode | body | string | 是 | 邀请码 |
返回示例
200 Response
{
"code": 0,
"msg": "string"
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none |
POST 查询已关注的用户
POST /user/searchFollowUser
根据userId查询follow_user_id,再找出user和user_info中的信息,按照置顶排序返回前端,pin为1为置顶,为0为不置顶
Body 请求参数
{
"userId": "5",
"nickName": "L",
"name": ""
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | string | 是 | none |
| » nickName | body | string | 否 | none |
| » name | body | string | 否 | none |
返回示例
成功
{
"msg": "success",
"result": [
{
"birthday": "2003-02-18",
"address": "山东省济南市",
"goal": "减肥",
"create_time": "2024-04-23",
"sex": "男",
"weight": "85.0",
"diseases": [
"无"
],
"dislikes": [
"香菜"
],
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/VhKViceJiciakCO44rkBk7P8zL5ps42N6h1Nh3A90EWnXiaicicfhwlqk7ouibWe4iaLV0EzNvGIX163WyGawtiaqy6QXuw/132",
"follow_user_id": 4,
"pin": 1,
"user_id": 5,
"phone": "15935883218",
"nick_name": "kami",
"name": "李**",
"id": 4,
"email": "1291966972@qq.com",
"status": 1,
"height": "1.83",
"bmi": "25.38",
"likes": [
"碳水"
]
},
{
"birthday": "1901-01-01",
"address": "山东济南",
"goal": "增肌",
"sex": "女",
"weight": "80.2",
"diseases": [
"糖尿病"
],
"dislikes": [],
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/5icHNmy3LXpUEY3JHKrm4P0twqobiaYuemvXr4s6aK2rJKQ7RkVOaPw4nRSkEfwErCIzkSUyvibFicJ37IA5Yppumg/132",
"follow_user_id": 3,
"pin": 0,
"user_id": 5,
"phone": "15553581028",
"nick_name": "LHPlanet",
"name": "李**",
"id": 3,
"email": "752869331@qq.com",
"status": 1,
"height": "1.94",
"bmi": "21.31",
"likes": [
"玉足"
]
}
],
"code": 200
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » result | [object] | true | none | none | |
| »» birthday | string | true | none | none | |
| »» address | string | true | none | none | |
| »» goal | string | true | none | none | |
| »» create_time | string | false | none | none | |
| »» sex | string | true | none | none | |
| »» weight | string | true | none | none | |
| »» diseases | [string] | true | none | none | |
| »» dislikes | [string] | true | none | none | |
| »» avatar | string | true | none | none | |
| »» follow_user_id | integer | true | none | none | |
| »» pin | integer | true | none | none | |
| »» user_id | integer | true | none | none | |
| »» phone | string | true | none | none | |
| »» nick_name | string | true | none | none | |
| »» name | string | true | none | none | |
| »» id | integer | true | none | none | |
| string | true | none | none | ||
| »» status | integer | true | none | none | |
| »» height | string | true | none | none | |
| »» bmi | string | true | none | none | |
| »» likes | [string] | true | none | none |
POST 取消关注
POST /user/unsubscribe
根据userId和followUserId取消关注
Body 请求参数
{
"userId": 5,
"followUserId": 4
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | integer | 是 | none |
| » followUserId | body | integer | 是 | none |
返回示例
成功
{
"msg": "success",
"code": 200
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none |
POST 生成邀请码
POST /user/generatingInvitedCode
根据userId(查找uuid)和当前时间生成5分钟有效的邀请码
Body 请求参数
{
"userId": "3"
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | string | 是 | none |
返回示例
成功
{
"msg": "success",
"result": "DjAUnHoBHUaFmenKFJrGmNv-OHFSKzvqOXCW4xHMb1I=----1716435888948",
"code": 200
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none | |
| » result | string | true | none | none |
POST 置顶关注的用户
POST /user/pinUser
置顶关注过的用户
Body 请求参数
{
"userId": 5,
"followUserId": 4
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | integer | 是 | none |
| » followUserId | body | integer | 是 | none |
返回示例
成功
{
"msg": "success",
"code": 200
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none |
POST 取消置顶关注的用户
POST /user/unPinUser
Body 请求参数
{
"userId": 5,
"followUserId": 4
}
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| Token | header | string | 否 | none |
| body | body | object | 否 | none |
| » userId | body | integer | 是 | none |
| » followUserId | body | integer | 是 | none |
返回示例
成功
{
"msg": "success",
"code": 200
}
返回结果
| 状态码 | 状态码含义 | 说明 | 数据模型 |
|---|---|---|---|
| 200 | OK | 成功 | Inline |
返回数据结构
状态码 200
| 名称 | 类型 | 必选 | 约束 | 中文名 | 说明 |
|---|---|---|---|---|---|
| » code | integer | true | none | none | |
| » msg | string | true | none | none |
2万+

被折叠的 条评论
为什么被折叠?



