From e19cec966f0e572f60864ac5bbab147a7f2c0423 Mon Sep 17 00:00:00 2001 From: WinfredLIN Date: Tue, 22 Oct 2024 10:25:36 +0800 Subject: [PATCH] docs: make swagger --- sqle/docs/docs.go | 211 ++++++++++++++++++++++++++++++++++++++++- sqle/docs/swagger.json | 211 ++++++++++++++++++++++++++++++++++++++++- sqle/docs/swagger.yaml | 141 ++++++++++++++++++++++++++- 3 files changed, 560 insertions(+), 3 deletions(-) diff --git a/sqle/docs/docs.go b/sqle/docs/docs.go index 72c98c592..b7268d731 100644 --- a/sqle/docs/docs.go +++ b/sqle/docs/docs.go @@ -8044,6 +8044,54 @@ var doc = `{ } } }, + "/v1/sql_manages/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql统计信息", + "operationId": "GetGlobalSqlManageStatistics", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetGlobalSqlManageStatisticsResp" + } + } + } + } + }, "/v1/statistic/instances/sql_average_execution_time": { "get": { "security": [ @@ -8421,6 +8469,29 @@ var doc = `{ } } }, + "/v1/system/module_red_dots": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the red dot prompt information in the system", + "tags": [ + "system" + ], + "summary": "查询系统各模块的红点提示信息", + "operationId": "GetSystemModuleRedDots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSystemModuleRedDotsRes" + } + } + } + } + }, "/v1/system/module_status": { "get": { "security": [ @@ -9119,6 +9190,78 @@ var doc = `{ } } }, + "/v1/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局工单统计数据", + "operationId": "GetGlobalWorkflowStatistics", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" + } + } + } + } + }, "/v2/audit_files": { "post": { "security": [ @@ -12837,7 +12980,23 @@ var doc = `{ "type": "string", "example": "ok" }, - "total_num": { + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetGlobalSqlManageStatisticsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { "type": "integer" } } @@ -13782,6 +13941,23 @@ var doc = `{ } } }, + "v1.GetSystemModuleRedDotsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ModuleRedDots" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, "v1.GetSystemVariablesResV1": { "type": "object", "properties": { @@ -14284,6 +14460,22 @@ var doc = `{ } } }, + "v1.GlobalWorkflowStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, "v1.HighPriorityConditionReq": { "type": "object", "properties": { @@ -14698,6 +14890,23 @@ var doc = `{ } } }, + "v1.ModuleRedDot": { + "type": "object", + "properties": { + "has_red_dot": { + "type": "boolean" + }, + "module_name": { + "type": "string" + } + } + }, + "v1.ModuleRedDots": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ModuleRedDot" + } + }, "v1.ModuleStatusRes": { "type": "object", "properties": { diff --git a/sqle/docs/swagger.json b/sqle/docs/swagger.json index 7416a94ed..b9e011fd9 100644 --- a/sqle/docs/swagger.json +++ b/sqle/docs/swagger.json @@ -8028,6 +8028,54 @@ } } }, + "/v1/sql_manages/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global sql manage statistics", + "tags": [ + "SqlManage" + ], + "summary": "获取全局管控sql统计信息", + "operationId": "GetGlobalSqlManageStatistics", + "parameters": [ + { + "type": "string", + "description": "project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "instance id", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "project priority", + "name": "filter_project_priority", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetGlobalSqlManageStatisticsResp" + } + } + } + } + }, "/v1/statistic/instances/sql_average_execution_time": { "get": { "security": [ @@ -8405,6 +8453,29 @@ } } }, + "/v1/system/module_red_dots": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get the red dot prompt information in the system", + "tags": [ + "system" + ], + "summary": "查询系统各模块的红点提示信息", + "operationId": "GetSystemModuleRedDots", + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GetSystemModuleRedDotsRes" + } + } + } + } + }, "/v1/system/module_status": { "get": { "security": [ @@ -9103,6 +9174,78 @@ } } }, + "/v1/workflows/statistics": { + "get": { + "security": [ + { + "ApiKeyAuth": [] + } + ], + "description": "get global workflow statistics", + "tags": [ + "workflow" + ], + "summary": "获取全局工单统计数据", + "operationId": "GetGlobalWorkflowStatistics", + "parameters": [ + { + "type": "string", + "description": "filter create user id", + "name": "filter_create_user_id", + "in": "query" + }, + { + "enum": [ + "wait_for_audit", + "wait_for_execution", + "rejected", + "executing", + "canceled", + "exec_failed", + "finished" + ], + "type": "array", + "items": { + "type": "string" + }, + "description": "filter by workflow status,, support using many status", + "name": "filter_status_list", + "in": "query" + }, + { + "type": "string", + "description": "filter by project uid", + "name": "filter_project_uid", + "in": "query" + }, + { + "type": "string", + "description": "filter by instance id in project", + "name": "filter_instance_id", + "in": "query" + }, + { + "enum": [ + "high", + "medium", + "low" + ], + "type": "string", + "description": "filter by project priority", + "name": "filter_project_priority", + "in": "query" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/v1.GlobalWorkflowStatisticsResV1" + } + } + } + } + }, "/v2/audit_files": { "post": { "security": [ @@ -12821,7 +12964,23 @@ "type": "string", "example": "ok" }, - "total_num": { + "total_nums": { + "type": "integer" + } + } + }, + "v1.GetGlobalSqlManageStatisticsResp": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { "type": "integer" } } @@ -13766,6 +13925,23 @@ } } }, + "v1.GetSystemModuleRedDotsRes": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "data": { + "type": "object", + "$ref": "#/definitions/v1.ModuleRedDots" + }, + "message": { + "type": "string", + "example": "ok" + } + } + }, "v1.GetSystemVariablesResV1": { "type": "object", "properties": { @@ -14268,6 +14444,22 @@ } } }, + "v1.GlobalWorkflowStatisticsResV1": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "example": 0 + }, + "message": { + "type": "string", + "example": "ok" + }, + "total_nums": { + "type": "integer" + } + } + }, "v1.HighPriorityConditionReq": { "type": "object", "properties": { @@ -14682,6 +14874,23 @@ } } }, + "v1.ModuleRedDot": { + "type": "object", + "properties": { + "has_red_dot": { + "type": "boolean" + }, + "module_name": { + "type": "string" + } + } + }, + "v1.ModuleRedDots": { + "type": "array", + "items": { + "$ref": "#/definitions/v1.ModuleRedDot" + } + }, "v1.ModuleStatusRes": { "type": "object", "properties": { diff --git a/sqle/docs/swagger.yaml b/sqle/docs/swagger.yaml index fbf433c6a..8a929a6ec 100644 --- a/sqle/docs/swagger.yaml +++ b/sqle/docs/swagger.yaml @@ -1563,7 +1563,18 @@ definitions: message: example: ok type: string - total_num: + total_nums: + type: integer + type: object + v1.GetGlobalSqlManageStatisticsResp: + properties: + code: + example: 0 + type: integer + message: + example: ok + type: string + total_nums: type: integer type: object v1.GetInstanceAuditPlanDetailResV1: @@ -2215,6 +2226,18 @@ definitions: total_nums: type: integer type: object + v1.GetSystemModuleRedDotsRes: + properties: + code: + example: 0 + type: integer + data: + $ref: '#/definitions/v1.ModuleRedDots' + type: object + message: + example: ok + type: string + type: object v1.GetSystemVariablesResV1: properties: code: @@ -2565,6 +2588,17 @@ definitions: - manual_audited type: string type: object + v1.GlobalWorkflowStatisticsResV1: + properties: + code: + example: 0 + type: integer + message: + example: ok + type: string + total_nums: + type: integer + type: object v1.HighPriorityConditionReq: properties: key: @@ -2844,6 +2878,17 @@ definitions: $ref: '#/definitions/v1.TimeResV1' type: object type: object + v1.ModuleRedDot: + properties: + has_red_dot: + type: boolean + module_name: + type: string + type: object + v1.ModuleRedDots: + items: + $ref: '#/definitions/v1.ModuleRedDot' + type: array v1.ModuleStatusRes: properties: is_supported: @@ -10791,6 +10836,37 @@ paths: summary: 获取全局管控sql列表 tags: - SqlManage + /v1/sql_manages/statistics: + get: + description: get global sql manage statistics + operationId: GetGlobalSqlManageStatistics + parameters: + - description: project uid + in: query + name: filter_project_uid + type: string + - description: instance id + in: query + name: filter_instance_id + type: string + - description: project priority + enum: + - high + - medium + - low + in: query + name: filter_project_priority + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v1.GetGlobalSqlManageStatisticsResp' + security: + - ApiKeyAuth: [] + summary: 获取全局管控sql统计信息 + tags: + - SqlManage /v1/statistic/instances/sql_average_execution_time: get: description: get average execution time of sql @@ -11027,6 +11103,20 @@ paths: summary: 获取各种状态工单的数量 tags: - statistic + /v1/system/module_red_dots: + get: + description: get the red dot prompt information in the system + operationId: GetSystemModuleRedDots + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v1.GetSystemModuleRedDotsRes' + security: + - ApiKeyAuth: [] + summary: 查询系统各模块的红点提示信息 + tags: + - system /v1/system/module_status: get: description: get module status for modulealities in the system @@ -11492,6 +11582,55 @@ paths: summary: 获取实例上工单的统计信息 tags: - workflow + /v1/workflows/statistics: + get: + description: get global workflow statistics + operationId: GetGlobalWorkflowStatistics + parameters: + - description: filter create user id + in: query + name: filter_create_user_id + type: string + - description: filter by workflow status,, support using many status + enum: + - wait_for_audit + - wait_for_execution + - rejected + - executing + - canceled + - exec_failed + - finished + in: query + items: + type: string + name: filter_status_list + type: array + - description: filter by project uid + in: query + name: filter_project_uid + type: string + - description: filter by instance id in project + in: query + name: filter_instance_id + type: string + - description: filter by project priority + enum: + - high + - medium + - low + in: query + name: filter_project_priority + type: string + responses: + "200": + description: OK + schema: + $ref: '#/definitions/v1.GlobalWorkflowStatisticsResV1' + security: + - ApiKeyAuth: [] + summary: 获取全局工单统计数据 + tags: + - workflow /v2/audit_files: post: description: Direct audit sql from SQL files and MyBatis files