class NotifyHistoryEntity extends GenericEntity<String> {

    private static final long serialVersionUID = -6849794470754667710L;


    @Column(length = 32, nullable = false, updatable = false)
    @Schema(description = "通知ID")
    private String notifierId;

    @Column(nullable = false)
    @DefaultValue("success")
    @EnumCodec
    @ColumnType(javaType = String.class)
    @Schema(description = "状态")
    private NotifyState state;

    @Column(length = 1024)
    @Schema(description = "错误类型")
    private String errorType;

    @Column
    @ColumnType(jdbcType = JDBCType.CLOB, javaType = String.class)
    @Schema(description = "异常栈")
    private String errorStack;

    @Column(length = 32, nullable = false)
    @DefaultValue("-")
    @Schema(description = "模版ID")
    private String templateId;

    @Column
    @ColumnType(jdbcType = JDBCType.CLOB, javaType = String.class)
    @Schema(description = "模版内容")
    private String template;

    @Column
    @ColumnType(jdbcType = JDBCType.CLOB, javaType = String.class)
    @JsonCodec
    @Schema(description = "上下文")
    private Map<String, Object> context;

    @Column(length = 32, nullable = false)
    @Schema(description = "服务商")
    private String provider;

    @Column(length = 32, nullable = false)
    @Schema(description = "通知类型")
    private String notifyType;

    @Column
    @DefaultValue(generator = Generators.CURRENT_TIME)
    @Schema(description = "通知时间")
    private Date notifyTime;

    @Column
    @DefaultValue("0")
    @Schema(description = "重试次数")
    private Integer retryTimes;

    public static NotifyHistoryEntity of(SerializableNotifierEvent event) {<FILL_FUNCTION_BODY>}

    public NotifyHistory toHistory(){
        return FastBeanCopier.copy(this,new NotifyHistory());
    }
}

       NotifyHistoryEntity entity = FastBeanCopier.copy(event, new NotifyHistoryEntity());
        if (null != event.getTemplate()) {
            entity.setTemplate(JSON.toJSONString(event.getTemplate()));
        }
        if (event.isSuccess()) {
            entity.setState(NotifyState.success);
        } else {
            entity.setErrorStack(event.getCause());
            entity.setState(NotifyState.error);
        }
        return entity;
    
<no_super_class>