|
|
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
|
|
// This file was generated by swaggo/swag
|
|
|
|
|
|
package myreport
|
|
|
|
|
|
import (
|
|
|
"bytes"
|
|
|
"encoding/json"
|
|
|
"strings"
|
|
|
|
|
|
"github.com/alecthomas/template"
|
|
|
"github.com/swaggo/swag"
|
|
|
)
|
|
|
|
|
|
var doc = `{
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
"swagger": "2.0",
|
|
|
"info": {
|
|
|
"description": "{{.Description}}",
|
|
|
"title": "{{.Title}}",
|
|
|
"termsOfService": "http://swagger.io/terms/",
|
|
|
"contact": {
|
|
|
"name": "API Support",
|
|
|
"url": "http://www.swagger.io/support",
|
|
|
"email": "53766543@qq.com"
|
|
|
},
|
|
|
"license": {
|
|
|
"name": "Apache 2.0",
|
|
|
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
|
|
|
},
|
|
|
"version": "{{.Version}}"
|
|
|
},
|
|
|
"host": "{{.Host}}",
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
"paths": {
|
|
|
"/v1/report/QueryJoin": {
|
|
|
"post": {
|
|
|
"description": "【统计分析平台】ES-SQL数据关联查询接口,使用接入系统自定义的查询,与基础数据关联后【左关联】,返回查询结果数据。",
|
|
|
"consumes": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"V1.0"
|
|
|
],
|
|
|
"summary": "ES-SQL数据关联查询",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"description": "关联查询数据",
|
|
|
"name": "input",
|
|
|
"in": "body",
|
|
|
"required": true,
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.QueryJoin"
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
},
|
|
|
"400": {
|
|
|
"description": "Bad Request",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/v1/report/QuerySimple": {
|
|
|
"post": {
|
|
|
"description": "【统计分析平台】ES-SQL数据简单查询接口,使用接入系统自定义的查询,返回查询结果数据。",
|
|
|
"consumes": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"V1.0"
|
|
|
],
|
|
|
"summary": "ES-SQL数据查询",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"description": "简单查询数据",
|
|
|
"name": "input",
|
|
|
"in": "body",
|
|
|
"required": true,
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.QuerySimple"
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
},
|
|
|
"400": {
|
|
|
"description": "Bad Request",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/v1/report/QueryUnion": {
|
|
|
"post": {
|
|
|
"description": "【统计分析平台】ES-SQL数据合并查询接口,使用接入系统自定义的查询【支持多个查询】,与基础数据关联后【支持多次左关联】,返回查询结果数据。",
|
|
|
"consumes": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"V1.0"
|
|
|
],
|
|
|
"summary": "ES-SQL数据合并查询",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"description": "合并查询数据",
|
|
|
"name": "input",
|
|
|
"in": "body",
|
|
|
"required": true,
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.QueryUnion"
|
|
|
}
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
},
|
|
|
"400": {
|
|
|
"description": "Bad Request",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/MySwagger.DataResult"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"definitions": {
|
|
|
"MySwagger.DataResult": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"message": {
|
|
|
"type": "string",
|
|
|
"example": "查询成功"
|
|
|
},
|
|
|
"result": {
|
|
|
"type": "string",
|
|
|
"example": "根据查询请求的format格式,返回查询结果数据"
|
|
|
},
|
|
|
"success": {
|
|
|
"type": "boolean",
|
|
|
"example": true
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"MySwagger.Join": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"join_id": {
|
|
|
"type": "string",
|
|
|
"example": "org_area"
|
|
|
},
|
|
|
"join_param": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"220100"
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"MySwagger.QueryJoin": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"access_token": {
|
|
|
"type": "string",
|
|
|
"example": "system_01##20200102030405##a6ce11eab94df48a6ce11eab"
|
|
|
},
|
|
|
"query": {
|
|
|
"$ref": "#/definitions/MySwagger.Simple"
|
|
|
},
|
|
|
"query_count": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"total",
|
|
|
"total2"
|
|
|
]
|
|
|
},
|
|
|
"query_format": {
|
|
|
"type": "string",
|
|
|
"example": "table/json/echarts/antd"
|
|
|
},
|
|
|
"query_group": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"area_code",
|
|
|
"school_type"
|
|
|
]
|
|
|
},
|
|
|
"query_join": {
|
|
|
"$ref": "#/definitions/MySwagger.Join"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"MySwagger.QuerySimple": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"access_token": {
|
|
|
"type": "string",
|
|
|
"example": "system_01##20200102030405##a6ce11eab94df48a6ce11eab"
|
|
|
},
|
|
|
"query": {
|
|
|
"$ref": "#/definitions/MySwagger.Simple"
|
|
|
},
|
|
|
"query_count": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"total",
|
|
|
"total2"
|
|
|
]
|
|
|
},
|
|
|
"query_format": {
|
|
|
"type": "string",
|
|
|
"example": "table/json/echarts/antd"
|
|
|
},
|
|
|
"query_group": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"area_code",
|
|
|
"school_type"
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"MySwagger.QueryUnion": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"access_token": {
|
|
|
"type": "string",
|
|
|
"example": "system_01##20200102030405##a6ce11eab94df48a6ce11eab"
|
|
|
},
|
|
|
"join_list": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"$ref": "#/definitions/MySwagger.Join"
|
|
|
}
|
|
|
},
|
|
|
"query_count": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"total",
|
|
|
"total2"
|
|
|
]
|
|
|
},
|
|
|
"query_format": {
|
|
|
"type": "string",
|
|
|
"example": "table/json/echarts/antd"
|
|
|
},
|
|
|
"query_group": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"area_code",
|
|
|
"school_type"
|
|
|
]
|
|
|
},
|
|
|
"query_list": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"$ref": "#/definitions/MySwagger.Simple"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"MySwagger.Simple": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"query_id": {
|
|
|
"type": "string",
|
|
|
"example": "org_school_aggs"
|
|
|
},
|
|
|
"query_param": {
|
|
|
"type": "array",
|
|
|
"items": {
|
|
|
"type": "string"
|
|
|
},
|
|
|
"example": [
|
|
|
"100",
|
|
|
"test",
|
|
|
"2020/07/08"
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"securityDefinitions": {
|
|
|
"BasicAuth": {
|
|
|
"type": "basic"
|
|
|
}
|
|
|
}
|
|
|
}`
|
|
|
|
|
|
type swaggerInfo struct {
|
|
|
Version string
|
|
|
Host string
|
|
|
BasePath string
|
|
|
Schemes []string
|
|
|
Title string
|
|
|
Description string
|
|
|
}
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
var SwaggerInfo = swaggerInfo{
|
|
|
Version: "1.0",
|
|
|
Host: "127.0.0.1:9009",
|
|
|
BasePath: "/",
|
|
|
Schemes: []string{},
|
|
|
Title: "DataEX",
|
|
|
Description: "DataEX Service using GO!!! create by zhangjun 2020-06-03",
|
|
|
}
|
|
|
|
|
|
type s struct{}
|
|
|
|
|
|
func (s *s) ReadDoc() string {
|
|
|
sInfo := SwaggerInfo
|
|
|
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
|
|
|
|
|
|
t, err := template.New("swagger_info").Funcs(template.FuncMap{
|
|
|
"marshal": func(v interface{}) string {
|
|
|
a, _ := json.Marshal(v)
|
|
|
return string(a)
|
|
|
},
|
|
|
}).Parse(doc)
|
|
|
if err != nil {
|
|
|
return doc
|
|
|
}
|
|
|
|
|
|
var tpl bytes.Buffer
|
|
|
if err := t.Execute(&tpl, sInfo); err != nil {
|
|
|
return doc
|
|
|
}
|
|
|
|
|
|
return tpl.String()
|
|
|
}
|
|
|
|
|
|
func init() {
|
|
|
swag.Register(swag.Name, &s{})
|
|
|
}
|