package com.hw.tdengine.api.domain;

import com.hw.common.core.enums.DataTypeEnums;
import lombok.Data;

/**
 * @ClassName: TdField
 * @Author : xins
 * @Date :2023-08-28  9:47
 * @Description: TDengine filed，建表的字段实体类
 * @Version :1.0
 */
@Data
public class TdField {

    //字段名称
    private String fieldName;

    //字段值
    private Object fieldValue;

    //字段数据类型code
    private Integer dataTypeCode;

    //字段数据类型
    private String dataType;

    //字段字节大小
    private Integer size;

    public TdField() {
    }

    public TdField(String fieldName, Integer dataTypeCode, Integer size) {
        this.fieldName = fieldName;
        this.dataTypeCode = dataTypeCode;
        this.dataType = DataTypeEnums.dataCodeTypeMap.get(dataTypeCode);
        this.size = size;
    }
}
