From b9c58b328b6221ecb8f1d4258cedbe9735cb1f97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AD=E5=A6=82?= <8775@163.com> Date: Mon, 3 Nov 2025 09:27:06 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9B=9E=E8=B0=83=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gitee/sop/notify/api/NotifyService.java | 8 ++ .../notify/api/resp/NotifyInfoResponse.java | 84 +++++++++++++++++++ .../sop/notify/dubbo/NotifyServiceImpl.java | 13 +++ 3 files changed, 105 insertions(+) create mode 100644 sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/resp/NotifyInfoResponse.java diff --git a/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/NotifyService.java b/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/NotifyService.java index 13f8cbd3..6e0bec05 100644 --- a/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/NotifyService.java +++ b/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/NotifyService.java @@ -1,6 +1,7 @@ package com.gitee.sop.notify.api; import com.gitee.sop.notify.api.req.NotifyRequest; +import com.gitee.sop.notify.api.resp.NotifyInfoResponse; import com.gitee.sop.notify.api.resp.NotifyResponse; /** @@ -26,4 +27,11 @@ public interface NotifyService { */ NotifyResponse notifyImmediately(Long notifyId); + /** + * 根据通知id,查看详情 + * + * @param notifyId 通知id + * @return 返回详情,没有返回null + */ + NotifyInfoResponse getByNotifyId(Long notifyId); } diff --git a/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/resp/NotifyInfoResponse.java b/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/resp/NotifyInfoResponse.java new file mode 100644 index 00000000..692aa142 --- /dev/null +++ b/sop-notify/sop-notify-api/src/main/java/com/gitee/sop/notify/api/resp/NotifyInfoResponse.java @@ -0,0 +1,84 @@ +package com.gitee.sop.notify.api.resp; + +import lombok.Data; + +import java.io.Serializable; +import java.time.LocalDateTime; + +/** + * @author 六如 + */ +@Data +public class NotifyInfoResponse implements Serializable { + private static final long serialVersionUID = 7849566263888665512L; + + /** + * notifyId + */ + private Long id; + + /** + * app_id + */ + private String appId; + + /** + * api_name + */ + private String apiName; + + /** + * api_version + */ + private String apiVersion; + + /** + * 回调url + */ + private String notifyUrl; + + /** + * 最近一次发送时间 + */ + private LocalDateTime lastSendTime; + + /** + * 下一次发送时间 + */ + private LocalDateTime nextSendTime; + + /** + * 已发送次数 + */ + private Integer sendCnt; + + /** + * 发送内容 + */ + private String content; + + /** + * 状态,1-发送成功,2-发送失败,3-重试结束 + */ + private Integer notifyStatus; + + /** + * 失败原因 + */ + private String errorMsg; + + /** + * 返回结果 + */ + private String resultContent; + + /** + * 备注 + */ + private String remark; + + private LocalDateTime addTime; + + private LocalDateTime updateTime; + +} diff --git a/sop-notify/sop-notify-service/src/main/java/com/gitee/sop/notify/dubbo/NotifyServiceImpl.java b/sop-notify/sop-notify-service/src/main/java/com/gitee/sop/notify/dubbo/NotifyServiceImpl.java index 0a4821b6..7c78c626 100644 --- a/sop-notify/sop-notify-service/src/main/java/com/gitee/sop/notify/dubbo/NotifyServiceImpl.java +++ b/sop-notify/sop-notify-service/src/main/java/com/gitee/sop/notify/dubbo/NotifyServiceImpl.java @@ -2,7 +2,9 @@ package com.gitee.sop.notify.dubbo; import com.gitee.sop.notify.api.NotifyService; import com.gitee.sop.notify.api.req.NotifyRequest; +import com.gitee.sop.notify.api.resp.NotifyInfoResponse; import com.gitee.sop.notify.api.resp.NotifyResponse; +import com.gitee.sop.notify.dao.entity.NotifyInfo; import com.gitee.sop.notify.service.NotifyBizService; import com.gitee.sop.notify.service.bo.NotifyBO; import com.gitee.sop.sdk.sign.SopSignException; @@ -45,4 +47,15 @@ public class NotifyServiceImpl implements NotifyService { return NotifyResponse.error(e.getMessage()); } } + + @Override + public NotifyInfoResponse getByNotifyId(Long notifyId) { + NotifyInfo notifyInfo = notifyBizService.getById(notifyId); + if (notifyInfo == null) { + return null; + } + NotifyInfoResponse notifyInfoResponse = new NotifyInfoResponse(); + BeanUtils.copyProperties(notifyInfo, notifyInfoResponse); + return notifyInfoResponse; + } }