package com.xunmei.system.api.domain;

import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.xunmei.common.core.web.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;

/**
 * @author :LuoWei
 * @date : 2023/8/29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_device")
@ApiModel(value = "SysDevice对象", description = "【请填写功能名称】")
public class SysDevice extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 设备id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;

    /**
     * 机构id
     */
    @ApiModelProperty(value = "机构id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long orgId;

    /**
     * 机构名字
     */
    @ApiModelProperty(value = "机构名字")
    private String orgName;

    /**
     * 设备名称
     */
    @ApiModelProperty(value = "设备名称")
    private String deviceName;

    /**
     * 资产类别
     */
    @ApiModelProperty(value = "资产类别")
    private String assetType;

    /**
     * 设备分类
     */
    @ApiModelProperty(value = "设备分类")
    private String deviceType;

    /**
     * 设备品牌
     */
    @ApiModelProperty(value = "设备品牌")
    private String deviceBrand;

    /**
     * 验收日期
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @ApiModelProperty(value = "验收日期")
    private Date checkTime;

    /**
     * 保修期限默认年
     */
    @ApiModelProperty(value = "保修期限默认年")
    private String maintenanceTerm;

    /**
     * 0存在2删除
     */
    private String delFlag;

    /**
     * 主机id
     */
    @ApiModelProperty(value = "主机id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long hostId;

    /**
     * 通道号
     */
    @ApiModelProperty(value = "通道号")
    private Long channel;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)


                .append("id", getId())


                .append("orgId", getOrgId())


                .append("orgName", getOrgName())


                .append("deviceName", getDeviceName())


                .append("assetType", getAssetType())


                .append("deviceType", getDeviceType())


                .append("deviceBrand", getDeviceBrand())


                .append("checkTime", getCheckTime())


                .append("maintenanceTerm", getMaintenanceTerm())


                .append("createTime", getCreateTime())


                .append("updateTime", getUpdateTime())


                .append("createBy", getCreateBy())


                .append("updateBy", getUpdateBy())


                .append("delFlag", getDelFlag())


                .append("hostId", getHostId())


                .append("channel", getChannel())
                .toString();
    }
}
