Skip to content

Commit

Permalink
Update APIs docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
just-pthai-it committed Aug 3, 2024
1 parent 081d578 commit 4a2e680
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/controllers/HermesController.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
17 changes: 14 additions & 3 deletions core/http/requests/hermes-forms/SendMailFormRequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -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: ["[email protected]", "[email protected]"]
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
Expand Down
23 changes: 14 additions & 9 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@
"items": {
"$ref": "#/definitions/FeedbackModel"
}
},
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
}
},
"limit": {
"type": "integer"
},
"offset": {
"type": "integer"
}
}
}
Expand Down Expand Up @@ -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": [
"[email protected]",
"[email protected]"
]
},
"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"
Expand Down

0 comments on commit 4a2e680

Please sign in to comment.