消息提醒服务
| Modifiers | Name | Description |
|---|---|---|
static Object |
aliasOverridingOrder |
| Type | Name and description |
|---|---|
grails.plugin.asyncmail.AsynchronousMailService |
asynchronousMailService |
AttachmentService |
attachmentService |
OsmEntitiyService |
osmEntitiyService |
SecRoleService |
secRoleService |
SmsService |
smsService |
| Type | Name and description |
|---|---|
String |
beforeList4MessagController(Map params) |
void |
bootStrapInit()服务初始化 |
List<Map> |
calReceiveUsers(Message msg)根据 receivers 计算所有接收用户 |
void |
cancelThumbDown(Long msgId)TODO 撤销拍砖 |
void |
cancelThumbUp(Long msgId)TODO 撤销点赞 |
Message |
createMessage(String code, Map props, List receivers = null, Map options = null)创建(发送)一条消息 |
Message |
createMessage(Map props, List receivers = null, Map options = null) |
Message |
createMessage(MessageConfig config, Map props, List receivers = null, Map options = null) |
Integer |
deleteMessage(Message msg)删除消息,以及回复与重发消息 |
Integer |
deleteMessage(String uuid)删除消息,含整个话题下的所有消息 |
MessageConfig |
getConfig(String code)根据配置编码取配置对象:先取本应用的配置,没有再取全局的配置 |
MessageConfig |
getConfig(String code, DomainApplication application)根据配置编码、应用取配置对象 |
MessageConfig |
getConfig(String code, Long applicationId)根据配置编码、应用ID取配置对象 |
Map |
listMessages(Map params, Map options)列出当前用户的消息 |
Map |
listMessages(Long userId, Map params, Map options)列出用户的消息 |
Message |
processMessage(User user, String method, Message msg, Map params = null)消息办理 |
Message |
replyMessage(Message parent, Map props, String receivers)回复消息 |
Message |
resendMessage(Message resendMessage)消息重发(比如超时未办理) |
Message |
sendMessage(String code, Map props, List receivers, Map options = null)发送一条消息,同 createMessage |
Message |
sendMessage(MessageConfig config, Map props, List receivers, Map options = null) |
void |
thumbDown(User user, Long msgId, Map props = null)TODO 拍砖 |
void |
thumbUp(User user, Long msgId, Map props = null)TODO 点赞 |
Message |
updateMessage(Message msg, Map props, String receivers = null)更新消息 |
| Methods inherited from class | Name |
|---|---|
class Object |
Object#wait(long, int), Object#wait(long), Object#wait(), Object#equals(Object), Object#toString(), Object#hashCode(), Object#getClass(), Object#notify(), Object#notifyAll() |
服务初始化
根据 receivers 计算所有接收用户
TODO 撤销拍砖
TODO 撤销点赞
创建(发送)一条消息
code - 消息配置编码;空则取默认配置,此时建议按需配置 props.notifications、props.processingPolicies 等内容参数。props - 消息内容,必须项包括 subject、content,可选项包括其他 Message 属性,以及 user、attachments 等。props.user - 发送人用户对象,或者分别设置 props.userId、props.userNameprops.attachments - 消息附件,格式为 [files: [文件对象或文件名列表], file: 文件对象或路径, delete: 是否删除源文件],files和file任选其一。props.status - 消息状态,只能为 Message.Status.CREATED(默认) 或 DRAFTED;如果为 DRAFTED,则保存成草稿,需要调用 updateMessage 将其设为 CREATED 才能将消息发送出去。receivers - 员工(会自动转成用户)、用户、机构、岗位、群组、用户ID等对象列表;如果为 null 则取配置中的默认接收人。options.uuid - 生成uuid的规则:删除消息,以及回复与重发消息
删除消息,含整个话题下的所有消息
根据配置编码取配置对象:先取本应用的配置,没有再取全局的配置
根据配置编码、应用取配置对象
根据配置编码、应用ID取配置对象
列出当前用户的消息
params - 包含排序或查询参数的 Map 对象,如 sort、search.where、search.precondition 等options.finished - 是否是已结束的消息,默认为 null 即不区分options.content - 如果返回 Map 列表,是否包含消息内容 content,默认为否options.bean - 是否返回消息对象列表,默认为否,即返回消息 Map 列表列出用户的消息
消息办理
user - 办理消息的用户对象method - 办理方式:Message.PROCESS_METHOD_DO、Message.PROCESS_METHOD_READmsg - 消息对象params.notes - 办理情况补充说明params.processDate - 办理时间回复消息
参数 props、receivers 同 createMessage。
receivers - 更新后的消息接收人。如果为 null,则保持原来的接收人不变。消息重发(比如超时未办理)
发送一条消息,同 createMessage
TODO 拍砖
TODO 点赞
user - 点赞用户msgId - 消息 IDprops.rating - 评分props.notes - 评分或点赞说明更新消息