Skip to content

接口 公告和消息

Wrq edited this page Jul 30, 2014 · 3 revisions

公告和消息

消息:

暂时只有超级管理员才能给用户发消息,不支持用户之间发消息和向超级管理员回复消息。所有消息的from(发件人)暂时固定为“团团一家”

发送消息:[POST] http://www.etuan.org/user/message

messageInfo=
{
"to_org_uid":"org_uid",
"title":"消息标题",
"content":"消息内容......"
}

获取消息: [GET] http://www.etuan.org/user/messages

[{"title":"this is title","content":"this is content","created_at":"2014-07-30 19:24:56"},
{"title":"this is title","content":"this is content","created_at":"2014-07-30 19:24:56"}]
~~

标记某消息为已读(mark_read属性)[GET]
`http://www.etuan.org/user/set-read?message_id=123`
需要验证是否登录,并且只能将to_org_uid为自己的消息标记为已读


通知:

获取最新系统公告列表(类似微信后台登录后的首页):[GET] --- 完成
`http://www.etuan.org/notice`
~~~javascript
{
[
{"notice_id":1,"title":"my title1","created_at":"2014-07-30 20:24:45"},
{"notice_id":2,"title":"my title","created_at":"2014-07-30 20:27:31"},
{"notice_id":3,"title":"my title","created_at":"2014-07-30 20:28:29"}
]
}

创建公告:(需超级管理员权限)[POST] -- 完成 http://http://www.etuan.org/notice/create-notice

noticeInfo=
{"tittle":"团团一家抽奖功能上线了", "content":"一段html文本……"}

更新公告:(需超级管理员权限)[POST] -- 完成 http://http://www.etuan.org/notice/update-notice

noticeInfo=
{"noticeId":"1","tittle":"团团一家抽奖功能上线了", "content":"一段html文本……"}

获取某一条公告 [GET] --- 完成 http://http://www.etuan.org/notice/notice-content?noticeId=xxx 返回如下:

{"notice_id":1, "tittle":"团团一家抽奖功能上线了", "content":"一段html文本……"}