package com.haha.entity;

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 lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;

@Data
@TableName("t_device")
public class Device implements Serializable {
    private static final long serialVersionUID = 1L;

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

    private String deviceId;

    private Long shopId;

    private String name;

    private String authToken;

    private Integer status;

    private String currentInventoryHash;

    private LocalDateTime createTime;

    private LocalDateTime updateTime;

    // ========== 以下为非数据库字段，用于前端展示 ==========

    @TableField(exist = false)
    private String shopName;

    @TableField(exist = false)
    private String address;

    @TableField(exist = false)
    private String deviceTypeLabel;

    @TableField(exist = false)
    private String statusLabel;

    @TableField(exist = false)
    private String statusColor;

    @TableField(exist = false)
    private Boolean isOnline;

    @TableField(exist = false)
    private String temperature;

    @TableField(exist = false)
    private Integer volume;

    @TableField(exist = false)
    private Integer doorCount;

    @TableField(exist = false)
    private Integer layerCount;

    @TableField(exist = false)
    private Boolean hasScreen;

    @TableField(exist = false)
    private String totalSales;

    @TableField(exist = false)
    private String todaySales;

    @TableField(exist = false)
    private Integer orderCount;

    @TableField(exist = false)
    private LocalDateTime lastOnlineTime;
}
