Skip to content

Commit

Permalink
Auto commit: 2024-07-05 16:06:10
Browse files Browse the repository at this point in the history
  • Loading branch information
samlau7245 committed Jul 5, 2024
1 parent 31c292c commit e7e4610
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 11 deletions.
2 changes: 0 additions & 2 deletions docs/pm_coding/market.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,3 @@ import ImageGrid from '@site/src/components/ImageGrid';
## 优惠券

<ImageGrid images={['https://blogs7245-1256587996.cos.ap-guangzhou.myqcloud.com/img/mastergo/20240705005.png','https://blogs7245-1256587996.cos.ap-guangzhou.myqcloud.com/img/mastergo/20240705006.png']}/>


56 changes: 56 additions & 0 deletions docs/pm_coding/saas.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,60 @@
- 返回数据:操作结果
通过以上设计,可以确保总部管理员和门店管理员能够根据其角色和权限有效地管理全局或具体门店的数据,并且老师能够灵活地在不同门店之间进行切换和操作。
```


## 消息中心

```
为了满足这个需求,系统需要在后台为老师提供跨校区的消息推送功能,使得即使老师当前登录的校区是门店A,当在门店B有学员预约其课程时,依然能收到相应的通知。以下是详细的设计思路:
### 1. 数据库设计
#### 1.1 消息表设计
- `Notification` 表:
- `notification_id`(通知ID)
- `user_id`(用户ID,接收通知的用户)
- `store_id`(门店ID,事件发生的门店)
- `message`(消息内容)
- `read_status`(阅读状态,如未读、已读)
- `timestamp`(时间戳)
### 2. 业务逻辑设计
#### 2.1 消息生成逻辑
当学员在某个校区预约老师的课程时,生成一条通知消息,记录在消息表中。
示例业务流程:
1. 学员Sam在门店B预约了老师A的课程。
2. 系统生成一条通知消息,内容为“学员Sam在门店B预约了您的课程”。
3. 将此消息插入到`Notification`表中,关联老师A的用户ID和门店B的门店ID。
#### 2.2 消息推送逻辑
老师登录后台系统时,系统需要加载所有相关的未读消息,并在界面上显示。
示例业务流程:
1. 老师A登录后台系统,并选择门店A。
2. 系统查询`Notification`表,查找所有`user_id`为老师A且`read_status`为未读的通知。
3. 将这些通知推送到老师A的后台界面上进行展示。
### 3. 前端界面设计
#### 3.1 消息通知界面
在后台界面上添加消息通知组件,展示未读通知的列表。
#### 3.2 消息提醒
在后台界面上添加实时消息提醒功能,当有新消息时进行提醒。
### 4. API设计
#### 4.1 获取未读消息接口
- **GET /api/notifications**
- 请求参数:`user_id`
- 返回数据:该用户的未读消息列表
#### 4.2 标记消息为已读接口
- **POST /api/notifications/read**
- 请求参数:`notification_id`
- 返回数据:操作结果
```
9 changes: 0 additions & 9 deletions docs/pm_coding/system.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,3 @@ import ImageGrid from '@site/src/components/ImageGrid';
## 角色权限

<ImageGrid images={['https://blogs7245-1256587996.cos.ap-guangzhou.myqcloud.com/img/mastergo/20240705009.png']}/>


```mermaid
mindmap
Root
A
B
C
```

0 comments on commit e7e4610

Please sign in to comment.