Skip to content

sysMessage_admin

echisan edited this page Aug 27, 2018 · 4 revisions

发送系统消息

  • 请求URL

/admin/messages

  • 请求方式

POST

  • 请求参数
请求参数 参数类型 require 参数说明
type int true 发布的消息目标类型,目前有(0:用户(user) 1:管理员(manager) 2:系统管理员(admin)) eg:type=1
title String true 标题
content String true 正文
  • 请求示例

/admin/messages

{
	"type":2,
	"title":"from postman system message",
	"content":"from postman content"
}
  • 返回结果
{
    "code": 0,
    "msg": "OK",
    "data": {
        "id": 23,
        "title": "from postman system message",
        "content": "from postman content",
        "createTime": 1535299090031,
        "status": "NORMAL",
        "publisherUid": 6,
        "sysMsgTargetType": "ADMIN"
    }
}

删除发送的系统消息

作用是在手滑发送了消息之后,可以以迅雷不及掩耳之势删掉那条消息,然后用户就收不到了

  • 请求URL

/admin/messages/{id}

  • 请求方式

DELETE

  • 请求参数
请求参数 参数类型 require 参数说明
id long true 已发送的系统消息id
  • 请求示例

/admin/messages/22

  • 返回结果
{
    "code": 0,
    "msg": "OK",
    "data": {
        "id": 22,
        "title": "test",
        "content": "测试一下全站用户",
        "createTime": 1535296266000,
        "status": "DELETE",
        "publisherUid": 1,
        "sysMsgTargetType": null
    }
}

发送指定用户id的系统消息

  • 请求URL

/admin/messages/users

  • 请求方式

POST

  • 请求参数
请求参数 参数类型 require 参数说明
ids 数组 true 发布的消息目标用户id的数组/列表
title String true 标题
content String true 正文
  • 请求示例

/admin/messages/users

{
	"ids":[2,5,13,6],
	"title":"from postman system message and target userids",
	"content":"from postman content to target userids"
}
  • 返回结果
{
    "code": 0,
    "msg": "ok",
    "data": ""// 插入的messageId列表
}

删除指定消息id的系统消息

  • 请求URL

/admin/messages/users/messages

  • 请求方式

DELETE

  • 请求参数
请求参数 参数类型 require 参数说明
ids 数组 true 目标消息的id列表(message_v2的表)
{
	"mids":[2,5,13,6],
}

获取系统消息列表

  • 请求URL

/admin/messages

  • 请求方式

GET

  • 请求参数
请求参数 参数类型 require 参数说明
pn int false page number(defatult=1)
ps int false page size (default=50)
  • 请求示例

/admin/messages?ps=1

{
    "code": 0,
    "msg": "OK",
    "data": {
        "messages": [
            {
                "id": 23,
                "title": "from postman system message",
                "content": "from postman content",
                "createTime": 1535299090000,
                "status": "NORMAL",
                "publisherUid": 6,
                "sysMsgTargetType": "ADMIN"
            }
        ],
        "page": {
            "totalSize": 23,
            "pageSize": 1,
            "pageNumber": 1,
            "allTotalSize": 0
        }
    }
}
Clone this wiki locally