diff --git a/core/controllers/HermesController.go b/core/controllers/HermesController.go index 9368019..736b873 100644 --- a/core/controllers/HermesController.go +++ b/core/controllers/HermesController.go @@ -57,7 +57,7 @@ func (controller *HermesController) SendMail(context *gin.Context) { mailTemplate.Subject = input.Subject } - message, err := controller.handleMailMessage(mailTemplate, input.PlaceHolder) + message, err := controller.handleMailMessage(mailTemplate, input.Placeholder) if err != nil { context.JSON(common.ErrorHandlerHttpResponse(err)) diff --git a/core/http/requests/hermes-forms/SendMailFormRequest.go b/core/http/requests/hermes-forms/SendMailFormRequest.go index 364d40f..5bde8f4 100644 --- a/core/http/requests/hermes-forms/SendMailFormRequest.go +++ b/core/http/requests/hermes-forms/SendMailFormRequest.go @@ -2,11 +2,22 @@ package hermes_forms type SendMailFormRequest struct { // required: true + // type: string Code string `json:"code" binding:"required"` // required: true - Recipients []string `json:"recipients" binding:"required"` - PlaceHolder map[string]string `json:"placeholder" binding:"required"` - Subject string `json:"subject"` + // type: array + // items: + // type: string + // example: ["email1@gmal.com", "email2@gmail.com"] + Recipients []string `json:"recipients" binding:"required"` + // required: false + // type: object + Placeholder map[string]string `json:"placeholder" binding:"required"` + // required: false + // type: string + // extensions: + // x-note: All key must be capital the first character + Subject string `json:"subject"` } // swagger:parameters SendMail diff --git a/docs/swagger.json b/docs/swagger.json index 11a6001..155253c 100644 --- a/docs/swagger.json +++ b/docs/swagger.json @@ -73,13 +73,13 @@ "items": { "$ref": "#/definitions/FeedbackModel" } - }, - "limit": { - "type": "integer" - }, - "offset": { - "type": "integer" } + }, + "limit": { + "type": "integer" + }, + "offset": { + "type": "integer" } } } @@ -462,18 +462,23 @@ "additionalProperties": { "type": "string" }, - "x-go-name": "PlaceHolder" + "x-go-name": "Placeholder" }, "recipients": { "type": "array", "items": { "type": "string" }, - "x-go-name": "Recipients" + "x-go-name": "Recipients", + "example": [ + "email1@gmal.com", + "email2@gmail.com" + ] }, "subject": { "type": "string", - "x-go-name": "Subject" + "x-go-name": "Subject", + "x-note": "All key must be capital the first character" } }, "x-go-package": "TSS-microservices/core/http/requests/hermes-forms"