Skip to content

Commit

Permalink
docs(api): swagger & i18n
Browse files Browse the repository at this point in the history
  • Loading branch information
ttktatakai committed Oct 22, 2024
1 parent dc8eb68 commit 643de23
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 17 deletions.
40 changes: 36 additions & 4 deletions backend/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Package docs Code generated by swaggo/swag at 2024-09-20 17:24:49.219072 +0800 CST m=+7.114523601. DO NOT EDIT
// Package docs Code generated by swaggo/swag at 2024-10-22 11:20:22.5424987 +0800 CST m=+3.225823701. DO NOT EDIT
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -513,7 +513,7 @@ const docTemplate = `{
},
{
"type": "string",
"description": "name or cmds",
"description": "name or cmd",
"name": "search",
"in": "query"
},
Expand Down Expand Up @@ -549,7 +549,7 @@ const docTemplate = `{
},
{
"type": "string",
"description": "name or cmds",
"description": "name or cmd",
"name": "search",
"in": "query"
}
Expand Down Expand Up @@ -2551,6 +2551,12 @@ const docTemplate = `{
"password": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"phrase": {
"type": "string"
},
Expand Down Expand Up @@ -2607,6 +2613,12 @@ const docTemplate = `{
"parent_id": {
"type": "integer"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"protocols": {
"type": "array",
"items": {
Expand Down Expand Up @@ -2686,6 +2698,12 @@ const docTemplate = `{
"name": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"resource_id": {
"type": "integer"
},
Expand Down Expand Up @@ -2759,6 +2777,12 @@ const docTemplate = `{
"password": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"phrase": {
"type": "string"
},
Expand Down Expand Up @@ -2843,7 +2867,6 @@ const docTemplate = `{
"type": "string"
},
"creator_id": {
"description": "ResourceId int ` + "`" + `json:\"resource_id\"` + "`" + `",
"type": "integer"
},
"gateway_id": {
Expand All @@ -2861,12 +2884,21 @@ const docTemplate = `{
"parent_id": {
"type": "integer"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"protocols": {
"type": "array",
"items": {
"type": "string"
}
},
"resource_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
Expand Down
38 changes: 35 additions & 3 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@
},
{
"type": "string",
"description": "name or cmds",
"description": "name or cmd",
"name": "search",
"in": "query"
},
Expand Down Expand Up @@ -538,7 +538,7 @@
},
{
"type": "string",
"description": "name or cmds",
"description": "name or cmd",
"name": "search",
"in": "query"
}
Expand Down Expand Up @@ -2540,6 +2540,12 @@
"password": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"phrase": {
"type": "string"
},
Expand Down Expand Up @@ -2596,6 +2602,12 @@
"parent_id": {
"type": "integer"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"protocols": {
"type": "array",
"items": {
Expand Down Expand Up @@ -2675,6 +2687,12 @@
"name": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"resource_id": {
"type": "integer"
},
Expand Down Expand Up @@ -2748,6 +2766,12 @@
"password": {
"type": "string"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"phrase": {
"type": "string"
},
Expand Down Expand Up @@ -2832,7 +2856,6 @@
"type": "string"
},
"creator_id": {
"description": "ResourceId int `json:\"resource_id\"`",
"type": "integer"
},
"gateway_id": {
Expand All @@ -2850,12 +2873,21 @@
"parent_id": {
"type": "integer"
},
"permissions": {
"type": "array",
"items": {
"type": "string"
}
},
"protocols": {
"type": "array",
"items": {
"type": "string"
}
},
"resource_id": {
"type": "integer"
},
"updated_at": {
"type": "string"
},
Expand Down
27 changes: 24 additions & 3 deletions backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ definitions:
type: string
password:
type: string
permissions:
items:
type: string
type: array
phrase:
type: string
pk:
Expand Down Expand Up @@ -87,6 +91,10 @@ definitions:
type: string
parent_id:
type: integer
permissions:
items:
type: string
type: array
protocols:
items:
type: string
Expand Down Expand Up @@ -139,6 +147,10 @@ definitions:
type: boolean
name:
type: string
permissions:
items:
type: string
type: array
resource_id:
type: integer
updated_at:
Expand Down Expand Up @@ -187,6 +199,10 @@ definitions:
type: string
password:
type: string
permissions:
items:
type: string
type: array
phrase:
type: string
pk:
Expand Down Expand Up @@ -243,7 +259,6 @@ definitions:
created_at:
type: string
creator_id:
description: ResourceId int `json:"resource_id"`
type: integer
gateway_id:
type: integer
Expand All @@ -255,10 +270,16 @@ definitions:
type: string
parent_id:
type: integer
permissions:
items:
type: string
type: array
protocols:
items:
type: string
type: array
resource_id:
type: integer
updated_at:
type: string
updater_id:
Expand Down Expand Up @@ -774,7 +795,7 @@ paths:
name: page_size
required: true
type: integer
- description: name or cmds
- description: name or cmd
in: query
name: search
type: string
Expand All @@ -798,7 +819,7 @@ paths:
in: query
name: info
type: boolean
- description: name or cmds
- description: name or cmd
in: query
name: search
type: string
Expand Down
4 changes: 4 additions & 0 deletions backend/i18n/translate/active.en.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ other = "Node"
one = "Public Key"
other = "Public Key"

[MsgUnauthorized]
one = "Unauthorized"
other = "Unauthorized"

[MsgWrongMac]
one = "Bad Request: Invalid Mac address"
other = "Bad Request: Invalid Mac address"
Expand Down
4 changes: 4 additions & 0 deletions backend/i18n/translate/active.zh.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,10 @@ other = "文件夹"
hash = "sha1-590e3d26e76d9c4e5fe2aaf976d54d1f46cb8b31"
other = "公钥"

[MsgUnauthorized]
hash = "sha1-740b83150add8d2de17b3ab10d33605bb00e9589"
other = "未认证"

[MsgWrongMac]
hash = "sha1-2b836bb6de89fdc386c739b6ce1d0f61959de02e"
other = "请求错误: 非法MAC地址"
Expand Down
10 changes: 3 additions & 7 deletions backend/i18n/translate/translate.zh.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
[MsgIdleTimeout]
hash = "sha1-001276a8efe351c6bbbb83ea269a5a359a683d95"
other = "请求错误:空闲超过 {{.second}} 秒"

[MsgWrongPvk]
hash = "sha1-fd11d7d098d05415f5ed082abdf31223cb2aeda9"
other = "请求错误: 非法SSH私钥"
[MsgUnauthorized]
hash = "sha1-740b83150add8d2de17b3ab10d33605bb00e9589"
other = "未认证"

0 comments on commit 643de23

Please sign in to comment.