package com.jojubanking.boot.framework.excel;

import com.alibaba.excel.write.handler.AbstractRowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.Row;

// 自定义行高处理器
public class CustomRowHeightHandler extends AbstractRowWriteHandler {
    private short rowHeight;

    public CustomRowHeightHandler(short rowHeight) {
        this.rowHeight = rowHeight;
    }

    @Override
    public void afterRowCreate(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
        // 设置行高
        row.setHeight(rowHeight);
    }
}
