Update system info API swagger

This commit is contained in:
Yang Luo
2023-03-26 10:18:44 +08:00
parent 117ee509cf
commit 32b05047dc
3 changed files with 128 additions and 43 deletions

View File

@ -21,9 +21,8 @@ import (
// GetSystemInfo
// @Title GetSystemInfo
// @Tag System API
// @Description get user's system info
// @Param id query string true "The id ( owner/name ) of the user"
// @Success 200 {object} object.SystemInfo The Response object
// @Description get system info like CPU and memory usage
// @Success 200 {object} util.SystemInfo The Response object
// @router /get-system-info [get]
func (c *ApiController) GetSystemInfo() {
_, ok := c.RequireAdmin()
@ -43,8 +42,8 @@ func (c *ApiController) GetSystemInfo() {
// GetVersionInfo
// @Title GetVersionInfo
// @Tag System API
// @Description get local git repo's latest release version info
// @Success 200 {string} local latest version hash of Casdoor
// @Description get version info like Casdoor release version and commit ID
// @Success 200 {object} util.VersionInfo The Response object
// @router /get-version-info [get]
func (c *ApiController) GetVersionInfo() {
versionInfo, err := util.GetVersionInfo()

View File

@ -2058,22 +2058,13 @@
"tags": [
"System API"
],
"description": "get user's system info",
"description": "get system info like CPU and memory usage",
"operationId": "ApiController.GetSystemInfo",
"parameters": [
{
"in": "query",
"name": "id",
"description": "The id ( owner/name ) of the user",
"required": true,
"type": "string"
}
],
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/object.SystemInfo"
"$ref": "#/definitions/util.SystemInfo"
}
}
}
@ -2323,11 +2314,14 @@
"tags": [
"System API"
],
"description": "get local git repo's latest release version info",
"description": "get version info like Casdoor release version and commit ID",
"operationId": "ApiController.GetVersionInfo",
"responses": {
"200": {
"description": "{string} local latest version hash of Casdoor"
"description": "The Response object",
"schema": {
"$ref": "#/definitions/util.VersionInfo"
}
}
}
}
@ -3494,6 +3488,23 @@
"operationId": "ApiController.UploadResource"
}
},
"/api/user": {
"get": {
"tags": [
"Account API"
],
"description": "return Laravel compatible user information according to OAuth 2.0",
"operationId": "ApiController.UserInfo2",
"responses": {
"200": {
"description": "The Response object",
"schema": {
"$ref": "#/definitions/LaravelResponse"
}
}
}
}
},
"/api/userinfo": {
"get": {
"tags": [
@ -3627,14 +3638,18 @@
}
},
"definitions": {
"2268.0xc000528cf0.false": {
"2306.0xc0000a7410.false": {
"title": "false",
"type": "object"
},
"2302.0xc000528d20.false": {
"2340.0xc0000a7440.false": {
"title": "false",
"type": "object"
},
"LaravelResponse": {
"title": "LaravelResponse",
"type": "object"
},
"Response": {
"title": "Response",
"type": "object"
@ -3682,6 +3697,9 @@
"captchaType": {
"type": "string"
},
"clientId": {
"type": "string"
},
"clientSecret": {
"type": "string"
},
@ -3758,10 +3776,10 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/2268.0xc000528cf0.false"
"$ref": "#/definitions/2306.0xc0000a7410.false"
},
"data2": {
"$ref": "#/definitions/2302.0xc000528d20.false"
"$ref": "#/definitions/2340.0xc0000a7440.false"
},
"msg": {
"type": "string"
@ -4830,10 +4848,6 @@
}
}
},
"object.SystemInfo": {
"title": "SystemInfo",
"type": "object"
},
"object.TableColumn": {
"title": "TableColumn",
"type": "object",
@ -5475,6 +5489,43 @@
"title": "CredentialCreationResponse",
"type": "object"
},
"util.SystemInfo": {
"title": "SystemInfo",
"type": "object",
"properties": {
"cpuUsage": {
"type": "array",
"items": {
"type": "number",
"format": "double"
}
},
"memoryTotal": {
"type": "integer",
"format": "int64"
},
"memoryUsed": {
"type": "integer",
"format": "int64"
}
}
},
"util.VersionInfo": {
"title": "VersionInfo",
"type": "object",
"properties": {
"commitId": {
"type": "string"
},
"commitOffset": {
"type": "integer",
"format": "int64"
},
"version": {
"type": "string"
}
}
},
"webauthn.Credential": {
"title": "Credential",
"type": "object"

View File

@ -1340,19 +1340,13 @@ paths:
get:
tags:
- System API
description: get user's system info
description: get system info like CPU and memory usage
operationId: ApiController.GetSystemInfo
parameters:
- in: query
name: id
description: The id ( owner/name ) of the user
required: true
type: string
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/object.SystemInfo'
$ref: '#/definitions/util.SystemInfo'
/api/get-token:
get:
tags:
@ -1515,11 +1509,13 @@ paths:
get:
tags:
- System API
description: get local git repo's latest release version info
description: get version info like Casdoor release version and commit ID
operationId: ApiController.GetVersionInfo
responses:
"200":
description: '{string} local latest version hash of Casdoor'
description: The Response object
schema:
$ref: '#/definitions/util.VersionInfo'
/api/get-webhook:
get:
tags:
@ -2288,6 +2284,17 @@ paths:
tags:
- Resource API
operationId: ApiController.UploadResource
/api/user:
get:
tags:
- Account API
description: return Laravel compatible user information according to OAuth 2.0
operationId: ApiController.UserInfo2
responses:
"200":
description: The Response object
schema:
$ref: '#/definitions/LaravelResponse'
/api/userinfo:
get:
tags:
@ -2374,12 +2381,15 @@ paths:
schema:
$ref: '#/definitions/Response'
definitions:
2268.0xc000528cf0.false:
2306.0xc0000a7410.false:
title: "false"
type: object
2302.0xc000528d20.false:
2340.0xc0000a7440.false:
title: "false"
type: object
LaravelResponse:
title: LaravelResponse
type: object
Response:
title: Response
type: object
@ -2413,6 +2423,8 @@ definitions:
type: string
captchaType:
type: string
clientId:
type: string
clientSecret:
type: string
code:
@ -2464,9 +2476,9 @@ definitions:
type: object
properties:
data:
$ref: '#/definitions/2268.0xc000528cf0.false'
$ref: '#/definitions/2306.0xc0000a7410.false'
data2:
$ref: '#/definitions/2302.0xc000528d20.false'
$ref: '#/definitions/2340.0xc0000a7440.false'
msg:
type: string
name:
@ -3183,9 +3195,6 @@ definitions:
type: string
user:
type: string
object.SystemInfo:
title: SystemInfo
type: object
object.TableColumn:
title: TableColumn
type: object
@ -3617,6 +3626,32 @@ definitions:
protocol.CredentialCreationResponse:
title: CredentialCreationResponse
type: object
util.SystemInfo:
title: SystemInfo
type: object
properties:
cpuUsage:
type: array
items:
type: number
format: double
memoryTotal:
type: integer
format: int64
memoryUsed:
type: integer
format: int64
util.VersionInfo:
title: VersionInfo
type: object
properties:
commitId:
type: string
commitOffset:
type: integer
format: int64
version:
type: string
webauthn.Credential:
title: Credential
type: object