Skip to content

Commit e5f9014

Browse files
committed
refactor(api): Update the return type of the SSH public key interface to SSHPublicKeyInfoV1Rsp
In order to unify the interface return format, change the return type of the SSH public key acquisition interface from SSHPublicKeyInfo to SSHPublicKeyInfoV1Rsp to include the status code and message fields
1 parent 271d482 commit e5f9014

File tree

4 files changed

+50
-4
lines changed

4 files changed

+50
-4
lines changed

sqle/api/controller/v1/configuration.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ type SSHPublicKeyInfo struct {
627627
// @Tags configuration
628628
// @Id getSSHPublicKey
629629
// @Security ApiKeyAuth
630-
// @Success 200 {object} v1.SSHPublicKeyInfo
630+
// @Success 200 {object} v1.SSHPublicKeyInfoV1Rsp
631631
// @Router /v1/configurations/ssh_key [get]
632632
func GetSSHPublicKey(c echo.Context) error {
633633
storage := model.GetStorage()

sqle/docs/docs.go

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ var doc = `{
645645
"200": {
646646
"description": "OK",
647647
"schema": {
648-
"$ref": "#/definitions/v1.SSHPublicKeyInfo"
648+
"$ref": "#/definitions/v1.SSHPublicKeyInfoV1Rsp"
649649
}
650650
}
651651
}
@@ -18241,6 +18241,23 @@ var doc = `{
1824118241
}
1824218242
}
1824318243
},
18244+
"v1.SSHPublicKeyInfoV1Rsp": {
18245+
"type": "object",
18246+
"properties": {
18247+
"code": {
18248+
"type": "integer",
18249+
"example": 0
18250+
},
18251+
"data": {
18252+
"type": "object",
18253+
"$ref": "#/definitions/v1.SSHPublicKeyInfo"
18254+
},
18255+
"message": {
18256+
"type": "string",
18257+
"example": "ok"
18258+
}
18259+
}
18260+
},
1824418261
"v1.ScheduleTaskDefaultOption": {
1824518262
"type": "object",
1824618263
"properties": {

sqle/docs/swagger.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@
629629
"200": {
630630
"description": "OK",
631631
"schema": {
632-
"$ref": "#/definitions/v1.SSHPublicKeyInfo"
632+
"$ref": "#/definitions/v1.SSHPublicKeyInfoV1Rsp"
633633
}
634634
}
635635
}
@@ -18225,6 +18225,23 @@
1822518225
}
1822618226
}
1822718227
},
18228+
"v1.SSHPublicKeyInfoV1Rsp": {
18229+
"type": "object",
18230+
"properties": {
18231+
"code": {
18232+
"type": "integer",
18233+
"example": 0
18234+
},
18235+
"data": {
18236+
"type": "object",
18237+
"$ref": "#/definitions/v1.SSHPublicKeyInfo"
18238+
},
18239+
"message": {
18240+
"type": "string",
18241+
"example": "ok"
18242+
}
18243+
}
18244+
},
1822818245
"v1.ScheduleTaskDefaultOption": {
1822918246
"type": "object",
1823018247
"properties": {

sqle/docs/swagger.yaml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4207,6 +4207,18 @@ definitions:
42074207
public_key:
42084208
type: string
42094209
type: object
4210+
v1.SSHPublicKeyInfoV1Rsp:
4211+
properties:
4212+
code:
4213+
example: 0
4214+
type: integer
4215+
data:
4216+
$ref: '#/definitions/v1.SSHPublicKeyInfo'
4217+
type: object
4218+
message:
4219+
example: ok
4220+
type: string
4221+
type: object
42104222
v1.ScheduleTaskDefaultOption:
42114223
properties:
42124224
default_selector:
@@ -6964,7 +6976,7 @@ paths:
69646976
"200":
69656977
description: OK
69666978
schema:
6967-
$ref: '#/definitions/v1.SSHPublicKeyInfo'
6979+
$ref: '#/definitions/v1.SSHPublicKeyInfoV1Rsp'
69686980
security:
69696981
- ApiKeyAuth: []
69706982
summary: 获取SSH公钥

0 commit comments

Comments
 (0)