Spring Boot 流程引擎服务:流程定义/实例/任务、审批人解析、 回调分发、oapi 接口及单元测试。 保留远程 .gitea/workflows/build.yml 与 docker/Dockerfile, 新增 .gitignore 排除 target/ 构建产物。
This commit is contained in:
@@ -0,0 +1,82 @@
|
||||
package com.yunhai.flowcenter.entity;
|
||||
|
||||
import com.yunhai.flowcenter.enums.FlwEnums;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Index;
|
||||
import javax.persistence.Table;
|
||||
import javax.persistence.UniqueConstraint;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 回调推送日志 = 重试队列(概览 §4.9):eventId 唯一(重试不变,业务方按它幂等去重);
|
||||
* payload_json 完整快照可重放;索引 (status, next_retry_time) 是扫描主路径。
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "flw_callback_log",
|
||||
uniqueConstraints = @UniqueConstraint(name = "uk_flw_log_event", columnNames = "event_id"),
|
||||
indexes = {
|
||||
@Index(name = "idx_flw_log_scan", columnList = "status, next_retry_time"),
|
||||
@Index(name = "idx_flw_log_inst", columnList = "instance_id")})
|
||||
public class FlwCallbackLog extends BaseEntity {
|
||||
|
||||
/** 租户键 */
|
||||
@Column(name = "sch_id", nullable = false)
|
||||
private Long schId;
|
||||
|
||||
/** 归属注册 */
|
||||
@Column(name = "reg_id", nullable = false)
|
||||
private Long regId;
|
||||
|
||||
/** 事件唯一键(UUID 去横线 32 位),重试不变 */
|
||||
@Column(name = "event_id", nullable = false, length = 32)
|
||||
private String eventId;
|
||||
|
||||
/** 事件类型(flow.submitted/task.created/task.handled/completed/rejected/withdrawn) */
|
||||
@Column(name = "event", nullable = false, length = 32)
|
||||
private String event;
|
||||
|
||||
/** 办件 */
|
||||
@Column(name = "instance_id", nullable = false)
|
||||
private Long instanceId;
|
||||
|
||||
/** 业务键冗余(业务方消费主键) */
|
||||
@Column(name = "biz_type", length = 32)
|
||||
private String bizType;
|
||||
|
||||
@Column(name = "biz_id", length = 64)
|
||||
private String bizId;
|
||||
|
||||
/** 完整推送体快照(含签名原文,可重放) */
|
||||
@Column(name = "payload_json", nullable = false, columnDefinition = "LONGTEXT")
|
||||
private String payloadJson;
|
||||
|
||||
/** 0 待推/重试中 / 1 成功 / 2 死信 */
|
||||
@Column(name = "status", nullable = false)
|
||||
private Integer status = FlwEnums.CallbackLogStatus.PENDING.getCode();
|
||||
|
||||
/** 已重试次数 */
|
||||
@Column(name = "retry_count", nullable = false)
|
||||
private Integer retryCount = 0;
|
||||
|
||||
/** 下次推送时间 */
|
||||
@Column(name = "next_retry_time")
|
||||
private LocalDateTime nextRetryTime;
|
||||
|
||||
/** 末次 HTTP 状态(管理端排障用) */
|
||||
@Column(name = "last_http_status", length = 32)
|
||||
private String lastHttpStatus;
|
||||
|
||||
/** 末次错误 */
|
||||
@Column(name = "last_error", length = 1000)
|
||||
private String lastError;
|
||||
|
||||
/** 成功时间 */
|
||||
@Column(name = "push_time")
|
||||
private LocalDateTime pushTime;
|
||||
}
|
||||
Reference in New Issue
Block a user