feat: add job seeker notice settings API
This commit is contained in:
64
docs/mobile-notice-settings-api.md
Normal file
64
docs/mobile-notice-settings-api.md
Normal file
@@ -0,0 +1,64 @@
|
||||
# 移动端消息接收设置接口
|
||||
|
||||
## 通用约定
|
||||
|
||||
- 基础地址:沿用移动端当前后端地址。
|
||||
- 请求头:`Authorization: Bearer <移动端求职者登录 Token>`。
|
||||
- 仅移动端**求职者**可调用;未携带或失效 Token 返回 HTTP 401,企业及其他角色返回业务码 `403`。
|
||||
- 四个字段均为布尔值,`true` 表示接收该类消息,`false` 表示不接收。保存时必须一次传齐四项。
|
||||
|
||||
## 查看设置
|
||||
|
||||
`GET /app/notice/settings`
|
||||
|
||||
无需请求参数或请求体。首次查看(尚未保存过)会返回四项均开启的默认设置,且不会创建数据库记录。
|
||||
|
||||
成功响应示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功",
|
||||
"data": {
|
||||
"jobUpdateEnabled": true,
|
||||
"appointmentReminderEnabled": true,
|
||||
"systemNotificationEnabled": true,
|
||||
"interviewNotificationEnabled": true
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
字段说明:
|
||||
|
||||
| 字段 | 对应按钮 |
|
||||
| --- | --- |
|
||||
| `jobUpdateEnabled` | 职位上新 |
|
||||
| `appointmentReminderEnabled` | 预约提醒 |
|
||||
| `systemNotificationEnabled` | 系统通知 |
|
||||
| `interviewNotificationEnabled` | 面试通知 |
|
||||
|
||||
## 保存设置
|
||||
|
||||
`PUT /app/notice/settings`
|
||||
|
||||
请求头 `Content-Type: application/json`,请求体示例:
|
||||
|
||||
```json
|
||||
{
|
||||
"jobUpdateEnabled": true,
|
||||
"appointmentReminderEnabled": false,
|
||||
"systemNotificationEnabled": true,
|
||||
"interviewNotificationEnabled": false
|
||||
}
|
||||
```
|
||||
|
||||
成功响应:
|
||||
|
||||
```json
|
||||
{
|
||||
"code": 200,
|
||||
"msg": "操作成功"
|
||||
}
|
||||
```
|
||||
|
||||
接口按登录 Token 自动识别当前用户,不接收也不允许客户端传入用户 ID。任一开关字段缺失或为 `null` 时,返回参数校验错误。
|
||||
Reference in New Issue
Block a user