package com.mortals.xhx.module.license.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.license.model.vo.LicenseVo;
import lombok.Data;
/**
 * 许可证实体对象
 *
 * @author zxfei
 * @date 2024-07-08
 */
@Data
public class LicenseEntity extends LicenseVo {
    private static final long serialVersionUID = 1L;

    /**
     * 私钥地址
     */
    private String licensePriPath;
    /**
     * 公钥
     */
    private String licensePubPath;
    /**
     * 许可证密钥或代码
     */
    private String licenseKeyPath;
    /**
     * 许可证编码，如服务器mac地址
     */
    private String licenseCode;
    /**
     * 许可证颁发日期
     */
    private Date startTime;
    /**
     * 许可证过期日期
     */
    private Date endTime;
    /**
     * 许可证状态（有效,过期,暂停）
     */
    private String licenseStatus;
    /**
     * 备注
     */
    private String remark;
    /**
     * 项目名称
     */
    private String name;
    /**
     * 服务器mac地址
     */
    private String mac;
    /**
     * ip地址
     */
    private String ip;
    @Override
    public int hashCode() {
        return this.getId().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        if (obj == null) return false;
        if (obj instanceof LicenseEntity) {
            LicenseEntity tmp = (LicenseEntity) obj;
            if (this.getId() == tmp.getId()) {
                return true;
            }
        }
        return false;
    }

    public void initAttrValue(){
        this.licensePriPath = "";
        this.licensePubPath = "";
        this.licenseKeyPath = "";
        this.licenseCode = "";
        this.startTime = null;
        this.endTime = null;
        this.licenseStatus = "有效";
        this.remark = "";
        this.name = "";
        this.mac = "";
        this.ip = "";
    }
}