消息通知
消息对象的数据结构
可能用作显示的字段:
字段名称 | 类型 | 描述 |
---|---|---|
id | integer | |
start_at | string | 开始显示时间 |
end_in | string | 停止显示时间 |
title | string | 通知的标题 |
description | string | 简短摘要(一行可以显示,255字以内) |
content | string | 通知全文(会有多行文本) |
created_at | string | 创建时间 |
示例:
{
"id": 1,
"school_id": 3,
"classroom_ids": [
113,
98
],
"status": 1,
"start_at": "2017-09-26 18:48:23",
"end_in": null,
"title": "hello,world",
"description": "first message description",
"content": "first message for example",
"created_at": "2017-09-26 18:48:23",
"updated_at": "2017-09-26 18:48:23"
}
通知 API
1、单个教室的通知
GET /api/v1/classrooms/:id/messages
Parameters
参数名 | 类型 | 描述 |
---|---|---|
id | number | 教室ID(即设备ID换取的教室ID) |
Response 200
消息列表,每个元素的结构见上面。没有分页,一个教室只会有少量几条消息。
消息列表显示的内容是
description
摘要字段,进入详情后,才需要展示content
内容。