doc: update admin interface swagger

This commit is contained in:
LinkinStar 2022-10-21 10:26:32 +08:00
parent e128a3dc4a
commit 6f89b593fa
4 changed files with 184 additions and 11 deletions

View File

@ -418,7 +418,7 @@ const docTemplate = `{
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.SiteInterfaceResp"
"$ref": "#/definitions/schema.GetSMTPConfigResp"
}
}
}
@ -443,12 +443,12 @@ const docTemplate = `{
"summary": "update smtp config",
"parameters": [
{
"description": "general",
"description": "smtp config",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.SiteInterfaceReq"
"$ref": "#/definitions/schema.UpdateSMTPConfigReq"
}
}
],
@ -4618,6 +4618,33 @@ const docTemplate = `{
}
}
},
"schema.GetSMTPConfigResp": {
"type": "object",
"properties": {
"encryption": {
"description": "\"\" SSL TLS",
"type": "string"
},
"from_email_address": {
"type": "string"
},
"from_name": {
"type": "string"
},
"smtp_host": {
"type": "string"
},
"smtp_password": {
"type": "string"
},
"smtp_port": {
"type": "integer"
},
"smtp_username": {
"type": "string"
}
}
},
"schema.GetTagPageResp": {
"type": "object",
"properties": {
@ -5499,6 +5526,43 @@ const docTemplate = `{
}
}
},
"schema.UpdateSMTPConfigReq": {
"type": "object",
"properties": {
"encryption": {
"description": "\"\" SSL TLS",
"type": "string",
"enum": [
"SSL"
]
},
"from_email_address": {
"type": "string",
"maxLength": 256
},
"from_name": {
"type": "string",
"maxLength": 256
},
"smtp_host": {
"type": "string",
"maxLength": 256
},
"smtp_password": {
"type": "string",
"maxLength": 256
},
"smtp_port": {
"type": "integer",
"maximum": 65535,
"minimum": 1
},
"smtp_username": {
"type": "string",
"maxLength": 256
}
}
},
"schema.UpdateTagReq": {
"type": "object",
"required": [

View File

@ -406,7 +406,7 @@
"type": "object",
"properties": {
"data": {
"$ref": "#/definitions/schema.SiteInterfaceResp"
"$ref": "#/definitions/schema.GetSMTPConfigResp"
}
}
}
@ -431,12 +431,12 @@
"summary": "update smtp config",
"parameters": [
{
"description": "general",
"description": "smtp config",
"name": "data",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/schema.SiteInterfaceReq"
"$ref": "#/definitions/schema.UpdateSMTPConfigReq"
}
}
],
@ -4606,6 +4606,33 @@
}
}
},
"schema.GetSMTPConfigResp": {
"type": "object",
"properties": {
"encryption": {
"description": "\"\" SSL TLS",
"type": "string"
},
"from_email_address": {
"type": "string"
},
"from_name": {
"type": "string"
},
"smtp_host": {
"type": "string"
},
"smtp_password": {
"type": "string"
},
"smtp_port": {
"type": "integer"
},
"smtp_username": {
"type": "string"
}
}
},
"schema.GetTagPageResp": {
"type": "object",
"properties": {
@ -5487,6 +5514,43 @@
}
}
},
"schema.UpdateSMTPConfigReq": {
"type": "object",
"properties": {
"encryption": {
"description": "\"\" SSL TLS",
"type": "string",
"enum": [
"SSL"
]
},
"from_email_address": {
"type": "string",
"maxLength": 256
},
"from_name": {
"type": "string",
"maxLength": 256
},
"smtp_host": {
"type": "string",
"maxLength": 256
},
"smtp_password": {
"type": "string",
"maxLength": 256
},
"smtp_port": {
"type": "integer",
"maximum": 65535,
"minimum": 1
},
"smtp_username": {
"type": "string",
"maxLength": 256
}
}
},
"schema.UpdateTagReq": {
"type": "object",
"required": [

View File

@ -510,6 +510,24 @@ definitions:
user_info:
$ref: '#/definitions/schema.UserBasicInfo'
type: object
schema.GetSMTPConfigResp:
properties:
encryption:
description: '"" SSL TLS'
type: string
from_email_address:
type: string
from_name:
type: string
smtp_host:
type: string
smtp_password:
type: string
smtp_port:
type: integer
smtp_username:
type: string
type: object
schema.GetTagPageResp:
properties:
created_at:
@ -1146,6 +1164,33 @@ definitions:
required:
- id
type: object
schema.UpdateSMTPConfigReq:
properties:
encryption:
description: '"" SSL TLS'
enum:
- SSL
type: string
from_email_address:
maxLength: 256
type: string
from_name:
maxLength: 256
type: string
smtp_host:
maxLength: 256
type: string
smtp_password:
maxLength: 256
type: string
smtp_port:
maximum: 65535
minimum: 1
type: integer
smtp_username:
maxLength: 256
type: string
type: object
schema.UpdateTagReq:
properties:
display_name:
@ -1612,7 +1657,7 @@ paths:
- $ref: '#/definitions/handler.RespBody'
- properties:
data:
$ref: '#/definitions/schema.SiteInterfaceResp'
$ref: '#/definitions/schema.GetSMTPConfigResp'
type: object
security:
- ApiKeyAuth: []
@ -1622,12 +1667,12 @@ paths:
put:
description: update smtp config
parameters:
- description: general
- description: smtp config
in: body
name: data
required: true
schema:
$ref: '#/definitions/schema.SiteInterfaceReq'
$ref: '#/definitions/schema.UpdateSMTPConfigReq'
produces:
- application/json
responses:

View File

@ -87,7 +87,7 @@ func (sc *SiteInfoController) UpdateInterface(ctx *gin.Context) {
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
// @Success 200 {object} handler.RespBody{data=schema.SiteInterfaceResp}
// @Success 200 {object} handler.RespBody{data=schema.GetSMTPConfigResp}
// @Router /answer/admin/api/setting/smtp [get]
func (sc *SiteInfoController) GetSMTPConfig(ctx *gin.Context) {
resp, err := sc.siteInfoService.GetSMTPConfig(ctx)
@ -100,7 +100,7 @@ func (sc *SiteInfoController) GetSMTPConfig(ctx *gin.Context) {
// @Security ApiKeyAuth
// @Tags admin
// @Produce json
// @Param data body schema.SiteInterfaceReq true "general"
// @Param data body schema.UpdateSMTPConfigReq true "smtp config"
// @Success 200 {object} handler.RespBody{}
// @Router /answer/admin/api/setting/smtp [put]
func (sc *SiteInfoController) UpdateSMTPConfig(ctx *gin.Context) {