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

import com.purui.prims.common.pojo.Aggregator;
import com.purui.prims.common.pojo.DateConf;
import com.purui.prims.common.pojo.Filter;
import com.purui.prims.common.pojo.Order;
import com.purui.prims.common.pojo.enums.QueryType;
import com.purui.prims.headless.api.pojo.Cache;
import com.purui.prims.headless.api.pojo.Param;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

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

@Data
@ToString
@ApiModel(value = "查询数据集Req")
public class QueryDataSetReq {

    @ApiModelProperty(value = "数据集ID")
    private Long dataSetId;

    @ApiModelProperty(value = "数据集名称")
    private String dataSetName;

    @ApiModelProperty(value = "SQL")
    private String sql;

    @ApiModelProperty(value = "是否需要鉴权")
    private boolean needAuth = true;

    @ApiModelProperty(value = "参数列表")
    private List<Param> params = new ArrayList<>();

    @ApiModelProperty(value = "缓存")
    private Cache cacheInfo = new Cache();

    @ApiModelProperty(value = "分组字段")
    private List<String> groups = new ArrayList<>();

    @ApiModelProperty(value = "聚合字段")
    private List<Aggregator> aggregators = new ArrayList<>();

    @ApiModelProperty(value = "排序字段")
    private List<Order> orders = new ArrayList<>();

    @ApiModelProperty(value = "维度过滤条件")
    private List<Filter> dimensionFilters = new ArrayList<>();

    @ApiModelProperty(value = "指标过滤条件")
    private List<Filter> metricFilters = new ArrayList<>();

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

    @ApiModelProperty(value = "最大条数")
    private Long limit = 2000L;

    @ApiModelProperty(value = "查询类型")
    private QueryType queryType = QueryType.ID;
}
