package com.cf.imes.module.report.controller.admin.datasource.vo;

import com.cf.imes.module.report.controller.admin.dataset.vo.ReportDatasetRespVO;
import com.cf.imes.module.report.enums.datasource.ReportDatasourceTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;
import java.util.Map;

/**
 * @author Gqr
 * @since 2024/7/5 16:34
 */
@Schema(description = "管理后台 - 报表数据源 Response VO")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class ReportDatasourceRespVO {

    @Schema(description = "数据源id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long id;

    @Schema(description = "模板id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
    private Long reportId;

    @Schema(description = "数据源名称", example = "测试库")
    private String name;

    @Schema(description = "数据源类型，jdbc、spring、api", example = "0")
    private ReportDatasourceTypeEnum type;

    @Schema(description = "内置类型：0是、1否")
    private Integer buildinType;

    @Schema(description = "spring型数据源id")
    private String beanId;

    @Schema(description = "数据源驱动类",example = "com.mysql.cj.jdbc.Driver")
    private String driver;

    @Schema(description = "数据源地址", example = "https://www.cf.com")
    private String url;

    @Schema(description = "数据源用户名", example = "晨丰")
    private String username;

    @Schema(description = "数据源密码", example = "晨丰")
    private String password;

    @Schema(description = "备注", example = "该模板仅供生产使用")
    private String remark;

    @Schema(description = "数据集")
    private List<ReportDatasetRespVO> datasets;

    @Schema(description = "请求头参数")
    private List<Map<String, String>> headers;
}
