package com.fizz.business.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
@TableName("device_snapshot")
@Schema(description = "设备数据快照")
public class DeviceSnapshot {

    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "主键")
    private Long id;

    @Schema(description = "快照时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @Schema(description = "设备idx，对应DeviceEnum.idx")
    private Integer deviceId;

    @Schema(description = "设备枚举名，对应DeviceEnum.name()")
    private String deviceCode;

    @Schema(description = "设备描述")
    private String deviceName;

    @Schema(description = "段类型 ENTRY/PROCESS/EXIT")
    private String sectionType;

    @Schema(description = "来源类型 ENTRY/FURNACE/COAT/EXIT")
    private String sourceType;

    @Schema(description = "基准位置(m)")
    private Double basePosition;

    @Schema(description = "快照数据JSON")
    private String snapshotData;
}

