docs 补充项目注释

This commit is contained in:
AprilWind
2026-06-01 10:48:09 +08:00
parent f3ed8e82a7
commit 941c0b9032
73 changed files with 531 additions and 1 deletions
@@ -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);