diff --git a/docs/docs.go b/docs/docs.go index 59aa0579..aaf70898 100644 --- a/docs/docs.go +++ b/docs/docs.go @@ -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": [ diff --git a/docs/swagger.json b/docs/swagger.json index e72de0a6..1b8b7b86 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -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": [ diff --git a/docs/swagger.yaml b/docs/swagger.yaml index d02fdb6f..7fb3d432 100644 --- a/docs/swagger.yaml +++ b/docs/swagger.yaml @@ -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: diff --git a/internal/controller_backyard/siteinfo_controller.go b/internal/controller_backyard/siteinfo_controller.go index cc950a4c..ef42c5b4 100644 --- a/internal/controller_backyard/siteinfo_controller.go +++ b/internal/controller_backyard/siteinfo_controller.go @@ -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) {