Skip to content

Commit

Permalink
feat: Update swagger docs (#7710)
Browse files Browse the repository at this point in the history
  • Loading branch information
lan-yonghui authored Jan 13, 2025
1 parent 99f62b7 commit 999e5a7
Show file tree
Hide file tree
Showing 5 changed files with 379 additions and 121 deletions.
4 changes: 2 additions & 2 deletions backend/app/api/v1/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func (b *BaseApi) SearchBackupRecords(c *gin.Context) {
// @Summary Load backup records size
// @Accept json
// @Param request body dto.RecordSearch true "request"
// @Success 200 {array} dto.dto.BackupFile
// @Success 200 {array} dto.BackupFile
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/size [post]
Expand Down Expand Up @@ -215,7 +215,7 @@ func (b *BaseApi) SearchBackupRecordsByCronjob(c *gin.Context) {
// @Summary Load backup records size for cronjob
// @Accept json
// @Param request body dto.RecordSearchByCronjob true "request"
// @Success 200 {array} dto.dto.BackupFile
// @Success 200 {array} dto.BackupFile
// @Security ApiKeyAuth
// @Security Timestamp
// @Router /settings/backup/record/size/bycronjob [post]
Expand Down
187 changes: 143 additions & 44 deletions cmd/server/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10624,6 +10624,88 @@ const docTemplate = `{
}
}
},
"/settings/backup/record/size": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"Backup Account"
],
"summary": "Load backup records size",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.RecordSearch"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.BackupFile"
}
}
}
}
}
},
"/settings/backup/record/size/bycronjob": {
"post": {
"security": [
{
"ApiKeyAuth": []
},
{
"Timestamp": []
}
],
"consumes": [
"application/json"
],
"tags": [
"Backup Account"
],
"summary": "Load backup records size for cronjob",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.RecordSearchByCronjob"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/dto.BackupFile"
}
}
}
}
}
},
"/settings/backup/recover": {
"post": {
"security": [
Expand Down Expand Up @@ -16684,6 +16766,20 @@ const docTemplate = `{
}
}
},
"dto.BackupFile": {
"type": "object",
"properties": {
"id": {
"type": "integer"
},
"name": {
"type": "string"
},
"size": {
"type": "integer"
}
}
},
"dto.BackupInfo": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -19448,7 +19544,10 @@ const docTemplate = `{
"zh",
"en",
"tw",
"ru"
"ja",
"ru",
"ms",
"pt-BR"
]
},
"name": {
Expand Down Expand Up @@ -24834,94 +24933,94 @@ const docTemplate = `{
}
}
},
"response.AppDto": {
"response.AppInstalledCheck": {
"type": "object",
"properties": {
"icon": {
"app": {
"type": "string"
},
"id": {
"appInstallId": {
"type": "integer"
},
"installed": {
"type": "boolean"
"containerName": {
"type": "string"
},
"key": {
"createdAt": {
"type": "string"
},
"limit": {
"httpPort": {
"type": "integer"
},
"name": {
"type": "string"
"httpsPort": {
"type": "integer"
},
"resource": {
"installPath": {
"type": "string"
},
"shortDescEn": {
"isExist": {
"type": "boolean"
},
"lastBackupAt": {
"type": "string"
},
"shortDescZh": {
"name": {
"type": "string"
},
"status": {
"type": "string"
},
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Tag"
}
},
"type": {
"version": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"response.AppInstalledCheck": {
"response.AppItem": {
"type": "object",
"properties": {
"app": {
"icon": {
"type": "string"
},
"appInstallId": {
"id": {
"type": "integer"
},
"containerName": {
"type": "string"
"installed": {
"type": "boolean"
},
"createdAt": {
"key": {
"type": "string"
},
"httpPort": {
"type": "integer"
},
"httpsPort": {
"limit": {
"type": "integer"
},
"installPath": {
"name": {
"type": "string"
},
"isExist": {
"type": "boolean"
"resource": {
"type": "string"
},
"lastBackupAt": {
"shortDescEn": {
"type": "string"
},
"name": {
"shortDescZh": {
"type": "string"
},
"status": {
"type": "string"
},
"version": {
"tags": {
"type": "array",
"items": {
"$ref": "#/definitions/model.Tag"
}
},
"type": {
"type": "string"
},
"versions": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down Expand Up @@ -24965,7 +25064,7 @@ const docTemplate = `{
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/response.AppDto"
"$ref": "#/definitions/response.AppItem"
}
},
"total": {
Expand Down Expand Up @@ -25965,7 +26064,7 @@ const docTemplate = `{
},
"securityDefinitions": {
"ApiKeyAuth": {
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/resource\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.",
"description": "Custom Token Format, Format: md5('1panel' + API-Key + UnixTimestamp).\n` + "`" + `` + "`" + `` + "`" + `\neg:\ncurl -X GET \"http://localhost:4004/api/v1/dashboard/current\" \\\n-H \"1Panel-Token: \u003c1panel_token\u003e\" \\\n-H \"1Panel-Timestamp: \u003ccurrent_unix_timestamp\u003e\"\n` + "`" + `` + "`" + `` + "`" + `\n- ` + "`" + `1Panel-Token` + "`" + ` is the key for the panel API Key.",
"type": "apiKey",
"name": "1Panel-Token",
"in": "header"
Expand Down
Loading

0 comments on commit 999e5a7

Please sign in to comment.