package com.njcn.gather.report.pojo.vo;

import com.njcn.gather.report.pojo.enums.DocAnchorEnum;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * @author hongawen
 * @version 1.0
 * @data 2025/4/7 15:36
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class Bookmark implements Serializable,Comparable<Bookmark>{

    /**
     * 在文档中段落的索引
     */
    private Integer index;

    /**
     * 对应枚举
     */
    private DocAnchorEnum docAnchorEnum;


    /**
     * 根据书签的排序字段进行排序
     * @param bookmark the object to be compared.
     */
    @Override
    public int compareTo(Bookmark bookmark) {
        return Integer.compare(this.docAnchorEnum.getSort(), bookmark.docAnchorEnum.getSort());
    }
}
