package com.idle.wall.idlebean;

import androidx.annotation.Nullable;

import java.io.Serializable;

import io.objectbox.annotation.Entity;
import io.objectbox.annotation.Id;

@Entity
public class IdleData implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    private long id;

    private String categoryName;
    private String imId;
    private String description;
    private String fullUrl;
    private String previewUrl1080;
    private String previewUrl400;
    private String previewUrl200;
    private String authorName;
    private String authorHeader;
    private String authorHtml;
    private boolean isLike;
    private boolean isDownload;
    private long downloadTime;
    private long likeTime;
    private long viewTime; // 浏览时间戳（毫秒）

    public long getDownloadTime() {
        return downloadTime;
    }

    public void setDownloadTime(long downloadTime) {
        this.downloadTime = downloadTime;
    }
    public long getViewTime() {
        return viewTime;
    }

    public void setViewTime(long viewTime) {
        this.viewTime = viewTime;
    }

    // ========== 以下是你原有代码，完全保留 ==========
    public long getLikeTime() {
        return likeTime;
    }

    public void setLikeTime(long likeTime) {
        this.likeTime = likeTime;
    }

    public boolean isLike() {
        return isLike;
    }

    public void setLike(boolean like) {
        isLike = like;
    }

    public boolean isDownload() {
        return isDownload;
    }

    public void setDownload(boolean download) {
        isDownload = download;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getImId() {
        return imId;
    }

    public void setImId(String imId) {
        this.imId = imId;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getFullUrl() {
        return fullUrl;
    }

    public void setFullUrl(String fullUrl) {
        this.fullUrl = fullUrl;
    }

    public String getPreviewUrl1080() {
        return previewUrl1080;
    }

    public void setPreviewUrl1080(String previewUrl1080) {
        this.previewUrl1080 = previewUrl1080;
    }

    public String getPreviewUrl400() {
        return previewUrl400;
    }

    public void setPreviewUrl400(String previewUrl400) {
        this.previewUrl400 = previewUrl400;
    }

    public String getPreviewUrl200() {
        return previewUrl200;
    }

    public void setPreviewUrl200(String previewUrl200) {
        this.previewUrl200 = previewUrl200;
    }

    public String getAuthorName() {
        return authorName;
    }

    public void setAuthorName(String authorName) {
        this.authorName = authorName;
    }

    public String getAuthorHeader() {
        return authorHeader;
    }

    public void setAuthorHeader(String authorHeader) {
        this.authorHeader = authorHeader;
    }

    public String getAuthorHtml() {
        return authorHtml;
    }

    public void setAuthorHtml(String authorHtml) {
        this.authorHtml = authorHtml;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if (this == obj) return true;
        if (obj == null || getClass() != obj.getClass()) return false;
        IdleData pinkData = (IdleData) obj;
        return imId != null && imId.equals(pinkData.imId);
    }

    @Override
    public int hashCode() {
        return imId != null ? imId.hashCode() : 0;
    }
}