add notice: 添加 通告 資料 07-12 15:26
add notice: 添加 通告 資料
更新時間:2022-07-12 15:26:49
HTTP Request
POST: manager/notice/add
Body Parameters
Parameter | Type | Status | Description |
---|---|---|---|
data | object | required | |
name | int | required | notice_types.name |
notice_cat | int | required | notice_cats.id |
urgent | int | required | notices.urgent |
title_enHK | string | required | notices.title_enHK |
title_zhHK | string | required | notices.title_zhHK |
title_zhCN | string | required | notices.title_zhCN |
content_enHK | string | required | notices.content_enHK |
content_enHK | string | required | notices.content_enHK |
content_enHK | string | required | notices.content_enHK |
template_enHK | int | required | notices.template_enHK |
template_zhHK | int | required | notices.template_zhHK |
template_zhCN | int | required | notices.template_zhCN |
start_at | datetime | required | notices.start_at |
end_at | datetime | required | notices.end_at |
published_at | datetime | required | notices.published_at |
notice_type | int | required | notices.notice_type switch(notice_type) { case 1: { post['estate'] = estate_id; break; } case 2: { post['building'] = building_id; break; } case 3: { post['floor'] = floor_id; break; } case 4: { post['unit'] = unit_id; break; } } |
estate | int | required | notices.estate_id |
building | int | required | notices.building_id |
floor | int | required | notices.floor_id |
unit | int | required | notices.unit_id |
Response Structure
Parameter | Type | Status | Description |
---|---|---|---|
status | int | required | 0: 成功, 非0: 失敗 |
data | object | optional | |
id | int | optional | notices.id |
Example usage
Example #1
POST: manager/notice/add
Body
{
"data": {
"name": "aa",
"notice_cat": 1,
"urgent": 0,
"title_enHK": "notice_1",
"title_zhHK": "notice_1",
"title_zhCN": "notice_1",
"content_enHK": "notice_1",
"content_zhHK": "notice_1",
"content_zhCN": "notice_1",
"start_at": "2021-11-25 18:00:00",
"end_at": "2021-12-25 18:00:00",
"published_at": "2021-11-25 18:00:00",
"notice_type": 1,
"estate": 1
}
}
Response(200,status=0)
{
"status": 0,
"data": {
"id": 17
}
}