package org.springblade.system.pojo.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import io.swagger.v3.oas.annotations.media.Schema;

import java.util.Date;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.experimental.Accessors;
import org.springblade.core.tool.utils.DateUtil;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.io.Serial;

/**
 * 数据同步记录表 实体类
 *
 * @author BladeX
 * @since 2024-09-27
 */
@Accessors(chain = true)
@Data
@TableName("blade_data_sync_record")
@Schema(description = "DataSyncRecord对象")
public class DataSyncRecord implements Serializable {

	@Serial
	private static final long serialVersionUID = 1L;

	/**
	 * 主键
	 */
	@JsonSerialize(using = ToStringSerializer.class)
	@Schema(description = "主键")
	@TableId(value = "id", type = IdType.ASSIGN_ID)
	private Long id;

	/**
	 * 系统编码
	 */
	@Schema(description = "系统编码")
	private String systemCode;
	/**
	 * 数据类型
	 */
	@Schema(description = "数据类型")
	private String dataType;
	/**
	 * 模式
	 */
	@Schema(description = "模式")
	private String mode;
	/**
	 * 结果
	 */
	@Schema(description = "结果")
	private String result;
	/**
	 * 同步时间
	 */
	@Schema(description = "同步时间")
	private Date syncTime;
	/**
	 * 租户ID
	 */
	@Schema(description = "租户ID")
	@TableField(fill = FieldFill.INSERT)
	private String tenantId;
	/**
	 * 创建时间
	 */
	@DateTimeFormat(pattern = DateUtil.PATTERN_DATETIME)
	@JsonFormat(pattern = DateUtil.PATTERN_DATETIME)
	@Schema(description = "创建时间", hidden = true)
	@TableField(fill = FieldFill.INSERT)
	private Date createTime;
	/**
	 * 状态[0:未删除,1:删除]
	 */
	@TableLogic
	@Schema(description = "是否已删除", hidden = true)
	@TableField(fill = FieldFill.INSERT)
	private Integer isDeleted;
}
