/*
 *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions are met:
 *
 *  Redistributions of source code must retain the above copyright notice,
 *  this list of conditions and the following disclaimer.
 *  Redistributions in binary form must reproduce the above copyright
 *  notice, this list of conditions and the following disclaimer in the
 *  documentation and/or other materials provided with the distribution.
 *  Neither the name of the dreamlu.net developer nor the names of its
 *  contributors may be used to endorse or promote products derived from
 *  this software without specific prior written permission.
 *  Author: Chill 庄骞 (smallchill@163.com)
 */
package org.springblade.etl.entity.bi;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springblade.core.mp.base.TenantEntity;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 数据接口实体类
 *
 * @author BladeX
 * @since 2021-04-17
 */
@Data
@ApiModel(value = "DataApi对象", description = "数据接口")
public class DataApi extends TenantEntity implements Serializable {

	private static final long serialVersionUID = 1L;

	/**
	 * 主键自增
	 */
	@ApiModelProperty(value = "主键自增")
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;
	/**
	 * 接口名称
	 */
	@ApiModelProperty(value = "接口名称")
	@TableField(condition = SqlCondition.LIKE)
	private String apiName;
	/**
	 * 唯一关键词
	 */
	@ApiModelProperty(value = "唯一关键词")
	private String apiKey;
	/**
	 * 接口类别 0-报表 1-常规
	 */
	@ApiModelProperty(value = "接口类别 0-报表 1-常规 2-三方查询接口 3-三方入库接口")
	private Integer apiType;
	/**
	 * 接口分类id,关联 data_api_category表
	 */
	@ApiModelProperty(value = "接口分类id,关联 data_api_category表")
	private Integer categoryId;

	@ApiModelProperty(value = "接口二级分类id,关联 data_api_category表")
	private Integer pid;

	@ApiModelProperty(value = "扩展字段，json存储")
	private String note;
	/**
	 * 接口类型 1-正式 0-临时
	 */
	@ApiModelProperty(value = "接口类型 1-正式 0-临时")
	private Integer apiFormal;
	/**
	 * 接口地址
	 */
	@ApiModelProperty(value = "接口地址")
	private String apiUrl;
	/**
	 * 数据源id
	 */
	@ApiModelProperty(value = "数据源id")
	private Integer datasourceId;
	/**
	 * 查询表视图名称
	 */
	@ApiModelProperty(value = "查询表视图名称")
	private String queryTable;
	/**
	 * 查询条件
	 */
	@ApiModelProperty(value = "查询条件")
	private String queryParam;
	/**
	 * 查询sql语句
	 */
	@ApiModelProperty(value = "查询sql语句")
	private String querySql;
	/**
	 * 接口状态 0-下线 1-上线 2-故障
	 */
	@ApiModelProperty(value = "接口状态 0-下线 1-上线 2-故障")
	private Integer apiStatus;
	/**
	 * 是否需要登录 0-不需要 1-需要
	 */
	@ApiModelProperty(value = "是否需要登录 0-不需要 1-需要")
	private Integer loginRequired;
	/**
	 * 备注
	 */
	@ApiModelProperty(value = "备注")
	private String remark;
	/**
	 * 创建时间
	 */
	@ApiModelProperty(value = "创建时间")
	private LocalDateTime createTime;

	@ApiModelProperty(value = "第三方接口请求方式(POST/GET)")
	private String apiMethod;

	@ApiModelProperty(value = "第三方API请求Header JSON字符串")
	private String apiHeaders;

	@ApiModelProperty(value = "第三方API数据处理JS函数")
	private String apiJsFunction;

	@ApiModelProperty(value = "第三方API传递数据方式(0：json/1：x-www-form-urlencoded)")
	private Integer apiParamType;

	@ApiModelProperty(value = "适用图表")
	private Integer chartType;

	@ApiModelProperty(value = "创建人ID")
	private Long createUserId;

	@ApiModelProperty(value = "是否分页 0：否 1是")
	private Integer isPage;

	@ApiModelProperty(value = "分页数量")
	private Integer pageSize;

}
