回调管理

This commit is contained in:
六如
2025-11-03 09:27:06 +08:00
parent 5001809fef
commit b9c58b328b
3 changed files with 105 additions and 0 deletions

View File

@@ -1,6 +1,7 @@
package com.gitee.sop.notify.api; package com.gitee.sop.notify.api;
import com.gitee.sop.notify.api.req.NotifyRequest; 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.api.resp.NotifyResponse;
/** /**
@@ -26,4 +27,11 @@ public interface NotifyService {
*/ */
NotifyResponse notifyImmediately(Long notifyId); NotifyResponse notifyImmediately(Long notifyId);
/**
* 根据通知id查看详情
*
* @param notifyId 通知id
* @return 返回详情没有返回null
*/
NotifyInfoResponse getByNotifyId(Long notifyId);
} }

View File

@@ -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;
}

View File

@@ -2,7 +2,9 @@ package com.gitee.sop.notify.dubbo;
import com.gitee.sop.notify.api.NotifyService; import com.gitee.sop.notify.api.NotifyService;
import com.gitee.sop.notify.api.req.NotifyRequest; 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.api.resp.NotifyResponse;
import com.gitee.sop.notify.dao.entity.NotifyInfo;
import com.gitee.sop.notify.service.NotifyBizService; import com.gitee.sop.notify.service.NotifyBizService;
import com.gitee.sop.notify.service.bo.NotifyBO; import com.gitee.sop.notify.service.bo.NotifyBO;
import com.gitee.sop.sdk.sign.SopSignException; import com.gitee.sop.sdk.sign.SopSignException;
@@ -45,4 +47,15 @@ public class NotifyServiceImpl implements NotifyService {
return NotifyResponse.error(e.getMessage()); 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;
}
} }