From 4c0f1f5fb745679dbf2d959ae0d7604c3782d470 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=82=96?= <1340691923@qq.com> Date: Thu, 26 Dec 2024 22:34:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/build_ev/main.go | 221 -- cmd/test/main.go | 108 - config/ev-i18n/en.json | 61 - config/ev-i18n/zh-cn.json | 62 - config_dev/config_dev.yml | 39 - config_dev/config_dev.yml.tpl | 34 - config_dev/ev-i18n/en.json | 61 - config_dev/ev-i18n/zh-cn.json | 62 - docs/docs.go | 3292 ----------------- docs/swagger.json | 3267 ---------------- docs/swagger.yaml | 2095 ----------- generate.go | 4 +- pkg/api/ws_controller.go | 48 - .../es_sdk/pkg/factory/factory.go | 46 - pkg/util/encoding_test.go | 132 - pkg/util/encryption_test.go | 49 - pkg/util/excel.go | 70 - pkg/util/filepath_test.go | 37 - pkg/util/ip_address_test.go | 34 - pkg/util/md5_test.go | 17 - pkg/util/shortid_generator.go | 31 - pkg/util/shortid_generator_test.go | 45 - pkg/util/split_email_test.go | 52 - pkg/util/sql.go | 23 - pkg/util/strings_test.go | 154 - pkg/util/token.go | 4 - pkg/util/url_test.go | 81 - pkg/web/ws.go | 6 - .../src/layout/components/AppMain/index.vue | 1 + 29 files changed, 3 insertions(+), 10133 deletions(-) delete mode 100644 cmd/build_ev/main.go delete mode 100644 cmd/test/main.go delete mode 100644 config/ev-i18n/en.json delete mode 100644 config/ev-i18n/zh-cn.json delete mode 100644 config_dev/config_dev.yml delete mode 100644 config_dev/config_dev.yml.tpl delete mode 100644 config_dev/ev-i18n/en.json delete mode 100644 config_dev/ev-i18n/zh-cn.json delete mode 100644 docs/docs.go delete mode 100644 docs/swagger.json delete mode 100644 docs/swagger.yaml delete mode 100644 pkg/api/ws_controller.go delete mode 100644 pkg/util/encoding_test.go delete mode 100644 pkg/util/encryption_test.go delete mode 100644 pkg/util/excel.go delete mode 100644 pkg/util/filepath_test.go delete mode 100644 pkg/util/ip_address_test.go delete mode 100644 pkg/util/md5_test.go delete mode 100644 pkg/util/shortid_generator.go delete mode 100644 pkg/util/shortid_generator_test.go delete mode 100644 pkg/util/split_email_test.go delete mode 100644 pkg/util/sql.go delete mode 100644 pkg/util/strings_test.go delete mode 100644 pkg/util/url_test.go delete mode 100644 pkg/web/ws.go diff --git a/cmd/build_ev/main.go b/cmd/build_ev/main.go deleted file mode 100644 index 281df3c..0000000 --- a/cmd/build_ev/main.go +++ /dev/null @@ -1,221 +0,0 @@ -package main - -import ( - "bufio" - "flag" - "fmt" - "github.com/1340691923/ElasticView/pkg/infrastructure/config" - "github.com/1340691923/ElasticView/pkg/util" - "github.com/pkg/errors" - _ "net/http/pprof" - "os" - "os/exec" - "path/filepath" - "strings" -) - -var args *config.CommandLineArgs - -func init() { - args = &config.CommandLineArgs{} - flag.StringVar(&args.HomePath, "homePath", util.GetCurrentDirectory(), "ev程序所在文件夹") - flag.StringVar(&args.CmdName, "cmdName", "build", "二进制名称") - flag.StringVar(&args.ConfigFile, "configFile", "config/config.yml", "配置文件路径") - flag.Parse() -} - -func main() { - cfg, err := config.InitConfig(args) - if err != nil { - fmt.Println("InitConfig err", err) - panic(err) - } - - err = BuildVue(cfg) - if err != nil { - fmt.Println("BuildVue err", err) - panic(err) - } - - outputZipPath := fmt.Sprintf("resources/dist/ev_%s", strings.ReplaceAll(cfg.Version, ".", "_")) - - err = util.WriteVersionGoFile(fmt.Sprintf(`package config - -const Version = "v%s" - -`, cfg.Version)) - - if err != nil { - fmt.Println("BuildVue err", err) - panic(err) - } - - fmt.Println("开始检测是否已有该版本打包", cfg.Version) - if util.CheckFileIsExist(outputZipPath) { - fmt.Println("检测到已经该版本打包,正在删除老包", cfg.Version) - os.RemoveAll(outputZipPath) - } else { - fmt.Println("暂无该版本打包") - } - - for _, osAndArch := range []string{ - "linux_arm64", - "linux_amd64", - "darwin_amd64", - "windows_amd64", - } { - osAndArchArr := strings.Split(osAndArch, "_") - os := osAndArchArr[0] - arch := osAndArchArr[1] - err = BuildEvSvr(cfg, os, arch) - if err != nil { - fmt.Println("BuildEvSvr err", err) - panic(err) - } - } - - fmt.Println("BuildEvSvr success") -} - -type BuildConfig struct { - OS string // GOOS - GOARCH string - Env map[string]string - OutputPath string -} - -func getExecutableName(os, arch string) (string, error) { - exname := "ev" - - exeName := fmt.Sprintf("%s_%s_%s", exname, os, arch) - if os == "windows" { - exeName = fmt.Sprintf("%s.exe", exeName) - } - return exeName, nil -} - -func buildBackend(cfg BuildConfig) error { - - exeName, err := getExecutableName(cfg.OS, cfg.GOARCH) - if err != nil { - return err - } - - //-H windowsgui - ldFlags := fmt.Sprintf("-w -s%s%s ", " ", `-extldflags "-static"`) - - /*if cfg.OS == "windows" { - ldFlags = fmt.Sprintf("-w -s%s%s -H windowsgui", " ", `-extldflags "-static"`) - }*/ - - outputPath := cfg.OutputPath - - args := []string{ - "build", "-o", filepath.Join(outputPath, exeName), - } - - args = append(args, "-ldflags", ldFlags) - - rootPackage := "./cmd/ev" - - args = append(args, rootPackage) - - cfg.Env["GOOS"] = cfg.OS - cfg.Env["CGO_ENABLED"] = "0" - cfg.Env["GOARCH"] = cfg.GOARCH - return RunGoBuild(cfg.Env, args...) -} - -func newBuildConfig(os, arch, outputPath string) BuildConfig { - return BuildConfig{ - OS: os, - GOARCH: arch, - OutputPath: outputPath, - Env: map[string]string{}, - } -} - -func BuildVue(cfg *config.Config) (err error) { - cmd := exec.Command("npm", "run", "build") - cmd.Dir = "resources/vue" - - stdout, err := cmd.StdoutPipe() - if err != nil { - return errors.WithStack(err) - } - if err = cmd.Start(); err != nil { - return errors.WithStack(err) - } - scanner := bufio.NewScanner(stdout) - fmt.Println("=================build vue================") - - for scanner.Scan() { - fmt.Println(scanner.Text()) - } - if err = cmd.Wait(); err != nil { - return errors.WithStack(err) - } - - return -} - -func BuildEvSvr(cfg *config.Config, buildOs, buildArch string) (err error) { - - fmt.Println("开始编译ev二进制文件,版本:", cfg.Version, buildOs, buildArch) - - outputPath := fmt.Sprintf("resources/dist/ev_%s_%s_%s", cfg.Version, buildOs, buildArch) - - err = buildBackend(newBuildConfig(buildOs, buildArch, outputPath)) - if err != nil { - return - } - - os.MkdirAll(filepath.Join(outputPath, "config"), os.ModePerm) - err = util.DirCopy("config", filepath.Join(outputPath, "config")) - if err != nil { - return - } - - versionString := strings.ReplaceAll(cfg.Version, ".", "_") - - outputZipPath := fmt.Sprintf("resources/dist/ev_%s", versionString) - - fmt.Println("开始打包", cfg.Version, buildOs, buildArch) - - os.MkdirAll(outputZipPath, os.ModePerm) - - outputZip := filepath.Join(outputZipPath, fmt.Sprintf("ev_%s_%s_%s.zip", versionString, buildOs, buildArch)) - - err = util.CompressPathToZip(outputPath, outputZip) - if err != nil { - return - } - fmt.Println("打包成功,开始清理临时文件", cfg.Version, buildOs, buildArch) - os.RemoveAll(outputPath) - fmt.Println("清理临时文件完毕") - - return -} - -func RunGoBuild(env map[string]string, args ...string) (err error) { - if len(env) > 0 { - envArr := []string{"env", "-w"} - for k, v := range env { - envArr = append(envArr, fmt.Sprintf("%s=%s", k, v)) - } - - fmt.Println(fmt.Sprintf("start build cmd: go %v", envArr)) - - cmd := exec.Command("go", envArr...) - - err = cmd.Run() - if err != nil { - return - } - } - - fmt.Println(fmt.Sprintf("start build cmd: go %v", args)) - cmd := exec.Command("go", args...) - err = cmd.Run() - return -} diff --git a/cmd/test/main.go b/cmd/test/main.go deleted file mode 100644 index 53375e7..0000000 --- a/cmd/test/main.go +++ /dev/null @@ -1,108 +0,0 @@ -package main - -import ( - "bytes" - "fmt" - "github.com/davecgh/go-spew/spew" - "github.com/goccy/go-json" - "github.com/pkg/errors" - "io" - "net/http" -) - -func main() { - spew.Dump(BigModelSearch("select * from d where a < 1 转成 dsl", "sk-2aab3fac28c64c5bb7919b8f94f9f518")) -} - -func BigModelSearch(content string, appkey string) (resContent string, err error) { - - //调用大模型接口 - url := "https://dashscope.aliyuncs.com/compatible-mode/v1/chat/completions" - - // 构造请求体 - requestBody := map[string]interface{}{ - "model": "qwen-plus", - "messages": []map[string]string{ - { - "role": "system", - "content": "你是一个es程序员,能非常熟练的编写es查询语句。只需要回答es使用http方式查询的请求路径、请求方式、请求体即可," + - "最终以文本格式输出,不要使用Markdown语法。拒绝回答与es无关的问题。" + - "参考格式为 : 请求路径: /_search\n请求方式: GET\n请求体: \n{\n \"query\": {\n \"match_all\": {}\n }\n}", - }, - { - "role": "user", - "content": content, - }, - }, - } - - jsonBody, err := json.Marshal(requestBody) - if err != nil { - fmt.Println("JSON编码错误:", err) - return - } - - // 创建请求 - req, err := http.NewRequest("POST", url, bytes.NewBuffer(jsonBody)) - if err != nil { - fmt.Println("创建请求失败:", err) - return - } - - req.Header.Set("Authorization", "Bearer "+appkey) - req.Header.Set("Content-Type", "application/json") - - // 发送请求 - client := &http.Client{} - resp, err := client.Do(req) - if err != nil { - fmt.Println("请求失败:", err) - return - } - defer resp.Body.Close() - - // 读取响应 - body, err := io.ReadAll(resp.Body) - if err != nil { - fmt.Println("读取响应失败:", err) - return - } - - type ResBody struct { - Choices []struct { - Message struct { - Role string `json:"role"` - Content string `json:"content"` - } `json:"message"` - FinishReason string `json:"finish_reason"` - Index int `json:"index"` - Logprobs interface{} `json:"logprobs"` - } `json:"choices"` - Object string `json:"object"` - Usage struct { - PromptTokens int `json:"prompt_tokens"` - CompletionTokens int `json:"completion_tokens"` - TotalTokens int `json:"total_tokens"` - } `json:"usage"` - Created int `json:"created"` - SystemFingerprint interface{} `json:"system_fingerprint"` - Model string `json:"model"` - Id string `json:"id"` - } - - fmt.Println("响应状态:", resp.Status) - var responseBody ResBody - err = json.Unmarshal(body, &responseBody) - if err != nil { - fmt.Println("JSON解析失败:", err) - return - } - if len(responseBody.Choices) == 0 { - err = errors.New("解析失败") - return - } - - resContent = responseBody.Choices[0].Message.Content - - return -} diff --git a/config/ev-i18n/en.json b/config/ev-i18n/en.json deleted file mode 100644 index e947ed3..0000000 --- a/config/ev-i18n/en.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "首页": "Home", - "序号": "No.", - "角色id": "Role ID", - "角色名": "Role Name", - "角色详细信息": "Role Details", - "新建角色": "Create Role", - "操作": "Action", - "编辑": "Edit", - "删除": "Delete", - "角色详情信息": "Role Details", - "菜单栏": "Menu Bar", - "输入关键字进行过滤": "Enter Keywords to Filter", - "全选": "Select All", - "新建用户": "Create User", - "id": "ID", - "用户名": "Username", - "所属角色": "Assigned Role", - "真实姓名": "Real Name", - "密码": "Password", - "请选择角色": "Select a Role", - "取消": "Cancel", - "确认": "Confirm", - "操作用户": "User Operations", - "操作接口": "Management Interface", - "接口请求参数": "API Request Parameters", - "创建时间": "Creation Time", - "搜索": "Search", - "新建连接信息": "Create Connection Information", - "ES鉴权配置": "ES Authentication Configuration", - "折叠": "Collapse", - "展开": "Expand", - "鉴权配置": "Authentication Configuration", - "备注": "Notes", - "版本": "Version", - "修改时间": "Last Modified Time", - "鉴权列表": "Authentication List", - "新建鉴权信息": "Create Authentication Information", - "已分配角色": "Assigned Roles", - "root证书": "Root Certificate", - "cert证书": "Certificate", - "key证书": "Key Certificate", - "可访问集群成员": "Accessible Cluster Members", - "全部角色": "All Roles", - "请操作角色": "Please Manage Roles", - "无数据": "No Data", - "当前集群角色": "Current Roles in Cluster", - "移除角色": "Remove Role", - "添加角色": "Add Role", - "筛选菜单": "Filter Menu", - "请选择ES连接": "Please Select ES Connection", - "消息": "Message", - "通知": "Notification", - "待办": "To-Do", - "查看更多": "View More", - "全部已读": "Mark All as Read", - "ev后台备注": "EV Backend Notes", - "ES连接": "ES Connection", - "界面工具": "Interface Tools", - "默认连接(空鉴权)": "Default Connection (Empty Authentication)" -} diff --git a/config/ev-i18n/zh-cn.json b/config/ev-i18n/zh-cn.json deleted file mode 100644 index c06c60b..0000000 --- a/config/ev-i18n/zh-cn.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "首页": "首页", - "序号": "序号", - "角色id": "角色id", - "角色名": "角色名", - "角色详细信息": "角色详细信息", - "新建角色": "新建角色", - "操作": "操作", - "编辑": "编辑", - "删除": "删除", - "角色详情信息": "角色详情信息", - "菜单栏": "菜单栏", - "输入关键字进行过滤": "输入关键字进行过滤", - "全选": "全选", - "新建用户": "新建用户", - "id": "id", - "用户名": "用户名", - "所属角色": "所属角色", - "真实姓名": "真实姓名", - "密码": "密码", - "请选择角色": "请选择角色", - "取消": "取消", - "确认": "确认", - "操作用户": "操作用户", - "操作接口": "操作接口", - "接口请求参数": "接口请求参数", - "创建时间": "创建时间", - "搜索": "搜索", - "新建连接信息": "新建连接信息", - "ES鉴权配置": "ES鉴权配置", - "折叠": "折叠", - "展开": "展开", - "鉴权配置": "鉴权配置", - "备注": "备注", - "版本": "版本", - "修改时间": "修改时间", - "鉴权列表": "鉴权列表", - "新建鉴权信息": "新建鉴权信息", - "已分配角色": "已分配角色", - "root证书": "root证书", - "cert证书": "cert证书", - "key证书": "key证书", - "可访问集群成员": "可访问集群成员", - "全部角色": "全部角色", - "请操作角色": "请操作角色", - "无数据": "无数据", - "当前集群角色": "当前集群角色", - "移除角色": "移除角色", - "添加角色": "添加角色", - "筛选菜单": "筛选菜单", - "请选择ES连接": "请选择ES连接", - "消息": "消息", - "通知": "通知", - "待办": "待办", - "查看更多": "查看更多", - "全部已读": "全部已读", - "ev后台备注": "ev后台备注", - "ES连接": "ES连接", - "界面工具": "界面工具", - "默认连接(空鉴权)": "默认连接(空鉴权)" -} - diff --git a/config_dev/config_dev.yml b/config_dev/config_dev.yml deleted file mode 100644 index 9739a44..0000000 --- a/config_dev/config_dev.yml +++ /dev/null @@ -1,39 +0,0 @@ -appsecret: 1340691923@qq.com -checkforevupdates: true -checkforpluginupdates: true -dbtype: sqlite3 -debug: true -enableloges: false -enablelogesres: false -espwdsecret: concat_mail!!->1340691923@qq.com -log: - logdir: logs - storagedays: 4 -mysql: - dbname: test - ip: localhost - maxidleconns: 10 - maxopenconns: 10 - port: "3306" - pwd: "" - username: root -oauth: - workwechat: - agentid: - corpid: - enable: - secert: -plugin: - loadpath: plugins - storepath: plugins_store -pluginrpcport: 8091 -port: 8090 -rooturl: http://localhost:8090/ -sqlite: - dbname: es_view.db -translation: - cfgdir: config_dev/ev-i18n - lang: zh-cn -version: 0.0.5 -watermarkcontent: -storeFileDir: #临时文件存放目录 例如下载的excel diff --git a/config_dev/config_dev.yml.tpl b/config_dev/config_dev.yml.tpl deleted file mode 100644 index 500a16d..0000000 --- a/config_dev/config_dev.yml.tpl +++ /dev/null @@ -1,34 +0,0 @@ -log: - storageDays: 4 # 日志保留天数 - logDir: "logs" # 日志保留文件夹 -port: 8090 # 启动端口 -pluginRpcPort: 8091 #插件内网访问端口 -rootUrl: http://localhost:8090/ #项目访问根目录 -dbType: "sqlite3" # 数据保留类型 分为 sqlite3 和 mysql -enableLogEs: false #是否记录es请求记录 -enableLogEsRes: false #是否记录es请求记录中返回的响应体 -sqlite: # dbType为sqlite3时填 dbPath为数据保存文件地址 - dbName: "es_view.db" -mysql: # dbType为mysql时填 - username: "root" - pwd: "" - ip: "localhost" - port: "3306" - dbName: "test" - maxOpenConns: 10 - maxIdleConns: 10 -appSecret: "1340691923@qq.com" # jwt 加密密钥 -esPwdSecret: "concat_mail!!->1340691923@qq.com" # es密码加密密钥 加密方式为 AES -version: "0.0.5" # EV 版本号 -deBug: false # 是否为测试模式 如果为 false则打开默认浏览器直接访问地址 -checkForevUpdates: true #是否自动检测ev更新 -checkForPluginUpdates: true #是否自动检测ev插件更新 -evKey: #evKey 需要到插件者后台注册获取 -storeFileDir: #临时文件存放目录 例如下载的excel -plugin: - loadPath: plugins #插件存放目录 - storePath: plugins_store #插件临时文件存放目录 -watermarkContent: ElasticView #水印 -translation: - lang: zh-cn # zh-cn or en - cfgDir: config_dev/ev-i18n #i18n文件存放目录 diff --git a/config_dev/ev-i18n/en.json b/config_dev/ev-i18n/en.json deleted file mode 100644 index e947ed3..0000000 --- a/config_dev/ev-i18n/en.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "首页": "Home", - "序号": "No.", - "角色id": "Role ID", - "角色名": "Role Name", - "角色详细信息": "Role Details", - "新建角色": "Create Role", - "操作": "Action", - "编辑": "Edit", - "删除": "Delete", - "角色详情信息": "Role Details", - "菜单栏": "Menu Bar", - "输入关键字进行过滤": "Enter Keywords to Filter", - "全选": "Select All", - "新建用户": "Create User", - "id": "ID", - "用户名": "Username", - "所属角色": "Assigned Role", - "真实姓名": "Real Name", - "密码": "Password", - "请选择角色": "Select a Role", - "取消": "Cancel", - "确认": "Confirm", - "操作用户": "User Operations", - "操作接口": "Management Interface", - "接口请求参数": "API Request Parameters", - "创建时间": "Creation Time", - "搜索": "Search", - "新建连接信息": "Create Connection Information", - "ES鉴权配置": "ES Authentication Configuration", - "折叠": "Collapse", - "展开": "Expand", - "鉴权配置": "Authentication Configuration", - "备注": "Notes", - "版本": "Version", - "修改时间": "Last Modified Time", - "鉴权列表": "Authentication List", - "新建鉴权信息": "Create Authentication Information", - "已分配角色": "Assigned Roles", - "root证书": "Root Certificate", - "cert证书": "Certificate", - "key证书": "Key Certificate", - "可访问集群成员": "Accessible Cluster Members", - "全部角色": "All Roles", - "请操作角色": "Please Manage Roles", - "无数据": "No Data", - "当前集群角色": "Current Roles in Cluster", - "移除角色": "Remove Role", - "添加角色": "Add Role", - "筛选菜单": "Filter Menu", - "请选择ES连接": "Please Select ES Connection", - "消息": "Message", - "通知": "Notification", - "待办": "To-Do", - "查看更多": "View More", - "全部已读": "Mark All as Read", - "ev后台备注": "EV Backend Notes", - "ES连接": "ES Connection", - "界面工具": "Interface Tools", - "默认连接(空鉴权)": "Default Connection (Empty Authentication)" -} diff --git a/config_dev/ev-i18n/zh-cn.json b/config_dev/ev-i18n/zh-cn.json deleted file mode 100644 index c06c60b..0000000 --- a/config_dev/ev-i18n/zh-cn.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "首页": "首页", - "序号": "序号", - "角色id": "角色id", - "角色名": "角色名", - "角色详细信息": "角色详细信息", - "新建角色": "新建角色", - "操作": "操作", - "编辑": "编辑", - "删除": "删除", - "角色详情信息": "角色详情信息", - "菜单栏": "菜单栏", - "输入关键字进行过滤": "输入关键字进行过滤", - "全选": "全选", - "新建用户": "新建用户", - "id": "id", - "用户名": "用户名", - "所属角色": "所属角色", - "真实姓名": "真实姓名", - "密码": "密码", - "请选择角色": "请选择角色", - "取消": "取消", - "确认": "确认", - "操作用户": "操作用户", - "操作接口": "操作接口", - "接口请求参数": "接口请求参数", - "创建时间": "创建时间", - "搜索": "搜索", - "新建连接信息": "新建连接信息", - "ES鉴权配置": "ES鉴权配置", - "折叠": "折叠", - "展开": "展开", - "鉴权配置": "鉴权配置", - "备注": "备注", - "版本": "版本", - "修改时间": "修改时间", - "鉴权列表": "鉴权列表", - "新建鉴权信息": "新建鉴权信息", - "已分配角色": "已分配角色", - "root证书": "root证书", - "cert证书": "cert证书", - "key证书": "key证书", - "可访问集群成员": "可访问集群成员", - "全部角色": "全部角色", - "请操作角色": "请操作角色", - "无数据": "无数据", - "当前集群角色": "当前集群角色", - "移除角色": "移除角色", - "添加角色": "添加角色", - "筛选菜单": "筛选菜单", - "请选择ES连接": "请选择ES连接", - "消息": "消息", - "通知": "通知", - "待办": "待办", - "查看更多": "查看更多", - "全部已读": "全部已读", - "ev后台备注": "ev后台备注", - "ES连接": "ES连接", - "界面工具": "界面工具", - "默认连接(空鉴权)": "默认连接(空鉴权)" -} - diff --git a/docs/docs.go b/docs/docs.go deleted file mode 100644 index 8a23327..0000000 --- a/docs/docs.go +++ /dev/null @@ -1,3292 +0,0 @@ -// Code generated by swaggo/swag. DO NOT EDIT -package docs - -import "github.com/swaggo/swag" - -const docTemplate = `{ - "schemes": {{ marshal .Schemes }}, - "swagger": "2.0", - "info": { - "description": "{{escape .Description}}", - "title": "{{.Title}}", - "contact": { - "name": "肖文龙", - "url": "http://www.elastic-view.cn/suporrt.html", - "email": "1340691923@qq.com" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - }, - "version": "{{.Version}}" - }, - "host": "{{.Host}}", - "basePath": "{{.BasePath}}", - "paths": { - "/api/backUp/CleanupeRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "清理快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CleanupeRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/CreateSnapshotAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "创建快照", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CreateSnapshot" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotCreateRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "新建快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotCreateRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDeleteAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "删除快照", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDelete" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDeleteRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "删除快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDeleteRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDetailAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照详情", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDetail" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SnapshotDetail" - } - } - } - } - }, - "/api/backUp/SnapshotListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Snapshot" - } - } - } - } - } - }, - "/api/backUp/SnapshotRepositoryListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照仓库列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsSnapshotInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SnapshotRepositoryList" - } - } - } - } - }, - "/api/backUp/SnapshotRestoreAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "将索引恢复至快照时状态", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotRestore" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotStatusAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "得到快照状态", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotStatus" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/dslHistory/CleanAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DSL查询记录" - ], - "summary": "清空DSL查询记录", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/dslHistory/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DSL查询记录" - ], - "summary": "查询DSL查询记录接口", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.DslHistoryListReq" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.DisHistoryListRes" - } - } - } - } - }, - "/api/es/CatAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "es的cat操作", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsCat" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/PingAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "测试es连接", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/model.EsConnect" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RecoverCanWrite": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "将索引恢复为可写状态 由于不可抗力,ES禁止写后,默认不会自动恢复", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslGetAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送DELETE请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslHeadAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送HEAD请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslPUTAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送PUT请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslPostAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送POST请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/SqlToDslAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "SQL 转换为 DSL", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SqlToDsl" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SqlToDsl" - } - } - } - } - }, - "/api/es_crud/Download": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "下载navicat查询excel", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": {} - } - }, - "/api/es_crud/GetDSL": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "可视化GetDSL", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/navicat_service.Search" - } - } - } - } - }, - "/api/es_crud/GetList": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "可视化筛选获取数据", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/DeleteRowByIDAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "删除文档数据", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocDeleteRowByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/InsertAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "新增文档", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocUpdateByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/UpdateByIDAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "修改文档", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocUpdateByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/AddAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "新增别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/BatchAddAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "批量新增别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/CacheClear": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "清理索引缓存", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Close": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "关闭索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/CreateAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "创建索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/DeleteAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "删除es连接", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.DeleteEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Empty": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "清空索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Flush": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "将所有索引刷新到磁盘", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Forcemerge": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "强制合并索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/GetAliasAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取别名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.AliasInfo" - } - } - } - } - }, - "/api/es_index/GetSettingsAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取索引配置信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/GetSettingsInfoAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取所有的索引配置信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/IndexNamesAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "得到所有的索引名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "/api/es_index/IndexsCountAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "得到所有的索引数量", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "integer" - } - } - } - } - }, - "/api/es_index/InsertAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "新增连接信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.InsertEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/MoveAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "移动别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Open": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "开启索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Refresh": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "刷新索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/ReindexAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "重建索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsReIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/RemoveAlias": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "移除别名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/StatsAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取索引的Stats", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Status" - } - } - } - } - } - }, - "/api/es_index/UpdateAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "修改连接信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.UpdateEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_link/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "获取Es连接列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLink" - } - } - } - } - } - }, - "/api/es_link/OptAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "查看ES连接配置下拉选", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLinkOpt" - } - } - } - } - } - }, - "/api/es_map/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es映射" - ], - "summary": "Es 映射列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsMapGetProperties" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_map/UpdateMappingAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es映射" - ], - "summary": "修改Es映射", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.UpdateMapping" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_task/CancelAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es任务" - ], - "summary": "取消ES任务", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CancelTask" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_task/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es任务" - ], - "summary": "Es任务列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.TaskList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/vo.TaskInfo" - } - } - } - } - } - }, - "/api/gm_user/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "EV用户登录", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.User" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.User" - } - } - } - } - }, - "/api/operater_log/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ev后台操作日志" - ], - "summary": "查看后台操作日志", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.GmOperaterLogList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.GmOperaterLog" - } - } - } - } - } - }, - "definitions": { - "dto.AnalysisFilter": { - "type": "object", - "properties": { - "filterType": { - "type": "string" - }, - "filts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "columnName": { - "type": "string" - }, - "comparator": { - "type": "string" - }, - "filterType": { - "type": "string" - }, - "filts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "columnName": { - "type": "string" - }, - "comparator": { - "type": "string" - }, - "filterType": { - "type": "string" - }, - "ftv": {} - } - } - }, - "ftv": {}, - "relation": { - "type": "string" - } - } - } - }, - "relation": { - "type": "string" - } - } - }, - "dto.CancelTask": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "task_id": { - "type": "string" - } - } - }, - "dto.CleanupeRepository": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "dto.CreateSnapshot": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "ignore_unavailable": { - "type": "boolean" - }, - "include_global_state": { - "type": "boolean" - }, - "indexList": { - "type": "array", - "items": { - "type": "string" - } - }, - "partial": { - "type": "boolean" - }, - "repositoryName": { - "type": "string" - }, - "snapshotName": { - "type": "string" - }, - "wait": { - "type": "boolean" - } - } - }, - "dto.CrudFilter": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "limit": { - "type": "integer" - }, - "page": { - "type": "integer" - }, - "relation": { - "$ref": "#/definitions/dto.AnalysisFilter" - }, - "sort_list": { - "type": "array", - "items": { - "$ref": "#/definitions/dto.SortStruct" - } - } - } - }, - "dto.DeleteEsLink": { - "type": "object", - "properties": { - "id": { - "type": "integer" - } - } - }, - "dto.DslHistoryListReq": { - "type": "object", - "properties": { - "date": { - "description": "开始时间与结束时间(格式:”年-月-日 时:分:秒“ )", - "type": "array", - "items": { - "type": "string" - } - }, - "indexName": { - "description": "索引名", - "type": "string" - }, - "limit": { - "description": "拉取条数", - "type": "integer" - }, - "page": { - "description": "拉取数据当前页", - "type": "integer" - } - } - }, - "dto.EsAliasInfo": { - "type": "object", - "properties": { - "alias_name": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "new_alias_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "new_index_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/definitions/dto.Json" - }, - "types": { - "type": "integer" - } - } - }, - "dto.EsCat": { - "type": "object", - "properties": { - "cat": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "index_bytes_format": { - "type": "string" - } - } - }, - "dto.EsConnectID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - } - } - }, - "dto.EsDocDeleteRowByID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "id": { - "type": "string" - }, - "index_name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "dto.EsDocUpdateByID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "id": { - "type": "string" - }, - "index": { - "type": "string" - }, - "json": { - "$ref": "#/definitions/dto.Json" - }, - "type_name": { - "type": "string" - } - } - }, - "dto.EsIndexInfo": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "settings": { - "$ref": "#/definitions/dto.Json" - }, - "types": { - "type": "string" - } - } - }, - "dto.EsMapGetProperties": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - } - } - }, - "dto.EsOptimize": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - } - } - }, - "dto.EsReIndexInfo": { - "type": "object", - "properties": { - "body": { - "$ref": "#/definitions/util.Map" - }, - "es_connect": { - "type": "integer" - }, - "url_values": { - "type": "object", - "properties": { - "refresh": { - "type": "boolean" - }, - "requests_per_second": { - "type": "integer" - }, - "scroll": { - "type": "string" - }, - "slices": { - "type": "integer" - }, - "timeout": { - "type": "integer" - }, - "wait_for_active_shards": { - "type": "string" - }, - "wait_for_completion": { - "type": "boolean" - } - } - } - } - }, - "dto.EsRest": { - "type": "object", - "properties": { - "body": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "path": { - "type": "string" - } - } - }, - "dto.EsSnapshotInfo": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "snapshot_info_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "dto.GmOperaterLogList": { - "type": "object", - "properties": { - "date": { - "type": "array", - "items": { - "type": "string" - } - }, - "limit": { - "type": "integer" - }, - "operater_action": { - "type": "string" - }, - "operater_id": { - "type": "integer" - }, - "operater_role_id": { - "type": "integer" - }, - "page": { - "type": "integer" - } - } - }, - "dto.InsertEsLink": { - "type": "object", - "properties": { - "cfgIds": { - "type": "array", - "items": { - "type": "integer" - } - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "dto.Json": { - "type": "object", - "additionalProperties": true - }, - "dto.SnapshotCreateRepository": { - "type": "object", - "properties": { - "chunk_size": { - "type": "string" - }, - "compress": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "name": { - "type": "string" - }, - "readonly": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "dto.SnapshotDelete": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SnapshotDeleteRepository": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "dto.SnapshotDetail": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SnapshotList": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - } - } - }, - "dto.SnapshotRestore": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "ignore_unavailable": { - "type": "boolean" - }, - "include_global_state": { - "type": "boolean" - }, - "indexList": { - "type": "array", - "items": { - "type": "string" - } - }, - "partial": { - "type": "boolean" - }, - "rename_pattern": { - "type": "string" - }, - "rename_replacement": { - "type": "string" - }, - "repositoryName": { - "type": "string" - }, - "snapshotName": { - "type": "string" - }, - "wait": { - "type": "boolean" - } - } - }, - "dto.SnapshotStatus": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SortStruct": { - "type": "object", - "properties": { - "col": { - "type": "string" - }, - "sortRule": { - "type": "string" - } - } - }, - "dto.SqlToDsl": { - "type": "object", - "properties": { - "sql": { - "type": "string" - } - } - }, - "dto.TaskList": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - } - } - }, - "dto.UpdateEsLink": { - "type": "object", - "properties": { - "cfgIds": { - "type": "array", - "items": { - "type": "integer" - } - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "dto.UpdateMapping": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "properties": { - "$ref": "#/definitions/dto.Json" - }, - "type_name": { - "type": "string" - } - } - }, - "dto.User": { - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "model.EsConnect": { - "type": "object", - "properties": { - "certpem": { - "type": "string" - }, - "ip": { - "type": "string" - }, - "keypem": { - "type": "string" - }, - "pwd": { - "type": "string" - }, - "rootpem": { - "type": "string" - }, - "user": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "model.GmDslHistory": { - "type": "object", - "properties": { - "body": { - "description": "请求body", - "type": "string" - }, - "created": { - "description": "操作时间", - "type": "string" - }, - "id": { - "description": "id", - "type": "integer" - }, - "method": { - "description": "请求方法", - "type": "string" - }, - "path": { - "description": "请求path", - "type": "string" - }, - "uid": { - "description": "用户id", - "type": "integer" - } - } - }, - "navicat_service.Search": { - "type": "object", - "properties": { - "from": { - "type": "integer" - }, - "query": {}, - "search_after": { - "description": "explains how the score was computed", - "type": "array", - "items": {} - }, - "size": { - "type": "integer" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "response.ResponseData": { - "type": "object", - "properties": { - "code": { - "description": "消息码", - "type": "integer" - }, - "data": { - "description": "附加信息" - }, - "msg": { - "description": "消息提示", - "type": "string" - } - } - }, - "util.Map": { - "type": "object", - "additionalProperties": true - }, - "vo.AliasInfo": { - "type": "object", - "properties": { - "AliasName": { - "type": "string" - } - } - }, - "vo.DisHistoryListRes": { - "type": "object", - "properties": { - "count": { - "description": "查询数据总条数", - "type": "integer" - }, - "list": { - "description": "数据列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.GmDslHistory" - } - } - } - }, - "vo.EsLink": { - "type": "object", - "properties": { - "create_by_id": { - "type": "integer" - }, - "create_by_user_name": { - "type": "string" - }, - "created": { - "type": "string" - }, - "es_link_configs": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLinkConfig" - } - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "updated": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "vo.EsLinkConfig": { - "type": "object", - "properties": { - "certpem": { - "type": "string" - }, - "cfg_relation_id": { - "type": "integer" - }, - "created": { - "type": "string" - }, - "es_link_id": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "keypem": { - "type": "string" - }, - "pwd": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "rootpem": { - "type": "string" - }, - "share_roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "updated": { - "type": "string" - }, - "user": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "vo.EsLinkOpt": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "remark": { - "type": "string" - } - } - }, - "vo.GmOperaterLog": { - "type": "object", - "properties": { - "body_str": { - "type": "string" - }, - "created": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "method": { - "type": "string" - }, - "operater_action": { - "type": "string" - }, - "operater_id": { - "type": "integer" - }, - "operater_name": { - "type": "string" - }, - "operater_role_id": { - "type": "integer" - } - } - }, - "vo.Snapshot": { - "type": "object", - "properties": { - "duration": { - "type": "string" - }, - "end_epoch": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "failed_shards": { - "type": "string" - }, - "id": { - "type": "string" - }, - "indices": { - "type": "string" - }, - "start_epoch": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "string" - }, - "successful_shards": { - "type": "string" - }, - "total_shards": { - "type": "string" - } - } - }, - "vo.SnapshotDetail": { - "type": "object", - "properties": { - "snapshots": { - "type": "array", - "items": { - "type": "object", - "properties": { - "duration_in_millis": { - "type": "integer" - }, - "end_time": { - "type": "string" - }, - "end_time_in_millis": { - "type": "integer" - }, - "failures": { - "type": "array", - "items": {} - }, - "include_global_state": { - "type": "boolean" - }, - "indices": { - "type": "array", - "items": { - "type": "string" - } - }, - "shards": { - "type": "object", - "properties": { - "failed": { - "type": "integer" - }, - "successful": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "snapshot": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "start_time_in_millis": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "uuid": { - "type": "string" - }, - "version": { - "type": "string" - }, - "version_id": { - "type": "integer" - } - } - } - } - } - }, - "vo.SnapshotRepository": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/vo.SnapshotRepositorySettings" - }, - "type": { - "type": "string" - } - } - }, - "vo.SnapshotRepositoryList": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Snashot" - } - }, - "pathRepo": { - "type": "array", - "items": {} - }, - "res": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/vo.SnapshotRepository" - } - } - } - }, - "vo.SnapshotRepositorySettings": { - "type": "object", - "properties": { - "compress": { - "type": "string" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "readonly": { - "type": "string" - } - } - }, - "vo.Snashot": { - "type": "object", - "properties": { - "chunk_size": { - "type": "string" - }, - "compress": { - "type": "string" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "name": { - "type": "string" - }, - "readonly": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "vo.SqlToDsl": { - "type": "object", - "properties": { - "dsl": { - "type": "string" - }, - "tableName": { - "type": "string" - } - } - }, - "vo.Status": { - "type": "object", - "properties": { - "status": { - "type": "string" - } - } - }, - "vo.TaskInfo": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "cancellable": { - "type": "boolean" - }, - "description": { - "description": "same as Status" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "id": { - "description": "the task id (yes, this is a long in the Java source)", - "type": "integer" - }, - "node": { - "type": "string" - }, - "parent_task_id": { - "description": "like \"YxJnVYjwSBm_AUbzddTajQ:12356\"", - "type": "string" - }, - "running_time": { - "type": "string" - }, - "running_time_in_nanos": { - "type": "integer" - }, - "start_time": { - "type": "string" - }, - "start_time_in_millis": { - "type": "integer" - }, - "status": { - "description": "has separate implementations of Task.Status in Java for reindexing, replication, and \"RawTaskStatus\"" - }, - "type": { - "type": "string" - } - } - }, - "vo.User": { - "type": "object", - "properties": { - "token": { - "type": "string" - }, - "unix_time": { - "type": "integer" - } - } - } - } -}` - -// SwaggerInfo holds exported Swagger Info so clients can modify it -var SwaggerInfo = &swag.Spec{ - Version: "", - Host: "", - BasePath: "", - Schemes: []string{}, - Title: "ElasticView", - Description: "励志成为陪伴你一生的elasticsearch可视化客户端", - InfoInstanceName: "swagger", - SwaggerTemplate: docTemplate, -} - -func init() { - swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo) -} diff --git a/docs/swagger.json b/docs/swagger.json deleted file mode 100644 index 6b7bb60..0000000 --- a/docs/swagger.json +++ /dev/null @@ -1,3267 +0,0 @@ -{ - "swagger": "2.0", - "info": { - "description": "励志成为陪伴你一生的elasticsearch可视化客户端", - "title": "ElasticView", - "contact": { - "name": "肖文龙", - "url": "http://www.elastic-view.cn/suporrt.html", - "email": "1340691923@qq.com" - }, - "license": { - "name": "Apache 2.0", - "url": "http://www.apache.org/licenses/LICENSE-2.0.html" - } - }, - "paths": { - "/api/backUp/CleanupeRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "清理快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CleanupeRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/CreateSnapshotAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "创建快照", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CreateSnapshot" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotCreateRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "新建快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotCreateRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDeleteAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "删除快照", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDelete" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDeleteRepositoryAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "删除快照仓库", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDeleteRepository" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotDetailAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照详情", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotDetail" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SnapshotDetail" - } - } - } - } - }, - "/api/backUp/SnapshotListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Snapshot" - } - } - } - } - } - }, - "/api/backUp/SnapshotRepositoryListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "快照仓库列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsSnapshotInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SnapshotRepositoryList" - } - } - } - } - }, - "/api/backUp/SnapshotRestoreAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "将索引恢复至快照时状态", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotRestore" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/backUp/SnapshotStatusAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "快照" - ], - "summary": "得到快照状态", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SnapshotStatus" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/dslHistory/CleanAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DSL查询记录" - ], - "summary": "清空DSL查询记录", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/dslHistory/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "DSL查询记录" - ], - "summary": "查询DSL查询记录接口", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.DslHistoryListReq" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.DisHistoryListRes" - } - } - } - } - }, - "/api/es/CatAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "es的cat操作", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsCat" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/PingAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "测试es连接", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/model.EsConnect" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RecoverCanWrite": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "将索引恢复为可写状态 由于不可抗力,ES禁止写后,默认不会自动恢复", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslGetAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送DELETE请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslHeadAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送HEAD请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslPUTAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送PUT请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/RunDslPostAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "发送POST请求到es", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsRest" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es/SqlToDslAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ES" - ], - "summary": "SQL 转换为 DSL", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.SqlToDsl" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.SqlToDsl" - } - } - } - } - }, - "/api/es_crud/Download": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "下载navicat查询excel", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": {} - } - }, - "/api/es_crud/GetDSL": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "可视化GetDSL", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/navicat_service.Search" - } - } - } - } - }, - "/api/es_crud/GetList": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "可视化筛选" - ], - "summary": "可视化筛选获取数据", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CrudFilter" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/DeleteRowByIDAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "删除文档数据", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocDeleteRowByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/InsertAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "新增文档", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocUpdateByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_doc/UpdateByIDAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es文档" - ], - "summary": "修改文档", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsDocUpdateByID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/AddAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "新增别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/BatchAddAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "批量新增别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/CacheClear": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "清理索引缓存", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Close": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "关闭索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/CreateAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "创建索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/DeleteAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "删除es连接", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.DeleteEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Empty": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "清空索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Flush": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "将所有索引刷新到磁盘", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Forcemerge": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "强制合并索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/GetAliasAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取别名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.AliasInfo" - } - } - } - } - }, - "/api/es_index/GetSettingsAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取索引配置信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/GetSettingsInfoAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取所有的索引配置信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/IndexNamesAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "得到所有的索引名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "type": "string" - } - } - } - } - } - }, - "/api/es_index/IndexsCountAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "得到所有的索引数量", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsConnectID" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "integer" - } - } - } - } - }, - "/api/es_index/InsertAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "新增连接信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.InsertEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/MoveAliasToIndex": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "移动别名到索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Open": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "开启索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/Refresh": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "刷新索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsOptimize" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/ReindexAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "重建索引", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsReIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/RemoveAlias": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "移除别名", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsAliasInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_index/StatsAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es索引" - ], - "summary": "获取索引的Stats", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsIndexInfo" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Status" - } - } - } - } - } - }, - "/api/es_index/UpdateAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "修改连接信息", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.UpdateEsLink" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_link/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "获取Es连接列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLink" - } - } - } - } - } - }, - "/api/es_link/OptAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es连接信息" - ], - "summary": "查看ES连接配置下拉选", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLinkOpt" - } - } - } - } - } - }, - "/api/es_map/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es映射" - ], - "summary": "Es 映射列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.EsMapGetProperties" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_map/UpdateMappingAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es映射" - ], - "summary": "修改Es映射", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.UpdateMapping" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_task/CancelAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es任务" - ], - "summary": "取消ES任务", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.CancelTask" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/response.ResponseData" - } - } - } - } - }, - "/api/es_task/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "es任务" - ], - "summary": "Es任务列表", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.TaskList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/vo.TaskInfo" - } - } - } - } - } - }, - "/api/gm_user/login": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "summary": "EV用户登录", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.User" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.User" - } - } - } - } - }, - "/api/operater_log/ListAction": { - "post": { - "consumes": [ - "application/json" - ], - "produces": [ - "application/json" - ], - "tags": [ - "ev后台操作日志" - ], - "summary": "查看后台操作日志", - "parameters": [ - { - "type": "string", - "description": "用户令牌", - "name": "X-Token", - "in": "header" - }, - { - "description": "查询参数", - "name": "object", - "in": "body", - "schema": { - "$ref": "#/definitions/dto.GmOperaterLogList" - } - } - ], - "responses": { - "0": { - "description": "", - "schema": { - "$ref": "#/definitions/vo.GmOperaterLog" - } - } - } - } - } - }, - "definitions": { - "dto.AnalysisFilter": { - "type": "object", - "properties": { - "filterType": { - "type": "string" - }, - "filts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "columnName": { - "type": "string" - }, - "comparator": { - "type": "string" - }, - "filterType": { - "type": "string" - }, - "filts": { - "type": "array", - "items": { - "type": "object", - "properties": { - "columnName": { - "type": "string" - }, - "comparator": { - "type": "string" - }, - "filterType": { - "type": "string" - }, - "ftv": {} - } - } - }, - "ftv": {}, - "relation": { - "type": "string" - } - } - } - }, - "relation": { - "type": "string" - } - } - }, - "dto.CancelTask": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "task_id": { - "type": "string" - } - } - }, - "dto.CleanupeRepository": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "dto.CreateSnapshot": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "ignore_unavailable": { - "type": "boolean" - }, - "include_global_state": { - "type": "boolean" - }, - "indexList": { - "type": "array", - "items": { - "type": "string" - } - }, - "partial": { - "type": "boolean" - }, - "repositoryName": { - "type": "string" - }, - "snapshotName": { - "type": "string" - }, - "wait": { - "type": "boolean" - } - } - }, - "dto.CrudFilter": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "limit": { - "type": "integer" - }, - "page": { - "type": "integer" - }, - "relation": { - "$ref": "#/definitions/dto.AnalysisFilter" - }, - "sort_list": { - "type": "array", - "items": { - "$ref": "#/definitions/dto.SortStruct" - } - } - } - }, - "dto.DeleteEsLink": { - "type": "object", - "properties": { - "id": { - "type": "integer" - } - } - }, - "dto.DslHistoryListReq": { - "type": "object", - "properties": { - "date": { - "description": "开始时间与结束时间(格式:”年-月-日 时:分:秒“ )", - "type": "array", - "items": { - "type": "string" - } - }, - "indexName": { - "description": "索引名", - "type": "string" - }, - "limit": { - "description": "拉取条数", - "type": "integer" - }, - "page": { - "description": "拉取数据当前页", - "type": "integer" - } - } - }, - "dto.EsAliasInfo": { - "type": "object", - "properties": { - "alias_name": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "new_alias_name_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "new_index_list": { - "type": "array", - "items": { - "type": "string" - } - }, - "settings": { - "$ref": "#/definitions/dto.Json" - }, - "types": { - "type": "integer" - } - } - }, - "dto.EsCat": { - "type": "object", - "properties": { - "cat": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "index_bytes_format": { - "type": "string" - } - } - }, - "dto.EsConnectID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - } - } - }, - "dto.EsDocDeleteRowByID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "id": { - "type": "string" - }, - "index_name": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "dto.EsDocUpdateByID": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "id": { - "type": "string" - }, - "index": { - "type": "string" - }, - "json": { - "$ref": "#/definitions/dto.Json" - }, - "type_name": { - "type": "string" - } - } - }, - "dto.EsIndexInfo": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "settings": { - "$ref": "#/definitions/dto.Json" - }, - "types": { - "type": "string" - } - } - }, - "dto.EsMapGetProperties": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - } - } - }, - "dto.EsOptimize": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - } - } - }, - "dto.EsReIndexInfo": { - "type": "object", - "properties": { - "body": { - "$ref": "#/definitions/util.Map" - }, - "es_connect": { - "type": "integer" - }, - "url_values": { - "type": "object", - "properties": { - "refresh": { - "type": "boolean" - }, - "requests_per_second": { - "type": "integer" - }, - "scroll": { - "type": "string" - }, - "slices": { - "type": "integer" - }, - "timeout": { - "type": "integer" - }, - "wait_for_active_shards": { - "type": "string" - }, - "wait_for_completion": { - "type": "boolean" - } - } - } - } - }, - "dto.EsRest": { - "type": "object", - "properties": { - "body": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "path": { - "type": "string" - } - } - }, - "dto.EsSnapshotInfo": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "snapshot_info_list": { - "type": "array", - "items": { - "type": "string" - } - } - } - }, - "dto.GmOperaterLogList": { - "type": "object", - "properties": { - "date": { - "type": "array", - "items": { - "type": "string" - } - }, - "limit": { - "type": "integer" - }, - "operater_action": { - "type": "string" - }, - "operater_id": { - "type": "integer" - }, - "operater_role_id": { - "type": "integer" - }, - "page": { - "type": "integer" - } - } - }, - "dto.InsertEsLink": { - "type": "object", - "properties": { - "cfgIds": { - "type": "array", - "items": { - "type": "integer" - } - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "dto.Json": { - "type": "object", - "additionalProperties": true - }, - "dto.SnapshotCreateRepository": { - "type": "object", - "properties": { - "chunk_size": { - "type": "string" - }, - "compress": { - "type": "string" - }, - "es_connect": { - "type": "integer" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "name": { - "type": "string" - }, - "readonly": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "dto.SnapshotDelete": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SnapshotDeleteRepository": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "name": { - "type": "string" - } - } - }, - "dto.SnapshotDetail": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SnapshotList": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - } - } - }, - "dto.SnapshotRestore": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "ignore_unavailable": { - "type": "boolean" - }, - "include_global_state": { - "type": "boolean" - }, - "indexList": { - "type": "array", - "items": { - "type": "string" - } - }, - "partial": { - "type": "boolean" - }, - "rename_pattern": { - "type": "string" - }, - "rename_replacement": { - "type": "string" - }, - "repositoryName": { - "type": "string" - }, - "snapshotName": { - "type": "string" - }, - "wait": { - "type": "boolean" - } - } - }, - "dto.SnapshotStatus": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "repository": { - "type": "string" - }, - "snapshot": { - "type": "string" - } - } - }, - "dto.SortStruct": { - "type": "object", - "properties": { - "col": { - "type": "string" - }, - "sortRule": { - "type": "string" - } - } - }, - "dto.SqlToDsl": { - "type": "object", - "properties": { - "sql": { - "type": "string" - } - } - }, - "dto.TaskList": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - } - } - }, - "dto.UpdateEsLink": { - "type": "object", - "properties": { - "cfgIds": { - "type": "array", - "items": { - "type": "integer" - } - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "dto.UpdateMapping": { - "type": "object", - "properties": { - "es_connect": { - "type": "integer" - }, - "index_name": { - "type": "string" - }, - "properties": { - "$ref": "#/definitions/dto.Json" - }, - "type_name": { - "type": "string" - } - } - }, - "dto.User": { - "type": "object", - "properties": { - "password": { - "type": "string" - }, - "username": { - "type": "string" - } - } - }, - "model.EsConnect": { - "type": "object", - "properties": { - "certpem": { - "type": "string" - }, - "ip": { - "type": "string" - }, - "keypem": { - "type": "string" - }, - "pwd": { - "type": "string" - }, - "rootpem": { - "type": "string" - }, - "user": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "model.GmDslHistory": { - "type": "object", - "properties": { - "body": { - "description": "请求body", - "type": "string" - }, - "created": { - "description": "操作时间", - "type": "string" - }, - "id": { - "description": "id", - "type": "integer" - }, - "method": { - "description": "请求方法", - "type": "string" - }, - "path": { - "description": "请求path", - "type": "string" - }, - "uid": { - "description": "用户id", - "type": "integer" - } - } - }, - "navicat_service.Search": { - "type": "object", - "properties": { - "from": { - "type": "integer" - }, - "query": {}, - "search_after": { - "description": "explains how the score was computed", - "type": "array", - "items": {} - }, - "size": { - "type": "integer" - }, - "sort": { - "type": "array", - "items": { - "type": "object", - "additionalProperties": true - } - } - } - }, - "response.ResponseData": { - "type": "object", - "properties": { - "code": { - "description": "消息码", - "type": "integer" - }, - "data": { - "description": "附加信息" - }, - "msg": { - "description": "消息提示", - "type": "string" - } - } - }, - "util.Map": { - "type": "object", - "additionalProperties": true - }, - "vo.AliasInfo": { - "type": "object", - "properties": { - "AliasName": { - "type": "string" - } - } - }, - "vo.DisHistoryListRes": { - "type": "object", - "properties": { - "count": { - "description": "查询数据总条数", - "type": "integer" - }, - "list": { - "description": "数据列表", - "type": "array", - "items": { - "$ref": "#/definitions/model.GmDslHistory" - } - } - } - }, - "vo.EsLink": { - "type": "object", - "properties": { - "create_by_id": { - "type": "integer" - }, - "create_by_user_name": { - "type": "string" - }, - "created": { - "type": "string" - }, - "es_link_configs": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.EsLinkConfig" - } - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "updated": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "vo.EsLinkConfig": { - "type": "object", - "properties": { - "certpem": { - "type": "string" - }, - "cfg_relation_id": { - "type": "integer" - }, - "created": { - "type": "string" - }, - "es_link_id": { - "type": "integer" - }, - "id": { - "type": "integer" - }, - "ip": { - "type": "string" - }, - "keypem": { - "type": "string" - }, - "pwd": { - "type": "string" - }, - "remark": { - "type": "string" - }, - "rootpem": { - "type": "string" - }, - "share_roles": { - "type": "array", - "items": { - "type": "string" - } - }, - "updated": { - "type": "string" - }, - "user": { - "type": "string" - }, - "version": { - "type": "integer" - } - } - }, - "vo.EsLinkOpt": { - "type": "object", - "properties": { - "id": { - "type": "integer" - }, - "remark": { - "type": "string" - } - } - }, - "vo.GmOperaterLog": { - "type": "object", - "properties": { - "body_str": { - "type": "string" - }, - "created": { - "type": "string" - }, - "id": { - "type": "integer" - }, - "method": { - "type": "string" - }, - "operater_action": { - "type": "string" - }, - "operater_id": { - "type": "integer" - }, - "operater_name": { - "type": "string" - }, - "operater_role_id": { - "type": "integer" - } - } - }, - "vo.Snapshot": { - "type": "object", - "properties": { - "duration": { - "type": "string" - }, - "end_epoch": { - "type": "string" - }, - "end_time": { - "type": "string" - }, - "failed_shards": { - "type": "string" - }, - "id": { - "type": "string" - }, - "indices": { - "type": "string" - }, - "start_epoch": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "status": { - "type": "string" - }, - "successful_shards": { - "type": "string" - }, - "total_shards": { - "type": "string" - } - } - }, - "vo.SnapshotDetail": { - "type": "object", - "properties": { - "snapshots": { - "type": "array", - "items": { - "type": "object", - "properties": { - "duration_in_millis": { - "type": "integer" - }, - "end_time": { - "type": "string" - }, - "end_time_in_millis": { - "type": "integer" - }, - "failures": { - "type": "array", - "items": {} - }, - "include_global_state": { - "type": "boolean" - }, - "indices": { - "type": "array", - "items": { - "type": "string" - } - }, - "shards": { - "type": "object", - "properties": { - "failed": { - "type": "integer" - }, - "successful": { - "type": "integer" - }, - "total": { - "type": "integer" - } - } - }, - "snapshot": { - "type": "string" - }, - "start_time": { - "type": "string" - }, - "start_time_in_millis": { - "type": "integer" - }, - "state": { - "type": "string" - }, - "uuid": { - "type": "string" - }, - "version": { - "type": "string" - }, - "version_id": { - "type": "integer" - } - } - } - } - } - }, - "vo.SnapshotRepository": { - "type": "object", - "properties": { - "settings": { - "$ref": "#/definitions/vo.SnapshotRepositorySettings" - }, - "type": { - "type": "string" - } - } - }, - "vo.SnapshotRepositoryList": { - "type": "object", - "properties": { - "list": { - "type": "array", - "items": { - "$ref": "#/definitions/vo.Snashot" - } - }, - "pathRepo": { - "type": "array", - "items": {} - }, - "res": { - "type": "object", - "additionalProperties": { - "$ref": "#/definitions/vo.SnapshotRepository" - } - } - } - }, - "vo.SnapshotRepositorySettings": { - "type": "object", - "properties": { - "compress": { - "type": "string" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "readonly": { - "type": "string" - } - } - }, - "vo.Snashot": { - "type": "object", - "properties": { - "chunk_size": { - "type": "string" - }, - "compress": { - "type": "string" - }, - "location": { - "type": "string" - }, - "max_restore_bytes_per_sec": { - "type": "string" - }, - "max_snapshot_bytes_per_sec": { - "type": "string" - }, - "name": { - "type": "string" - }, - "readonly": { - "type": "string" - }, - "type": { - "type": "string" - } - } - }, - "vo.SqlToDsl": { - "type": "object", - "properties": { - "dsl": { - "type": "string" - }, - "tableName": { - "type": "string" - } - } - }, - "vo.Status": { - "type": "object", - "properties": { - "status": { - "type": "string" - } - } - }, - "vo.TaskInfo": { - "type": "object", - "properties": { - "action": { - "type": "string" - }, - "cancellable": { - "type": "boolean" - }, - "description": { - "description": "same as Status" - }, - "headers": { - "type": "object", - "additionalProperties": { - "type": "string" - } - }, - "id": { - "description": "the task id (yes, this is a long in the Java source)", - "type": "integer" - }, - "node": { - "type": "string" - }, - "parent_task_id": { - "description": "like \"YxJnVYjwSBm_AUbzddTajQ:12356\"", - "type": "string" - }, - "running_time": { - "type": "string" - }, - "running_time_in_nanos": { - "type": "integer" - }, - "start_time": { - "type": "string" - }, - "start_time_in_millis": { - "type": "integer" - }, - "status": { - "description": "has separate implementations of Task.Status in Java for reindexing, replication, and \"RawTaskStatus\"" - }, - "type": { - "type": "string" - } - } - }, - "vo.User": { - "type": "object", - "properties": { - "token": { - "type": "string" - }, - "unix_time": { - "type": "integer" - } - } - } - } -} \ No newline at end of file diff --git a/docs/swagger.yaml b/docs/swagger.yaml deleted file mode 100644 index fbe6259..0000000 --- a/docs/swagger.yaml +++ /dev/null @@ -1,2095 +0,0 @@ -definitions: - dto.AnalysisFilter: - properties: - filterType: - type: string - filts: - items: - properties: - columnName: - type: string - comparator: - type: string - filterType: - type: string - filts: - items: - properties: - columnName: - type: string - comparator: - type: string - filterType: - type: string - ftv: {} - type: object - type: array - ftv: {} - relation: - type: string - type: object - type: array - relation: - type: string - type: object - dto.CancelTask: - properties: - es_connect: - type: integer - task_id: - type: string - type: object - dto.CleanupeRepository: - properties: - es_connect: - type: integer - name: - type: string - type: object - dto.CreateSnapshot: - properties: - es_connect: - type: integer - ignore_unavailable: - type: boolean - include_global_state: - type: boolean - indexList: - items: - type: string - type: array - partial: - type: boolean - repositoryName: - type: string - snapshotName: - type: string - wait: - type: boolean - type: object - dto.CrudFilter: - properties: - es_connect: - type: integer - index_name: - type: string - limit: - type: integer - page: - type: integer - relation: - $ref: '#/definitions/dto.AnalysisFilter' - sort_list: - items: - $ref: '#/definitions/dto.SortStruct' - type: array - type: object - dto.DeleteEsLink: - properties: - id: - type: integer - type: object - dto.DslHistoryListReq: - properties: - date: - description: 开始时间与结束时间(格式:”年-月-日 时:分:秒“ ) - items: - type: string - type: array - indexName: - description: 索引名 - type: string - limit: - description: 拉取条数 - type: integer - page: - description: 拉取数据当前页 - type: integer - type: object - dto.EsAliasInfo: - properties: - alias_name: - type: string - es_connect: - type: integer - index_name: - type: string - new_alias_name_list: - items: - type: string - type: array - new_index_list: - items: - type: string - type: array - settings: - $ref: '#/definitions/dto.Json' - types: - type: integer - type: object - dto.EsCat: - properties: - cat: - type: string - es_connect: - type: integer - index_bytes_format: - type: string - type: object - dto.EsConnectID: - properties: - es_connect: - type: integer - type: object - dto.EsDocDeleteRowByID: - properties: - es_connect: - type: integer - id: - type: string - index_name: - type: string - type: - type: string - type: object - dto.EsDocUpdateByID: - properties: - es_connect: - type: integer - id: - type: string - index: - type: string - json: - $ref: '#/definitions/dto.Json' - type_name: - type: string - type: object - dto.EsIndexInfo: - properties: - es_connect: - type: integer - index_name: - type: string - settings: - $ref: '#/definitions/dto.Json' - types: - type: string - type: object - dto.EsMapGetProperties: - properties: - es_connect: - type: integer - index_name: - type: string - type: object - dto.EsOptimize: - properties: - es_connect: - type: integer - index_name: - type: string - type: object - dto.EsReIndexInfo: - properties: - body: - $ref: '#/definitions/util.Map' - es_connect: - type: integer - url_values: - properties: - refresh: - type: boolean - requests_per_second: - type: integer - scroll: - type: string - slices: - type: integer - timeout: - type: integer - wait_for_active_shards: - type: string - wait_for_completion: - type: boolean - type: object - type: object - dto.EsRest: - properties: - body: - type: string - es_connect: - type: integer - path: - type: string - type: object - dto.EsSnapshotInfo: - properties: - es_connect: - type: integer - snapshot_info_list: - items: - type: string - type: array - type: object - dto.GmOperaterLogList: - properties: - date: - items: - type: string - type: array - limit: - type: integer - operater_action: - type: string - operater_id: - type: integer - operater_role_id: - type: integer - page: - type: integer - type: object - dto.InsertEsLink: - properties: - cfgIds: - items: - type: integer - type: array - ip: - type: string - remark: - type: string - version: - type: integer - type: object - dto.Json: - additionalProperties: true - type: object - dto.SnapshotCreateRepository: - properties: - chunk_size: - type: string - compress: - type: string - es_connect: - type: integer - location: - type: string - max_restore_bytes_per_sec: - type: string - max_snapshot_bytes_per_sec: - type: string - name: - type: string - readonly: - type: string - type: - type: string - type: object - dto.SnapshotDelete: - properties: - es_connect: - type: integer - repository: - type: string - snapshot: - type: string - type: object - dto.SnapshotDeleteRepository: - properties: - es_connect: - type: integer - name: - type: string - type: object - dto.SnapshotDetail: - properties: - es_connect: - type: integer - repository: - type: string - snapshot: - type: string - type: object - dto.SnapshotList: - properties: - es_connect: - type: integer - repository: - type: string - type: object - dto.SnapshotRestore: - properties: - es_connect: - type: integer - ignore_unavailable: - type: boolean - include_global_state: - type: boolean - indexList: - items: - type: string - type: array - partial: - type: boolean - rename_pattern: - type: string - rename_replacement: - type: string - repositoryName: - type: string - snapshotName: - type: string - wait: - type: boolean - type: object - dto.SnapshotStatus: - properties: - es_connect: - type: integer - repository: - type: string - snapshot: - type: string - type: object - dto.SortStruct: - properties: - col: - type: string - sortRule: - type: string - type: object - dto.SqlToDsl: - properties: - sql: - type: string - type: object - dto.TaskList: - properties: - es_connect: - type: integer - type: object - dto.UpdateEsLink: - properties: - cfgIds: - items: - type: integer - type: array - id: - type: integer - ip: - type: string - remark: - type: string - version: - type: integer - type: object - dto.UpdateMapping: - properties: - es_connect: - type: integer - index_name: - type: string - properties: - $ref: '#/definitions/dto.Json' - type_name: - type: string - type: object - dto.User: - properties: - password: - type: string - username: - type: string - type: object - model.EsConnect: - properties: - certpem: - type: string - ip: - type: string - keypem: - type: string - pwd: - type: string - rootpem: - type: string - user: - type: string - version: - type: integer - type: object - model.GmDslHistory: - properties: - body: - description: 请求body - type: string - created: - description: 操作时间 - type: string - id: - description: id - type: integer - method: - description: 请求方法 - type: string - path: - description: 请求path - type: string - uid: - description: 用户id - type: integer - type: object - navicat_service.Search: - properties: - from: - type: integer - query: {} - search_after: - description: explains how the score was computed - items: {} - type: array - size: - type: integer - sort: - items: - additionalProperties: true - type: object - type: array - type: object - response.ResponseData: - properties: - code: - description: 消息码 - type: integer - data: - description: 附加信息 - msg: - description: 消息提示 - type: string - type: object - util.Map: - additionalProperties: true - type: object - vo.AliasInfo: - properties: - AliasName: - type: string - type: object - vo.DisHistoryListRes: - properties: - count: - description: 查询数据总条数 - type: integer - list: - description: 数据列表 - items: - $ref: '#/definitions/model.GmDslHistory' - type: array - type: object - vo.EsLink: - properties: - create_by_id: - type: integer - create_by_user_name: - type: string - created: - type: string - es_link_configs: - items: - $ref: '#/definitions/vo.EsLinkConfig' - type: array - id: - type: integer - ip: - type: string - remark: - type: string - updated: - type: string - version: - type: integer - type: object - vo.EsLinkConfig: - properties: - certpem: - type: string - cfg_relation_id: - type: integer - created: - type: string - es_link_id: - type: integer - id: - type: integer - ip: - type: string - keypem: - type: string - pwd: - type: string - remark: - type: string - rootpem: - type: string - share_roles: - items: - type: string - type: array - updated: - type: string - user: - type: string - version: - type: integer - type: object - vo.EsLinkOpt: - properties: - id: - type: integer - remark: - type: string - type: object - vo.GmOperaterLog: - properties: - body_str: - type: string - created: - type: string - id: - type: integer - method: - type: string - operater_action: - type: string - operater_id: - type: integer - operater_name: - type: string - operater_role_id: - type: integer - type: object - vo.Snapshot: - properties: - duration: - type: string - end_epoch: - type: string - end_time: - type: string - failed_shards: - type: string - id: - type: string - indices: - type: string - start_epoch: - type: string - start_time: - type: string - status: - type: string - successful_shards: - type: string - total_shards: - type: string - type: object - vo.SnapshotDetail: - properties: - snapshots: - items: - properties: - duration_in_millis: - type: integer - end_time: - type: string - end_time_in_millis: - type: integer - failures: - items: {} - type: array - include_global_state: - type: boolean - indices: - items: - type: string - type: array - shards: - properties: - failed: - type: integer - successful: - type: integer - total: - type: integer - type: object - snapshot: - type: string - start_time: - type: string - start_time_in_millis: - type: integer - state: - type: string - uuid: - type: string - version: - type: string - version_id: - type: integer - type: object - type: array - type: object - vo.SnapshotRepository: - properties: - settings: - $ref: '#/definitions/vo.SnapshotRepositorySettings' - type: - type: string - type: object - vo.SnapshotRepositoryList: - properties: - list: - items: - $ref: '#/definitions/vo.Snashot' - type: array - pathRepo: - items: {} - type: array - res: - additionalProperties: - $ref: '#/definitions/vo.SnapshotRepository' - type: object - type: object - vo.SnapshotRepositorySettings: - properties: - compress: - type: string - location: - type: string - max_restore_bytes_per_sec: - type: string - max_snapshot_bytes_per_sec: - type: string - readonly: - type: string - type: object - vo.Snashot: - properties: - chunk_size: - type: string - compress: - type: string - location: - type: string - max_restore_bytes_per_sec: - type: string - max_snapshot_bytes_per_sec: - type: string - name: - type: string - readonly: - type: string - type: - type: string - type: object - vo.SqlToDsl: - properties: - dsl: - type: string - tableName: - type: string - type: object - vo.Status: - properties: - status: - type: string - type: object - vo.TaskInfo: - properties: - action: - type: string - cancellable: - type: boolean - description: - description: same as Status - headers: - additionalProperties: - type: string - type: object - id: - description: the task id (yes, this is a long in the Java source) - type: integer - node: - type: string - parent_task_id: - description: like "YxJnVYjwSBm_AUbzddTajQ:12356" - type: string - running_time: - type: string - running_time_in_nanos: - type: integer - start_time: - type: string - start_time_in_millis: - type: integer - status: - description: has separate implementations of Task.Status in Java for reindexing, - replication, and "RawTaskStatus" - type: - type: string - type: object - vo.User: - properties: - token: - type: string - unix_time: - type: integer - type: object -info: - contact: - email: 1340691923@qq.com - name: 肖文龙 - url: http://www.elastic-view.cn/suporrt.html - description: 励志成为陪伴你一生的elasticsearch可视化客户端 - license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - title: ElasticView -paths: - /api/backUp/CleanupeRepositoryAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CleanupeRepository' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 清理快照仓库 - tags: - - 快照 - /api/backUp/CreateSnapshotAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CreateSnapshot' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 创建快照 - tags: - - 快照 - /api/backUp/SnapshotCreateRepositoryAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotCreateRepository' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 新建快照仓库 - tags: - - 快照 - /api/backUp/SnapshotDeleteAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotDelete' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 删除快照 - tags: - - 快照 - /api/backUp/SnapshotDeleteRepositoryAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotDeleteRepository' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 删除快照仓库 - tags: - - 快照 - /api/backUp/SnapshotDetailAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotDetail' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.SnapshotDetail' - summary: 快照详情 - tags: - - 快照 - /api/backUp/SnapshotListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotList' - produces: - - application/json - responses: - "0": - description: "" - schema: - items: - $ref: '#/definitions/vo.Snapshot' - type: array - summary: 快照列表 - tags: - - 快照 - /api/backUp/SnapshotRepositoryListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsSnapshotInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.SnapshotRepositoryList' - summary: 快照仓库列表 - tags: - - 快照 - /api/backUp/SnapshotRestoreAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotRestore' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 将索引恢复至快照时状态 - tags: - - 快照 - /api/backUp/SnapshotStatusAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SnapshotStatus' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 得到快照状态 - tags: - - 快照 - /api/dslHistory/CleanAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 清空DSL查询记录 - tags: - - DSL查询记录 - /api/dslHistory/ListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.DslHistoryListReq' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.DisHistoryListRes' - summary: 查询DSL查询记录接口 - tags: - - DSL查询记录 - /api/es/CatAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsCat' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: es的cat操作 - tags: - - ES - /api/es/PingAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/model.EsConnect' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 测试es连接 - tags: - - ES - /api/es/RecoverCanWrite: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsConnectID' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 将索引恢复为可写状态 由于不可抗力,ES禁止写后,默认不会自动恢复 - tags: - - ES - /api/es/RunDslGetAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsRest' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 发送DELETE请求到es - tags: - - ES - /api/es/RunDslHeadAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsRest' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 发送HEAD请求到es - tags: - - ES - /api/es/RunDslPUTAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsRest' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 发送PUT请求到es - tags: - - ES - /api/es/RunDslPostAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsRest' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 发送POST请求到es - tags: - - ES - /api/es/SqlToDslAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.SqlToDsl' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.SqlToDsl' - summary: SQL 转换为 DSL - tags: - - ES - /api/es_crud/Download: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CrudFilter' - produces: - - application/json - responses: {} - summary: 下载navicat查询excel - tags: - - 可视化筛选 - /api/es_crud/GetDSL: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CrudFilter' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/navicat_service.Search' - summary: 可视化GetDSL - tags: - - 可视化筛选 - /api/es_crud/GetList: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CrudFilter' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 可视化筛选获取数据 - tags: - - 可视化筛选 - /api/es_doc/DeleteRowByIDAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsDocDeleteRowByID' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 删除文档数据 - tags: - - es文档 - /api/es_doc/InsertAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsDocUpdateByID' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 新增文档 - tags: - - es文档 - /api/es_doc/UpdateByIDAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsDocUpdateByID' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 修改文档 - tags: - - es文档 - /api/es_index/AddAliasToIndex: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsAliasInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 新增别名到索引 - tags: - - es索引 - /api/es_index/BatchAddAliasToIndex: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsAliasInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 批量新增别名到索引 - tags: - - es索引 - /api/es_index/CacheClear: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 清理索引缓存 - tags: - - es索引 - /api/es_index/Close: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 关闭索引 - tags: - - es索引 - /api/es_index/CreateAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsIndexInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 创建索引 - tags: - - es索引 - /api/es_index/DeleteAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.DeleteEsLink' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 删除es连接 - tags: - - es连接信息 - /api/es_index/Empty: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 清空索引 - tags: - - es索引 - /api/es_index/Flush: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 将所有索引刷新到磁盘 - tags: - - es索引 - /api/es_index/Forcemerge: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 强制合并索引 - tags: - - es索引 - /api/es_index/GetAliasAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsAliasInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.AliasInfo' - summary: 获取别名 - tags: - - es索引 - /api/es_index/GetSettingsAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsIndexInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 获取索引配置信息 - tags: - - es索引 - /api/es_index/GetSettingsInfoAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsIndexInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 获取所有的索引配置信息 - tags: - - es索引 - /api/es_index/IndexNamesAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsConnectID' - produces: - - application/json - responses: - "0": - description: "" - schema: - items: - type: string - type: array - summary: 得到所有的索引名 - tags: - - es索引 - /api/es_index/IndexsCountAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsConnectID' - produces: - - application/json - responses: - "0": - description: "" - schema: - type: integer - summary: 得到所有的索引数量 - tags: - - es索引 - /api/es_index/InsertAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.InsertEsLink' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 新增连接信息 - tags: - - es连接信息 - /api/es_index/MoveAliasToIndex: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsAliasInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 移动别名到索引 - tags: - - es索引 - /api/es_index/Open: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 开启索引 - tags: - - es索引 - /api/es_index/Refresh: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsOptimize' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 刷新索引 - tags: - - es索引 - /api/es_index/ReindexAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsReIndexInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 重建索引 - tags: - - es索引 - /api/es_index/RemoveAlias: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsAliasInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 移除别名 - tags: - - es索引 - /api/es_index/StatsAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsIndexInfo' - produces: - - application/json - responses: - "0": - description: "" - schema: - items: - $ref: '#/definitions/vo.Status' - type: array - summary: 获取索引的Stats - tags: - - es索引 - /api/es_index/UpdateAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.UpdateEsLink' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 修改连接信息 - tags: - - es连接信息 - /api/es_link/ListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - produces: - - application/json - responses: - "0": - description: "" - schema: - items: - $ref: '#/definitions/vo.EsLink' - type: array - summary: 获取Es连接列表 - tags: - - es连接信息 - /api/es_link/OptAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - produces: - - application/json - responses: - "0": - description: "" - schema: - items: - $ref: '#/definitions/vo.EsLinkOpt' - type: array - summary: 查看ES连接配置下拉选 - tags: - - es连接信息 - /api/es_map/ListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.EsMapGetProperties' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: Es 映射列表 - tags: - - es映射 - /api/es_map/UpdateMappingAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.UpdateMapping' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 修改Es映射 - tags: - - es映射 - /api/es_task/CancelAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.CancelTask' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/response.ResponseData' - summary: 取消ES任务 - tags: - - es任务 - /api/es_task/ListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.TaskList' - produces: - - application/json - responses: - "0": - description: "" - schema: - additionalProperties: - $ref: '#/definitions/vo.TaskInfo' - type: object - summary: Es任务列表 - tags: - - es任务 - /api/gm_user/login: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.User' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.User' - summary: EV用户登录 - /api/operater_log/ListAction: - post: - consumes: - - application/json - parameters: - - description: 用户令牌 - in: header - name: X-Token - type: string - - description: 查询参数 - in: body - name: object - schema: - $ref: '#/definitions/dto.GmOperaterLogList' - produces: - - application/json - responses: - "0": - description: "" - schema: - $ref: '#/definitions/vo.GmOperaterLog' - summary: 查看后台操作日志 - tags: - - ev后台操作日志 -swagger: "2.0" diff --git a/generate.go b/generate.go index 3d059ce..f3310b0 100644 --- a/generate.go +++ b/generate.go @@ -1,8 +1,8 @@ package main -//go:generate go build -o build.exe cmd/build_ev/main.go +//go:generate go install github.com/1340691923/ElasticView/cmd/ev_builder/ -//go:generate build.exe +//go:generate ev_builder.exe //go:generate swag init -g cmd/ev/main.go -o resources/docs -exclude resources,logs,config diff --git a/pkg/api/ws_controller.go b/pkg/api/ws_controller.go deleted file mode 100644 index ff3ef9f..0000000 --- a/pkg/api/ws_controller.go +++ /dev/null @@ -1,48 +0,0 @@ -package api - -import ( - "github.com/1340691923/ElasticView/pkg/infrastructure/config" - "github.com/1340691923/ElasticView/pkg/infrastructure/jwt_svr" - "github.com/1340691923/ElasticView/pkg/infrastructure/logger" - "github.com/1340691923/ElasticView/pkg/infrastructure/sqlstore" - "github.com/1340691923/ElasticView/pkg/services/ws_service" - "github.com/gin-gonic/gin" - "github.com/gorilla/websocket" - "log" - "net/http" -) - -var upgrader = websocket.Upgrader{ - CheckOrigin: func(r *http.Request) bool { - return true - }, -} - -type WsController struct { - log *logger.AppLogger - cfg *config.Config - orm *sqlstore.SqlStore - jwtSvr *jwt_svr.Jwt - wsService *ws_service.WsService -} - -func NewWsController(log *logger.AppLogger, cfg *config.Config, orm *sqlstore.SqlStore, jwtSvr *jwt_svr.Jwt, wsService *ws_service.WsService) *WsController { - return &WsController{log: log, cfg: cfg, orm: orm, jwtSvr: jwtSvr, wsService: wsService} -} - -func (this *WsController) WsAction(ctx *gin.Context) { - c, err := upgrader.Upgrade(ctx.Writer, ctx.Request, nil) - if err != nil { - log.Print("upgrade:", err) - this.log.Sugar().Errorf("err", err) - return - } - defer c.Close() - /*cliams, err := this.jwtSvr.ParseToken(util.GetToken(ctx)) - if err != nil { - this.log.Sugar().Errorf("err", err) - - return - }*/ - this.wsService.InitConnect(c, ctx, 1, 1) -} diff --git a/pkg/infrastructure/es_sdk/pkg/factory/factory.go b/pkg/infrastructure/es_sdk/pkg/factory/factory.go index 66aa362..6fb0371 100644 --- a/pkg/infrastructure/es_sdk/pkg/factory/factory.go +++ b/pkg/infrastructure/es_sdk/pkg/factory/factory.go @@ -44,49 +44,3 @@ func VersionErr() error { return fmt.Errorf("暂只支持(%s)", strings.Join(datasources, ",")) } -package factory - -import ( - "fmt" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/clickhouse" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/mongo" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/mysql" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/postgresql" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/proto" - "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/redis" - v6 "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/v6" - v7 "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/v7" - v8 "github.com/1340691923/ElasticView/pkg/infrastructure/es_sdk/pkg/v8" - "github.com/1340691923/eve-plugin-sdk-go/ev_api/pkg" - "strings" -) - -var EsServiceMap = map[string]func(cfg *proto.Config) (pkg.ClientInterface, error){ - "elasticsearch6.x": v6.NewEsClient6, - "elasticsearch7.x": v7.NewEsClient7, - "elasticsearch8.x": v8.NewEsClient8, - "mysql": mysql.NewMysqlClient, - "redis": redis.NewRedisClient, - "clickhouse": clickhouse.NewClickhouseClient, - "postgres": postgresql.NewPostgresqlClient, - "mongo": mongo.NewMongoClient, -} - -func NewEsService(cfg *proto.Config) (pkg.ClientInterface, error) { - var found bool - var fn func(cfg *proto.Config) (pkg.ClientInterface, error) - if fn, found = EsServiceMap[cfg.Version]; !found { - return nil, VersionErr() - } - fn = EsServiceMap[cfg.Version] - return fn(cfg) -} - -func VersionErr() error { - datasources := []string{} - for key := range EsServiceMap { - datasources = append(datasources, key) - } - - return fmt.Errorf("暂只支持(%s)", strings.Join(datasources, ",")) -} diff --git a/pkg/util/encoding_test.go b/pkg/util/encoding_test.go deleted file mode 100644 index 4bb5f34..0000000 --- a/pkg/util/encoding_test.go +++ /dev/null @@ -1,132 +0,0 @@ -package util - -import ( - "strings" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestGetBasicAuthHeader_Encoding(t *testing.T) { - t.Run("generating base64 header", func(t *testing.T) { - result := GetBasicAuthHeader("grafana", "1234") - assert.Equal(t, "Basic Z3JhZmFuYToxMjM0", result) - }) - - t.Run("decoding basic auth header", func(t *testing.T) { - header := GetBasicAuthHeader("grafana", "1234") - username, password, err := DecodeBasicAuthHeader(header) - require.NoError(t, err) - - assert.Equal(t, "grafana", username) - assert.Equal(t, "1234", password) - }) -} - -func TestEncodePassword(t *testing.T) { - encodedPassword, err := EncodePassword("iamgod", "pepper") - require.NoError(t, err) - assert.Equal( - t, - "e59c568621e57756495a468f47c74e07c911b037084dd464bb2ed72410970dc849cabd71b48c394faf08a5405dae53741ce9", - encodedPassword, - ) -} - -func TestDecodeQuotedPrintable(t *testing.T) { - t.Run("should return not encoded string as is", func(t *testing.T) { - testStrings := []struct { - in string - out string - }{ - {"", ""}, - {"munich", "munich"}, - {" munich", " munich"}, - {"munich gothenburg", "munich gothenburg"}, - {"München", "München"}, - {"München Göteborg", "München Göteborg"}, - } - - for _, str := range testStrings { - val := DecodeQuotedPrintable(str.in) - assert.Equal(t, str.out, val) - } - }) - - t.Run("should decode encoded string", func(t *testing.T) { - testStrings := []struct { - in string - out string - }{ - {"M=C3=BCnchen", "München"}, - {"M=C3=BCnchen G=C3=B6teborg", "München Göteborg"}, - {"=E5=85=AC=E5=8F=B8", "公司"}, - } - - for _, str := range testStrings { - val := DecodeQuotedPrintable(str.in) - assert.Equal(t, str.out, val) - } - }) - - t.Run("should preserve meaningful whitespace", func(t *testing.T) { - testStrings := []struct { - in string - out string - }{ - {" ", ""}, - {" =", " "}, - {" munich gothenburg", " munich gothenburg"}, - {" munich gothenburg ", " munich gothenburg"}, - {" munich gothenburg =", " munich gothenburg "}, - {" munich\tgothenburg\t \t", " munich\tgothenburg"}, - {" munich\t gothenburg\t \t=", " munich\t gothenburg\t \t"}, - } - - for _, str := range testStrings { - val := DecodeQuotedPrintable(str.in) - assert.Equal(t, str.out, val) - } - }) - - t.Run("should gracefully ignore invalid encoding sequences", func(t *testing.T) { - testStrings := []struct { - in string - out string - }{ - {"=XY=ZZ", "=XY=ZZ"}, - {"==58", "=X"}, - {"munich = gothenburg", "munich = gothenburg"}, - {"munich == tromso", "munich == tromso"}, - } - - for _, str := range testStrings { - val := DecodeQuotedPrintable(str.in) - assert.Equal(t, str.out, val) - } - }) - - t.Run("should return invalid UTF-8 sequences as is", func(t *testing.T) { - testStrings := []struct { - in string - out string - }{ - {"=E5 =85=AC =E5=8F =B8", "\xE5 \x85\xAC \xE5\x8F \xB8"}, - {"=00=00munich=FF=FF", "\x00\x00munich\xFF\xFF"}, - } - - for _, str := range testStrings { - val := DecodeQuotedPrintable(str.in) - assert.Equal(t, str.out, val) - } - }) - - t.Run("should support long strings", func(t *testing.T) { - str_in := strings.Repeat(" M=C3=BCnchen", 128) - str_out := strings.Repeat(" München", 128) - - val := DecodeQuotedPrintable(str_in) - assert.Equal(t, str_out, val) - }) -} diff --git a/pkg/util/encryption_test.go b/pkg/util/encryption_test.go deleted file mode 100644 index 48f6d7f..0000000 --- a/pkg/util/encryption_test.go +++ /dev/null @@ -1,49 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestEncryption(t *testing.T) { - t.Run("getting encryption key", func(t *testing.T) { - key, err := encryptionKeyToBytes("secret", "salt") - require.NoError(t, err) - assert.Len(t, key, 32) - - key, err = encryptionKeyToBytes("a very long secret key that is larger then 32bytes", "salt") - require.NoError(t, err) - assert.Len(t, key, 32) - }) - - t.Run("decrypting basic payload", func(t *testing.T) { - encrypted, err := Encrypt([]byte("grafana"), "1234") - require.NoError(t, err) - - decrypted, err := Decrypt(encrypted, "1234") - require.NoError(t, err) - - assert.Equal(t, []byte("grafana"), decrypted) - }) - - t.Run("decrypting empty payload should fail", func(t *testing.T) { - _, err := Decrypt([]byte(""), "1234") - require.Error(t, err) - - assert.Equal(t, "unable to derive encryption algorithm", err.Error()) - }) - - t.Run("decrypting secrets with algorithm metadata", func(t *testing.T) { - // Slice of bytes that corresponds to the following legacy ciphertext: - // - 'my very secret secret key' as a payload - // - '1234' as a secret - // - 'aes-cfb' as an encryption algorithm - // Has algorithm prefix - encrypted := []byte{0x2a, 0x59, 0x57, 0x56, 0x7a, 0x4c, 0x57, 0x4e, 0x6d, 0x59, 0x67, 0x2a, 0x7a, 0x35, 0x64, 0x57, 0x64, 0x37, 0x6b, 0x38, 0x77, 0x9a, 0xda, 0x7a, 0x1a, 0x24, 0x42, 0x22, 0x5f, 0x3d, 0x2e, 0xf, 0xd2, 0xad, 0x53, 0xa6, 0x69, 0x61, 0x5a, 0xe1, 0x9c, 0xc3, 0xda, 0x13, 0x80, 0xdc, 0x3e, 0x87, 0x49, 0xbf, 0xe7, 0x2d, 0xc1, 0x8f, 0x48, 0x26, 0x45, 0xe8, 0x1b, 0xe7, 0x51} - decrypted, err := Decrypt(encrypted, "1234") - require.NoError(t, err) - assert.Equal(t, "my very secret secret key", string(decrypted)) - }) -} diff --git a/pkg/util/excel.go b/pkg/util/excel.go deleted file mode 100644 index 3844cfd..0000000 --- a/pkg/util/excel.go +++ /dev/null @@ -1,70 +0,0 @@ -package util - -import ( - "github.com/360EntSecGroup-Skylar/excelize" - "strconv" -) - -// maxCharCount 最多26个字符A-Z -const maxCharCount = 26 - -// ExportExcel 导出Excel文件 -// sheetName 工作表名称, 注意这里不要取sheet1这种名字,否则导致文件打开时发生部分错误。 -// headers 列名切片, 表头 -// rows 数据切片,是一个二维数组 -func ExportExcel(sheetName string, headers []string, rows [][]interface{}) (*excelize.File, error) { - f := excelize.NewFile() - sheetIndex := f.NewSheet(sheetName) - maxColumnRowNameLen := 1 + len(strconv.Itoa(len(rows))) - columnCount := len(headers) - if columnCount > maxCharCount { - maxColumnRowNameLen++ - } else if columnCount > maxCharCount*maxCharCount { - maxColumnRowNameLen += 2 - } - columnNames := make([][]byte, 0, columnCount) - for i, header := range headers { - columnName := getColumnName(i, maxColumnRowNameLen) - columnNames = append(columnNames, columnName) - // 初始化excel表头,这里的index从1开始要注意 - curColumnName := getColumnRowName(columnName, 1) - f.SetCellValue(sheetName, curColumnName, header) - - } - for rowIndex, row := range rows { - for columnIndex, columnName := range columnNames { - // 从第二行开始 - f.SetCellValue(sheetName, getColumnRowName(columnName, rowIndex+2), row[columnIndex]) - } - } - f.SetActiveSheet(sheetIndex) - return f, nil -} - -// getColumnName 生成列名 -// Excel的列名规则是从A-Z往后排;超过Z以后用两个字母表示,比如AA,AB,AC;两个字母不够以后用三个字母表示,比如AAA,AAB,AAC -// 这里做数字到列名的映射:0 -> A, 1 -> B, 2 -> C -// maxColumnRowNameLen 表示名称框的最大长度,假设数据是10行,1000列,则最后一个名称框是J1000(如果有表头,则是J1001),是4位 -// 这里根据 maxColumnRowNameLen 生成切片,后面生成名称框的时候可以复用这个切片,而无需扩容 -func getColumnName(column, maxColumnRowNameLen int) []byte { - const A = 'A' - if column < maxCharCount { - // 第一次就分配好切片的容量 - slice := make([]byte, 0, maxColumnRowNameLen) - return append(slice, byte(A+column)) - } else { - // 递归生成类似AA,AB,AAA,AAB这种形式的列名 - return append(getColumnName(column/maxCharCount-1, maxColumnRowNameLen), byte(A+column%maxCharCount)) - } -} - -// getColumnRowName 生成名称框 -// Excel的名称框是用A1,A2,B1,B2来表示的,这里需要传入前一步生成的列名切片,然后直接加上行索引来生成名称框,就无需每次分配内存 -func getColumnRowName(columnName []byte, rowIndex int) (columnRowName string) { - l := len(columnName) - columnName = strconv.AppendInt(columnName, int64(rowIndex), 10) - columnRowName = string(columnName) - // 将列名恢复回去 - columnName = columnName[:l] - return -} diff --git a/pkg/util/filepath_test.go b/pkg/util/filepath_test.go deleted file mode 100644 index 38116c5..0000000 --- a/pkg/util/filepath_test.go +++ /dev/null @@ -1,37 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestCleanRelativePath(t *testing.T) { - testcases := []struct { - input string - expectedPath string - }{ - { - input: "", - expectedPath: ".", - }, - { - input: "/test/test.txt", - expectedPath: "test/test.txt", - }, - { - input: "../../test/test.txt", - expectedPath: "test/test.txt", - }, - { - input: "./../test/test.txt", - expectedPath: "test/test.txt", - }, - } - - for _, tt := range testcases { - path, err := CleanRelativePath(tt.input) - assert.NoError(t, err) - assert.Equal(t, tt.expectedPath, path) - } -} diff --git a/pkg/util/ip_address_test.go b/pkg/util/ip_address_test.go deleted file mode 100644 index 6325fb1..0000000 --- a/pkg/util/ip_address_test.go +++ /dev/null @@ -1,34 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestSplitHostPortDefault_Valid(t *testing.T) { - tests := []struct { - input string - defaultHost string - defaultPort string - - host string - port string - }{ - {input: "192.168.0.140:456", defaultHost: "", defaultPort: "", host: "192.168.0.140", port: "456"}, - {input: "192.168.0.140", defaultHost: "", defaultPort: "123", host: "192.168.0.140", port: "123"}, - {input: "[::1]:456", defaultHost: "", defaultPort: "", host: "::1", port: "456"}, - {input: "[::1]", defaultHost: "", defaultPort: "123", host: "::1", port: "123"}, - {input: ":456", defaultHost: "1.2.3.4", defaultPort: "", host: "1.2.3.4", port: "456"}, - {input: "xyz.rds.amazonaws.com", defaultHost: "", defaultPort: "123", host: "xyz.rds.amazonaws.com", port: "123"}, - {input: "xyz.rds.amazonaws.com:123", defaultHost: "", defaultPort: "", host: "xyz.rds.amazonaws.com", port: "123"}, - {input: "", defaultHost: "localhost", defaultPort: "1433", host: "localhost", port: "1433"}, - } - - for _, testcase := range tests { - addr, err := SplitHostPortDefault(testcase.input, testcase.defaultHost, testcase.defaultPort) - assert.NoError(t, err) - assert.Equal(t, testcase.host, addr.Host) - assert.Equal(t, testcase.port, addr.Port) - } -} diff --git a/pkg/util/md5_test.go b/pkg/util/md5_test.go deleted file mode 100644 index 43c685b..0000000 --- a/pkg/util/md5_test.go +++ /dev/null @@ -1,17 +0,0 @@ -package util - -import "testing" - -func TestMd5Sum(t *testing.T) { - input := "don't hash passwords with md5" - - have, err := Md5SumString(input) - if err != nil { - t.Fatal("expected err to be nil") - } - - want := "dd1f7fdb3466c0d09c2e839d1f1530f8" - if have != want { - t.Fatalf("expected: %s got: %s", want, have) - } -} diff --git a/pkg/util/shortid_generator.go b/pkg/util/shortid_generator.go deleted file mode 100644 index 767ea1a..0000000 --- a/pkg/util/shortid_generator.go +++ /dev/null @@ -1,31 +0,0 @@ -package util - -import ( - "regexp" - - "github.com/teris-io/shortid" -) - -var allowedChars = shortid.DefaultABC - -var validUIDPattern = regexp.MustCompile(`^[a-zA-Z0-9\-\_]*$`).MatchString - -func init() { - gen, _ := shortid.New(1, allowedChars, 1) - shortid.SetDefault(gen) -} - -// IsValidShortUID checks if short unique identifier contains valid characters -func IsValidShortUID(uid string) bool { - return validUIDPattern(uid) -} - -// IsShortUIDTooLong checks if short unique identifier is too long -func IsShortUIDTooLong(uid string) bool { - return len(uid) > 40 -} - -// GenerateShortUID generates a short unique identifier. -func GenerateShortUID() string { - return shortid.MustGenerate() -} diff --git a/pkg/util/shortid_generator_test.go b/pkg/util/shortid_generator_test.go deleted file mode 100644 index 2e0fc0c..0000000 --- a/pkg/util/shortid_generator_test.go +++ /dev/null @@ -1,45 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/require" -) - -func TestAllowedCharMatchesUidPattern(t *testing.T) { - for _, c := range allowedChars { - if !IsValidShortUID(string(c)) { - t.Fatalf("charset for creating new shortids contains chars not present in uid pattern") - } - } -} - -func TestIsShortUIDTooLong(t *testing.T) { - var tests = []struct { - name string - uid string - expected bool - }{ - { - name: "when the length of uid is longer than 40 chars then IsShortUIDTooLong should return true", - uid: allowedChars, - expected: true, - }, - { - name: "when the length of uid is equal too 40 chars then IsShortUIDTooLong should return false", - uid: "0123456789012345678901234567890123456789", - expected: false, - }, - { - name: "when the length of uid is shorter than 40 chars then IsShortUIDTooLong should return false", - uid: "012345678901234567890123456789012345678", - expected: false, - }, - } - - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - require.Equal(t, tt.expected, IsShortUIDTooLong(tt.uid)) - }) - } -} diff --git a/pkg/util/split_email_test.go b/pkg/util/split_email_test.go deleted file mode 100644 index 4da7724..0000000 --- a/pkg/util/split_email_test.go +++ /dev/null @@ -1,52 +0,0 @@ -package util - -import ( - "testing" - - "github.com/stretchr/testify/assert" -) - -func TestSplitEmails(t *testing.T) { - testcases := []struct { - input string - expected []string - }{ - { - input: "", - expected: []string{}, - }, - { - input: "ops@grafana.org", - expected: []string{"ops@grafana.org"}, - }, - { - input: "ops@grafana.org;dev@grafana.org", - expected: []string{"ops@grafana.org", "dev@grafana.org"}, - }, - { - input: "ops@grafana.org;dev@grafana.org,", - expected: []string{"ops@grafana.org", "dev@grafana.org"}, - }, - { - input: "dev@grafana.org,ops@grafana.org", - expected: []string{"dev@grafana.org", "ops@grafana.org"}, - }, - { - input: "dev@grafana.org,ops@grafana.org,", - expected: []string{"dev@grafana.org", "ops@grafana.org"}, - }, - { - input: "dev@grafana.org\nops@grafana.org", - expected: []string{"dev@grafana.org", "ops@grafana.org"}, - }, - { - input: "dev@grafana.org\nops@grafana.org\n", - expected: []string{"dev@grafana.org", "ops@grafana.org"}, - }, - } - - for _, tt := range testcases { - emails := SplitEmails(tt.input) - assert.Equal(t, tt.expected, emails) - } -} diff --git a/pkg/util/sql.go b/pkg/util/sql.go deleted file mode 100644 index b0be8f9..0000000 --- a/pkg/util/sql.go +++ /dev/null @@ -1,23 +0,0 @@ -package util - -import ( - "github.com/pkg/errors" - "github.com/xwb1989/sqlparser" -) - -func ExtractTableName(sql string) ([]string, error) { - stmt, err := sqlparser.Parse(sql) - if err != nil { - return nil, errors.WithStack(err) - } - tableNames := make([]string, 0) - err = sqlparser.Walk(func(node sqlparser.SQLNode) (kontinue bool, err error) { - switch node := node.(type) { - case sqlparser.TableName: - tableNames = append(tableNames, node.Name.CompliantName()) - } - return true, nil - }, stmt) - - return tableNames, err -} diff --git a/pkg/util/strings_test.go b/pkg/util/strings_test.go deleted file mode 100644 index efb3dbb..0000000 --- a/pkg/util/strings_test.go +++ /dev/null @@ -1,154 +0,0 @@ -package util - -import ( - "testing" - "time" - - "github.com/stretchr/testify/assert" -) - -func TestStringsFallback2(t *testing.T) { - tests := []struct { - val1 string - val2 string - expected string - }{ - // testing every scenario - {"", "", ""}, - {"1", "", "1"}, - {"1", "2", "1"}, - {"", "2", "2"}, - } - for _, testcase := range tests { - assert.EqualValues(t, testcase.expected, StringsFallback2(testcase.val1, testcase.val2)) - } -} - -func TestStringsFallback3(t *testing.T) { - tests := []struct { - val1 string - val2 string - val3 string - expected string - }{ - {"", "", "", ""}, - {"1", "", "", "1"}, - {"1", "2", "", "1"}, - {"1", "2", "3", "1"}, - {"", "2", "", "2"}, - {"", "2", "3", "2"}, - {"", "", "3", "3"}, - } - for _, testcase := range tests { - assert.EqualValues(t, testcase.expected, StringsFallback3(testcase.val1, testcase.val2, testcase.val3)) - } -} - -func TestSplitString(t *testing.T) { - tests := map[string][]string{ - "": {}, - "test": {"test"}, - "test1 test2 test3": {"test1", "test2", "test3"}, - "test1,test2,test3": {"test1", "test2", "test3"}, - "test1, test2, test3": {"test1", "test2", "test3"}, - "test1 , test2 test3": {"test1", "test2", "test3"}, - } - for input, expected := range tests { - assert.EqualValues(t, expected, SplitString(input)) - } -} - -func BenchmarkSplitString(b *testing.B) { - b.Run("empty input", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("") - } - }) - b.Run("single string", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test") - } - }) - b.Run("space-separated", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test1 test2 test3") - } - }) - b.Run("comma-separated", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test1,test2,test3") - } - }) - b.Run("comma-separated with spaces", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test1 , test2 test3") - } - }) - b.Run("mixed commas and spaces", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test1 , test2 test3,test4") - } - }) - b.Run("very long mixed", func(b *testing.B) { - for i := 0; i < b.N; i++ { - SplitString("test1 , test2 test3,test4, test5 test6 test7,test8 test9 test10" + - " test11 test12 test13,test14 test15 test16,test17 test18 test19,test20 test21 test22" + - " test23,test24 test25 test26,test27 test28 test29,test30 test31 test32" + - " test33,test34 test35 test36,test37 test38 test39,test40 test41 test42" + - " test43,test44 test45 test46,test47 test48 test49,test50 test51 test52" + - " test53,test54 test55 test56,test57 test58 test59,test60 test61 test62" + - " test63,test64 test65 test66,test67 test68 test69,test70 test71 test72" + - " test73,test74 test75 test76,test77 test78 test79,test80 test81 test82" + - " test83,test84 test85 test86,test87 test88 test89,test90 test91 test92" + - " test93,test94 test95 test96,test97 test98 test99,test100 ") - } - }) -} - -func TestDateAge(t *testing.T) { - assert.Equal(t, "?", GetAgeString(time.Time{})) // base case - - tests := map[time.Duration]string{ - -1 * time.Hour: "< 1 minute", // one hour in the future - 0: "< 1 minute", - 2 * time.Second: "< 1 minute", - 2 * time.Minute: "2 minutes", - 2 * time.Hour: "2 hours", - 3 * 24 * time.Hour: "3 days", - 67 * 24 * time.Hour: "2 months", - 409 * 24 * time.Hour: "1 year", - } - for elapsed, expected := range tests { - assert.Equalf( - t, - expected, - GetAgeString(time.Now().Add(-elapsed)), - "duration '%s'", - elapsed.String(), - ) - } -} - -func TestToCamelCase(t *testing.T) { - tests := map[string]string{ - "kebab-case-string": "kebabCaseString", - "snake_case_string": "snakeCaseString", - "mixed-case_string": "mixedCaseString", - "alreadyCamelCase": "alreadyCamelCase", - "": "", - } - for input, expected := range tests { - assert.Equal(t, expected, ToCamelCase(input)) - } -} - -func TestCapitalize(t *testing.T) { - tests := map[string]string{ - "properly capitalizes": "Properly capitalizes", - "Already capitalized": "Already capitalized", - "": "", - } - for input, expected := range tests { - assert.Equal(t, expected, Capitalize(input)) - } -} diff --git a/pkg/util/token.go b/pkg/util/token.go index 9a14ee2..74b4a31 100644 --- a/pkg/util/token.go +++ b/pkg/util/token.go @@ -10,7 +10,3 @@ var TokenBucket sync.Map func GetUUid() string { return uuid.New().String() } - -func StringPtr(s string) *string { - return &s -} diff --git a/pkg/util/url_test.go b/pkg/util/url_test.go deleted file mode 100644 index 4c5e713..0000000 --- a/pkg/util/url_test.go +++ /dev/null @@ -1,81 +0,0 @@ -package util - -import ( - "net/url" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestJoinURLFragments(t *testing.T) { - t.Parallel() - - tests := []struct { - description string - base string - path string - expected string - }{ - { - description: "RHS is empty", - base: "http://localhost:8080", - path: "", - expected: "http://localhost:8080", - }, - { - description: "RHS is empty and LHS has trailing slash", - base: "http://localhost:8080/", - path: "", - expected: "http://localhost:8080/", - }, - { - description: "neither has trailing slash", - base: "http://localhost:8080", - path: "api", - expected: "http://localhost:8080/api", - }, - { - description: "LHS has trailing slash", - base: "http://localhost:8080/", - path: "api", - expected: "http://localhost:8080/api", - }, - { - description: "LHS and RHS has trailing slash", - base: "http://localhost:8080/", - path: "api/", - expected: "http://localhost:8080/api/", - }, - { - description: "LHS has trailing slash and RHS has preceding slash", - base: "http://localhost:8080/", - path: "/api/", - expected: "http://localhost:8080/api/", - }, - } - for _, testcase := range tests { - t.Run("where "+testcase.description, func(t *testing.T) { - assert.Equalf( - t, - testcase.expected, - JoinURLFragments(testcase.base, testcase.path), - "base: '%s', path: '%s'", - testcase.base, - testcase.path, - ) - }) - } -} - -func TestNewURLQueryReader(t *testing.T) { - u, err := url.Parse("http://www.abc.com/foo?bar=baz&bar2=baz2") - require.NoError(t, err) - - uqr, err := NewURLQueryReader(u) - require.NoError(t, err) - - assert.Equal(t, "baz", uqr.Get("bar", "foodef"), "first param") - assert.Equal(t, "baz2", uqr.Get("bar2", "foodef"), "second param") - assert.Equal(t, "foodef", uqr.Get("bar3", "foodef"), "non-existing param, use fallback") -} diff --git a/pkg/web/ws.go b/pkg/web/ws.go deleted file mode 100644 index 5fbc10d..0000000 --- a/pkg/web/ws.go +++ /dev/null @@ -1,6 +0,0 @@ -package web - -// ES 任务 路由 -func (this *WebServer) runWs() { - this.engine.GetGinEngine().GET("/ws", this.wsController.WsAction) -} diff --git a/resources/vue/src/layout/components/AppMain/index.vue b/resources/vue/src/layout/components/AppMain/index.vue index b3dc0f6..68bc893 100644 --- a/resources/vue/src/layout/components/AppMain/index.vue +++ b/resources/vue/src/layout/components/AppMain/index.vue @@ -94,6 +94,7 @@ const sendBigModelQuery = async ()=>{ bigModelLoading.value = true let res = await SearchBigMode({content:bigModelInput.value}) if(res.code != 0){ + bigModelLoading.value = false ElMessage.error(res.msg); return }