消息服务接口

版本记录

版本号日期修改内容
v0.12.22024-08-30修复已知问题

消息服务

创建主题

接口功能

消息服务通过主题创建接口来创建订阅的主题,并设置主题的相关参数。

接口地址

URL{Server}/topic/create
http 请求方式post

请求参数说明

名称类型是否必填描述
appIdstring是应用 ID
topicstring是主题名
namestring否中文名,页面显示
notestring否备注信息
broadcastTypeint否0: 广播,1:单播,默认 0
consumeTypebool否false: NACK,true:ACK,默认 false
retentionDaysint否保存天数 ,默认 0 不保存
retentionNumsint否消息保存条数,默认 1w 条
typeint否0: 公开 所有人都可以发,1:私有 只能自己发, 默认 1
consumerstring否消费该主题的应用集合,多个应用间用“,”隔开
pointPushstring否点对点模式,配置需要推送的应用 ID
retryint否重试次数,默认 3 次
timeoutSetint否超时设置默认 3600s
pubIntervalint否重试间隔设置 默认 10s
unpubbool否false: 发布,true:取消发布,默认 false

返回值参数说明

参数名称类型是否必填说明
codestring是返回码,0 成功,其他失败
messagestring是返回信息描述
dataobject否创建成功,返回的结果

示例介绍

{
    "code": 0,
    "message": "success",
"data": {
		"topic": "message topic"
},
}

修改主题

接口功能

修改主题相关参数。

接口地址

URL{Server}/topic/update
http 请求方式post

请求参数说明

名称类型是否必填描述
topicstring是主题名
namestring否中文名,页面显示
notestring否备注信息
unpubbool否未发布主题,默认 false

返回值参数说明

参数名称类型是否必填说明
codestring是返回码,0 成功,其他失败
messagestring是返回信息描述
databool否成功为 true,失败为 false

示例介绍

{
    "code": 0,
    "message": "success",
"data": true,
}

删除主题

接口功能

删除主题记录。

接口地址

URL{Server}/topic/delete
http 请求方式post

请求参数说明

名称类型是否必填描述
topicstring是要删除的主题名

返回值参数说明

参数名称类型是否必填说明
codestring是返回码,0 成功,其他失败
messagestring是返回信息描述
databool否成功为 true,失败为 false

示例介绍

{
    "code": 0,
    "message": "success",
"data": true,
}

生产消息

接口功能

将消息投递到具体的主题上。

接口地址

URL{Server}/message/pub
http 请求方式post

返回值参数说明

参数名称类型是否必填说明
codeint是返回码,200 成功,其他失败
messagestring是返回消息
databool否成功为 true,失败为 false

示例介绍

{
    "code": 0,
    "message": "success",
	"data": true,
}

消费消息

接口功能

消息中间件向应用端服务提供的 Websocket 推送接口。

接口地址

URLws://{Server}/message/sub
http 请求方式websocket

查询站内信—meStationMsgs

接口功能

查询站内信。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereMsgWhereInput否查询条件
orderBy[MsgOrderByWithRelationInput]否排序条件
cursorMsgWhereUniqueInput否游标
skipInt否跳过记录数
takeInt否获取记录数
distinct[MsgScalarFieldEnum]否过滤条件

返回值参数说明

参数名称类型说明
idstring主键
appIdString应用 Id
appNameString应用名称
moduleIdString模块 Id
moduleNameString模块名称
titleString标题
contentString内容
typeInt消息类型,0:通知消息,1:待办消息,默认是 0
todoNoticeBoolean是否发送通知,type=1 时字段有效,默认 false,不发送
todoStatusString待办当前处理人,type=1 时字段有效
todoCurrentString待办当前处理人,type=1 时字段有效
todoTypeString待办类型,type=1 时字段有效
accessAddressString访问地址
senderString发送人
senderNameString发送人名称
senderAvatarString发送人头像
receiverString接收人
isTopBoolean是否置顶
statusInt状态,0:未读/未处理,1:已读/已处理
senderTimeDateTime发送时间
createByString创建人
createdAtDateTime创建时间
updateByString创建人
updatedAtDateTime修改时间

示例介绍

{
  meStationMsgs{
    id
    appId
    appName
    moduleId
    moduleName
    title
    content
    type
    todoNotice
    todoStatus
    todoCurrent
    todoType
    accessAddress
    sender
    senderName
    senderAvatar
    receiver
    isTop
    status
    senderTime
    createBy
    createdAt
    updateBy
    updatedAt
  }
}

查询任务—meTodoMsgs

接口功能

查询任务。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereMsgWhereInput否查询条件
orderBy[MsgOrderByWithRelationInput]否排序条件
cursorMsgWhereUniqueInput否游标
skipInt否跳过记录数
takeInt否获取记录数
distinct[MsgScalarFieldEnum]否过滤条件

返回值参数说明

