Browse Source

fix: 补全 swagger 文档 (#1022)

pull/1023/head
ssongliu 2 years ago committed by GitHub
parent
commit
afa9eecf35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      backend/app/api/v1/firewall.go
  2. 47
      cmd/server/docs/docs.go
  3. 47
      cmd/server/docs/swagger.json
  4. 32
      cmd/server/docs/swagger.yaml

4
backend/app/api/v1/firewall.go

@ -138,7 +138,7 @@ func (b *BaseApi) OperateIPRule(c *gin.Context) {
// @Param request body dto.BatchRuleOperate true "request" // @Param request body dto.BatchRuleOperate true "request"
// @Success 200 // @Success 200
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /hosts/firewall/ip [post] // @Router /hosts/firewall/batch [post]
func (b *BaseApi) BatchOperateRule(c *gin.Context) { func (b *BaseApi) BatchOperateRule(c *gin.Context) {
var req dto.BatchRuleOperate var req dto.BatchRuleOperate
if err := c.ShouldBindJSON(&req); err != nil { if err := c.ShouldBindJSON(&req); err != nil {
@ -188,7 +188,7 @@ func (b *BaseApi) UpdatePortRule(c *gin.Context) {
// @Param request body dto.AddrRuleUpdate true "request" // @Param request body dto.AddrRuleUpdate true "request"
// @Success 200 // @Success 200
// @Security ApiKeyAuth // @Security ApiKeyAuth
// @Router /hosts/firewall/update/ip [post] // @Router /hosts/firewall/update/addr [post]
func (b *BaseApi) UpdateAddrRule(c *gin.Context) { func (b *BaseApi) UpdateAddrRule(c *gin.Context) {
var req dto.AddrRuleUpdate var req dto.AddrRuleUpdate
if err := c.ShouldBindJSON(&req); err != nil { if err := c.ShouldBindJSON(&req); err != nil {

47
cmd/server/docs/docs.go

@ -5377,7 +5377,7 @@ var doc = `{
} }
} }
}, },
"/hosts/firewall/ip": { "/hosts/firewall/batch": {
"post": { "post": {
"security": [ "security": [
{ {
@ -5410,6 +5410,49 @@ var doc = `{
} }
} }
}, },
"/hosts/firewall/ip": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "创建防火墙 IP 规则",
"consumes": [
"application/json"
],
"tags": [
"Firewall"
],
"summary": "Create group",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AddrRuleOperate"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"x-panel-log": {
"BeforeFuntions": [],
"bodyKeys": [
"strategy",
"address"
],
"formatEN": "create address rules [strategy][address]",
"formatZH": "添加 ip 规则 [strategy] [address]",
"paramKeys": []
}
}
},
"/hosts/firewall/operate": { "/hosts/firewall/operate": {
"post": { "post": {
"security": [ "security": [
@ -5534,7 +5577,7 @@ var doc = `{
} }
} }
}, },
"/hosts/firewall/update/ip": { "/hosts/firewall/update/addr": {
"post": { "post": {
"security": [ "security": [
{ {

47
cmd/server/docs/swagger.json

@ -5363,7 +5363,7 @@
} }
} }
}, },
"/hosts/firewall/ip": { "/hosts/firewall/batch": {
"post": { "post": {
"security": [ "security": [
{ {
@ -5396,6 +5396,49 @@
} }
} }
}, },
"/hosts/firewall/ip": {
"post": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "创建防火墙 IP 规则",
"consumes": [
"application/json"
],
"tags": [
"Firewall"
],
"summary": "Create group",
"parameters": [
{
"description": "request",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/dto.AddrRuleOperate"
}
}
],
"responses": {
"200": {
"description": ""
}
},
"x-panel-log": {
"BeforeFuntions": [],
"bodyKeys": [
"strategy",
"address"
],
"formatEN": "create address rules [strategy][address]",
"formatZH": "添加 ip 规则 [strategy] [address]",
"paramKeys": []
}
}
},
"/hosts/firewall/operate": { "/hosts/firewall/operate": {
"post": { "post": {
"security": [ "security": [
@ -5520,7 +5563,7 @@
} }
} }
}, },
"/hosts/firewall/update/ip": { "/hosts/firewall/update/addr": {
"post": { "post": {
"security": [ "security": [
{ {

32
cmd/server/docs/swagger.yaml

@ -6461,7 +6461,7 @@ paths:
summary: Load firewall base info summary: Load firewall base info
tags: tags:
- Firewall - Firewall
/hosts/firewall/ip: /hosts/firewall/batch:
post: post:
consumes: consumes:
- application/json - application/json
@ -6481,6 +6481,34 @@ paths:
summary: Create group summary: Create group
tags: tags:
- Firewall - Firewall
/hosts/firewall/ip:
post:
consumes:
- application/json
description: 创建防火墙 IP 规则
parameters:
- description: request
in: body
name: request
required: true
schema:
$ref: '#/definitions/dto.AddrRuleOperate'
responses:
"200":
description: ""
security:
- ApiKeyAuth: []
summary: Create group
tags:
- Firewall
x-panel-log:
BeforeFuntions: []
bodyKeys:
- strategy
- address
formatEN: create address rules [strategy][address]
formatZH: 添加 ip 规则 [strategy] [address]
paramKeys: []
/hosts/firewall/operate: /hosts/firewall/operate:
post: post:
consumes: consumes:
@ -6560,7 +6588,7 @@ paths:
summary: Page firewall rules summary: Page firewall rules
tags: tags:
- Firewall - Firewall
/hosts/firewall/update/ip: /hosts/firewall/update/addr:
post: post:
consumes: consumes:
- application/json - application/json

Loading…
Cancel
Save