package cn.axzo.msg.center.domain.entity;

import cn.axzo.msg.center.domain.config.BaseListTypeHandler;
import cn.axzo.msg.center.service.bizevent.request.ReachDto;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 业务事件映射表
 *
 * @author syl
 * @date 2023/12/14
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@TableName(value = "biz_event_mapping", autoResultMap = true)
public class BizEventMapping {

    /**
     * 业务code
     */
    @TableField("biz_code")
    private String bizCode;

    /**
     * 业务事件名
     */
    @TableField("biz_name")
    private String bizName;

    /**
     * 触发配置
     */
    @TableField(value = "reach_config", typeHandler = ListReachParamTypeHandler.class)
    private List<ReachDto> reachConfig;

    /**
     * 创建者自然人id
     */
    private Long creatorId;

    /**
     * 更新者自然人id
     */
    private Long updaterId;

    /**
     * id
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 创建时间
     */
    private Date createAt;

    /**
     * 修改时间
     */
    private Date updateAt;

    /**
     * 是否删除 正常-0，删除-主键ID
     */
    private Long isDelete;


    public static class ListReachParamTypeHandler extends BaseListTypeHandler<ReachDto> {}

}
