package com.ruoyi.llm.domain;

import java.util.ArrayList;
import java.util.List;

/**
 * 文档块类型，用于解析 markdown 内容并转换为 Word 格式
 */
public class Block {
    private String type; // para | table | heading | list1 | list2 | imageText | boldOnly | numberedBold
    private String text;
    private List<String> table;
    private Integer headingLevel; // 标题级别（4、5、6 对应 h4、h5、h6）
    private String boldText; // 加粗文本部分
    private String suffixText; // 后缀文本（如冒号及后续内容）
    private String numberPrefix; // 数字前缀，如 "1. "

    public Block(String t, String x) {
        type = t;
        text = x;
    }

    public Block(List<String> tbl) {
        type = "table";
        table = new ArrayList<>(tbl);
    }

    public Block(String t, String x, Integer level) {
        type = t;
        text = x;
        headingLevel = level;
    }

    public Block(String t, String bold, String suffix) {
        type = t;
        boldText = bold;
        suffixText = suffix;
    }

    public Block(String t, String numPrefix, String bold, String suffix) {
        type = t;
        numberPrefix = numPrefix;
        boldText = bold;
        suffixText = suffix;
    }
    
    // Getters and Setters
    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getText() {
        return text;
    }

    public void setText(String text) {
        this.text = text;
    }
    
    public List<String> getTable() {
        return table;
    }

    public void setTable(List<String> table) {
        this.table = table;
    }
    
    public Integer getHeadingLevel() {
        return headingLevel;
    }

    public void setHeadingLevel(Integer headingLevel) {
        this.headingLevel = headingLevel;
    }

    public String getBoldText() {
        return boldText;
    }

    public void setBoldText(String boldText) {
        this.boldText = boldText;
    }

    public String getSuffixText() {
        return suffixText;
    }

    public void setSuffixText(String suffixText) {
        this.suffixText = suffixText;
    }

    public String getNumberPrefix() {
        return numberPrefix;
    }

    public void setNumberPrefix(String numberPrefix) {
        this.numberPrefix = numberPrefix;
    }
}
