fix: 补全 swagger 文档 (#1022)

This commit is contained in:
ssongliu 2023-05-12 22:30:50 +08:00 committed by GitHub
parent 46e13d754f
commit afa9eecf35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 122 additions and 8 deletions

View file

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

View file

@ -5377,7 +5377,7 @@ var doc = `{
}
}
},
"/hosts/firewall/ip": {
"/hosts/firewall/batch": {
"post": {
"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": {
"post": {
"security": [
@ -5534,7 +5577,7 @@ var doc = `{
}
}
},
"/hosts/firewall/update/ip": {
"/hosts/firewall/update/addr": {
"post": {
"security": [
{

View file

@ -5363,7 +5363,7 @@
}
}
},
"/hosts/firewall/ip": {
"/hosts/firewall/batch": {
"post": {
"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": {
"post": {
"security": [
@ -5520,7 +5563,7 @@
}
}
},
"/hosts/firewall/update/ip": {
"/hosts/firewall/update/addr": {
"post": {
"security": [
{

View file

@ -6461,7 +6461,7 @@ paths:
summary: Load firewall base info
tags:
- Firewall
/hosts/firewall/ip:
/hosts/firewall/batch:
post:
consumes:
- application/json
@ -6481,6 +6481,34 @@ paths:
summary: Create group
tags:
- 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:
post:
consumes:
@ -6560,7 +6588,7 @@ paths:
summary: Page firewall rules
tags:
- Firewall
/hosts/firewall/update/ip:
/hosts/firewall/update/addr:
post:
consumes:
- application/json