package com.purui.prims.headless.api.pojo.request;

import com.purui.prims.common.pojo.DateConf;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import javax.validation.constraints.NotNull;
import java.util.Set;

@Data
@ApiModel(value = "维度值Req")
public class DimensionValueReq {

    @NotNull
    @ApiModelProperty(value = "维度ID")
    private Long elementID;

    @ApiModelProperty(value = "模型ID")
    private Long modelId;

    @ApiModelProperty(value = "业务名称")
    private String bizName;

    @NotNull
    @ApiModelProperty(value = "值")
    private String value;

    @ApiModelProperty(value = "数据集ID")
    private Set<Long> dataSetIds;

    @ApiModelProperty(value = "日期信息")
    private DateConf dateInfo = new DateConf();

    @ApiModelProperty(value = "维度业务名称")
    private String dimensionBizName;

    public String getBizName() {
        return StringUtils.isBlank(bizName) ? dimensionBizName : bizName;
    }
}
