Skip to content

Commit

Permalink
fix(apigroup): move statistics api to info api group
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Mar 14, 2024
1 parent 5ff09b9 commit 05b0a0a
Show file tree
Hide file tree
Showing 6 changed files with 155 additions and 155 deletions.
118 changes: 59 additions & 59 deletions internal/dashboard/generated/swagger/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,65 +640,6 @@ const docTemplate = `{
}
}
},
"/api/v1/metrics/statistic": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get statistic data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "get statistic data",
"operationId": "GetStatistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/response.StatisticDataResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/obclusters": {
"get": {
"security": [
Expand Down Expand Up @@ -2720,6 +2661,65 @@ const docTemplate = `{
}
}
}
},
"/api/v1/statistics": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get statistic data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "get statistic data",
"operationId": "GetStatistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/response.StatisticDataResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
}
},
"definitions": {
Expand Down
118 changes: 59 additions & 59 deletions internal/dashboard/generated/swagger/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -633,65 +633,6 @@
}
}
},
"/api/v1/metrics/statistic": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get statistic data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "get statistic data",
"operationId": "GetStatistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/response.StatisticDataResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
},
"/api/v1/obclusters": {
"get": {
"security": [
Expand Down Expand Up @@ -2713,6 +2654,65 @@
}
}
}
},
"/api/v1/statistics": {
"get": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "get statistic data",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "get statistic data",
"operationId": "GetStatistics",
"responses": {
"200": {
"description": "OK",
"schema": {
"allOf": [
{
"$ref": "#/definitions/response.APIResponse"
},
{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/response.StatisticDataResponse"
}
}
}
]
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/response.APIResponse"
}
}
}
}
}
},
"definitions": {
Expand Down
70 changes: 35 additions & 35 deletions internal/dashboard/generated/swagger/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1697,41 +1697,6 @@ paths:
summary: query metrics
tags:
- Metric
/api/v1/metrics/statistic:
get:
consumes:
- application/json
description: get statistic data
operationId: GetStatistics
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.APIResponse'
- properties:
data:
$ref: '#/definitions/response.StatisticDataResponse'
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/response.APIResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.APIResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.APIResponse'
security:
- ApiKeyAuth: []
summary: get statistic data
tags:
- Info
/api/v1/obclusters:
get:
consumes:
Expand Down Expand Up @@ -3000,6 +2965,41 @@ paths:
summary: List statistics information of tenants
tags:
- OBTenant
/api/v1/statistics:
get:
consumes:
- application/json
description: get statistic data
operationId: GetStatistics
produces:
- application/json
responses:
"200":
description: OK
schema:
allOf:
- $ref: '#/definitions/response.APIResponse'
- properties:
data:
$ref: '#/definitions/response.StatisticDataResponse'
type: object
"400":
description: Bad Request
schema:
$ref: '#/definitions/response.APIResponse'
"401":
description: Unauthorized
schema:
$ref: '#/definitions/response.APIResponse'
"500":
description: Internal Server Error
schema:
$ref: '#/definitions/response.APIResponse'
security:
- ApiKeyAuth: []
summary: get statistic data
tags:
- Info
securityDefinitions:
ApiKeyAuth:
in: header
Expand Down
2 changes: 1 addition & 1 deletion internal/dashboard/handler/info_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ func GetProcessInfo(_ *gin.Context) (*response.DashboardInfo, error) {
// @Failure 400 object response.APIResponse
// @Failure 401 object response.APIResponse
// @Failure 500 object response.APIResponse
// @Router /api/v1/metrics/statistic [GET]
// @Router /api/v1/statistics [GET]
// @Security ApiKeyAuth
func GetStatistics(c *gin.Context) (*response.StatisticDataResponse, error) {
reportData := response.StatisticData{}
Expand Down
1 change: 1 addition & 0 deletions internal/dashboard/router/v1/info_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ import (

func InitInfoRoutes(g *gin.RouterGroup) {
g.GET("/info", h.Wrap(h.GetProcessInfo))
g.GET("/statstics", h.Wrap(h.GetStatistics))
}
1 change: 0 additions & 1 deletion internal/dashboard/router/v1/metric_router.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,4 @@ import (
func InitMetricRoutes(g *gin.RouterGroup) {
g.GET("/metrics", h.Wrap(h.ListMetricMetas))
g.POST("/metrics/query", h.Wrap(h.QueryMetrics))
g.GET("/metrics/statistic", h.Wrap(h.GetStatistics))
}

0 comments on commit 05b0a0a

Please sign in to comment.