package com.zhongshu.card.server.core.util.excel;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Author TRX
 * @CreateDate: 2023/12/22
 * @Version: 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class CommonExeclTd {

    @Schema(description = "表头")
    private String title;

    @Schema(description = "值的key，可能是多层：如：name, resourceObj.name")
    private String key;

    @Schema(description = "列宽度，如果小于等于0，则自动宽度")
    private int tdWidth = -1;

    public static CommonExeclTd build(String title, String key) {
        CommonExeclTd td = new CommonExeclTd();
        td.setTitle(title);
        td.setKey(key);
        return td;
    }

    public static CommonExeclTd build(String title, String key, int tdWidth) {
        CommonExeclTd td = new CommonExeclTd();
        td.setTitle(title);
        td.setKey(key);
        td.setTdWidth(tdWidth);
        return td;
    }
}
