mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-07-09 14:16:09 +00:00
docs 补充项目注释
This commit is contained in:
@@ -54,6 +54,15 @@ public class PushPayloadDTO implements Serializable {
|
||||
*/
|
||||
private Long timestamp;
|
||||
|
||||
/**
|
||||
* 构建推送消息体,缺省消息类型与来源时使用系统默认值。
|
||||
*
|
||||
* @param type 消息类型
|
||||
* @param source 消息来源
|
||||
* @param message 文本消息
|
||||
* @param data 扩展数据
|
||||
* @return 推送消息体
|
||||
*/
|
||||
public static PushPayloadDTO of(String type, String source, String message, Object data) {
|
||||
PushPayloadDTO payload = new PushPayloadDTO();
|
||||
payload.setType(StringUtils.defaultIfBlank(type, PushTypeEnum.MESSAGE.getType()));
|
||||
@@ -64,6 +73,15 @@ public class PushPayloadDTO implements Serializable {
|
||||
return payload;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过枚举值构建推送消息体。
|
||||
*
|
||||
* @param type 消息类型枚举
|
||||
* @param source 消息来源枚举
|
||||
* @param message 文本消息
|
||||
* @param data 扩展数据
|
||||
* @return 推送消息体
|
||||
*/
|
||||
public static PushPayloadDTO of(PushTypeEnum type, PushSourceEnum source, String message, Object data) {
|
||||
return of(
|
||||
type == null ? null : type.getType(),
|
||||
@@ -73,6 +91,16 @@ public class PushPayloadDTO implements Serializable {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 构建带前端跳转路径的推送消息体。
|
||||
*
|
||||
* @param type 消息类型枚举
|
||||
* @param source 消息来源枚举
|
||||
* @param message 文本消息
|
||||
* @param data 扩展数据
|
||||
* @param path 前端跳转路径
|
||||
* @return 推送消息体
|
||||
*/
|
||||
public static PushPayloadDTO of(PushTypeEnum type, PushSourceEnum source, String message, Object data, String path) {
|
||||
PushPayloadDTO payload = of(type, source, message, data);
|
||||
payload.setPath(path);
|
||||
|
||||
Reference in New Issue
Block a user