参数名称类型说明
idstring主键
appIdString应用 Id
appNameString应用名称
moduleIdString模块 Id
moduleNameString模块名称
titleString标题
contentString内容
typeInt消息类型,0:通知消息,1:待办消息,默认是 0
todoNoticeBoolean是否发送通知,type=1 时字段有效,默认 false,不发送
todoStatusString待办当前处理人,type=1 时字段有效
todoCurrentString待办当前处理人,type=1 时字段有效
todoTypeString待办类型,type=1 时字段有效
accessAddressString访问地址
senderString发送人
senderNameString发送人名称
senderAvatarString发送人头像
receiverString接收人
isTopBoolean是否置顶
statusInt状态,0:未读/未处理,1:已读/已处理
senderTimeDateTime发送时间
createByString创建人
createdAtDateTime创建时间
updateByString创建人
updatedAtDateTime修改时间

示例介绍

{
  meTodoMsgs {
    id
    appId
    appName
    moduleId
    moduleName
    title
    content
    type
    todoNotice
    todoStatus
    todoCurrent
    todoType
    accessAddress
    sender
    senderName
    senderAvatar
    receiver
    isTop
    status
    senderTime
    createBy
    createdAt
    updateBy
    updatedAt
  }
}

删除任务—deleteOneTodo

接口功能

删除任务。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereMsgWhereUniqueInput!是查询条件

返回值参数说明

参数名称类型说明
idstring主键
appIdString应用 Id
appNameString应用名称
moduleIdString模块 Id
moduleNameString模块名称
titleString标题
contentString内容
typeInt消息类型,0:通知消息,1:待办消息,默认是 0
todoNoticeBoolean是否发送通知,type=1 时字段有效,默认 false,不发送
todoStatusString待办当前处理人,type=1 时字段有效
todoCurrentString待办当前处理人,type=1 时字段有效
todoTypeString待办类型,type=1 时字段有效
accessAddressString访问地址
senderString发送人
senderNameString发送人名称
senderAvatarString发送人头像
receiverString接收人
isTopBoolean是否置顶
statusInt状态,0:未读/未处理,1:已读/已处理
senderTimeDateTime发送时间
createByString创建人
createdAtDateTime创建时间
updateByString创建人
updatedAtDateTime修改时间

示例介绍

mutation {
  deleteOneTodo(where: {}) {
    id
    appId
    moduleId
    title
    content
    type
    todoNotice
    todoStatus
    todoCurrent
    todoType
    accessAddress
    sender
    receiver
    isTop
    status
    senderTime
    createBy
    createdAt
    updateBy
    updatedAt
  }
}

标记已读—markRead

接口功能

标记已读。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereIdWhereListInput!是

返回值参数说明

参数名称类型说明
databoolean是否成功

示例介绍

mutation {
  markRead(where: { ids: ["string"] }) {
    data
  }
}

发送消息—pubMsg

接口功能

发送消息。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
wherePubMsgInput!!是

返回值参数说明

参数名称类型说明
databoolean是否成功

示例介绍

mutation {
  pubMsg(data: { appId: "string", title: "string", content: "string" }) {
    data
  }
}

任务置顶—setTodoTop

接口功能

任务置顶。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereIdWhereListInput!是

返回值参数说明

参数名称类型说明
databoolean是否成功

示例介绍

mutation {
  setTodoTop(where: { ids: ["string"] }) {
    data
  }
}

更新任务—updateOneTodo

接口功能

更新任务。

接口地址

URL/api/graphql
http 请求方式post

请求参数说明

名称类型是否必填描述
whereMsgWhereUniqueInput!是查询条件
dataMsgUpdateInput!!是查询条件

返回值参数说明

参数名称类型说明
idstring主键
appIdString应用 Id
appNameString应用名称
moduleIdString模块 Id
moduleNameString模块名称
titleString标题
contentString内容
typeInt消息类型,0:通知消息,1:待办消息,默认是 0
todoNoticeBoolean是否发送通知,type=1 时字段有效,默认 false,不发送
todoStatusString待办当前处理人,type=1 时字段有效
todoCurrentString待办当前处理人,type=1 时字段有效
todoTypeString待办类型,type=1 时字段有效
accessAddressString访问地址
senderString发送人
senderNameString发送人名称
senderAvatarString发送人头像
receiverString接收人
isTopBoolean是否置顶
statusInt状态,0:未读/未处理,1:已读/已处理
senderTimeDateTime发送时间
createByString创建人
createdAtDateTime创建时间
updateByString创建人
updatedAtDateTime修改时间

示例介绍

mutation {
  updateOneTodo(data: {}, where: {}) {
    id
    appId
    moduleId
    title
    content
    type
    todoNotice
    todoStatus
    todoCurrent
    todoType
    accessAddress
    sender
    receiver
    isTop
    status
    senderTime
    createBy
    createdAt
    updateBy
    updatedAt
  }
}