Documentation
¶
Overview ¶
Package message contains the message controller
Package message contains the message controller ¶
Package message contains the message controller
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller struct {
MessageService domainMessage.Service
}
Controller is a struct that contains the message service
func (*Controller) NewSMSMessage ¶
func (c *Controller) NewSMSMessage(ctx *gin.Context)
NewSMSMessage godoc
@Tags messages
@Summary Create New SMS Message
@Description Create new SMS message on the external system like TWILIO
@Accept json
@Produce json
@Param data body NewMessageRequest true "body data"
@Success 201 {object} domainMessage.Response
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /messages/sms [post]
func (*Controller) NewWhatsappMessage ¶
func (c *Controller) NewWhatsappMessage(ctx *gin.Context)
NewWhatsappMessage godoc
@Tags messages
@Summary Create New Whatsapp Message
@Description Create new Whatsapp message on the external system like TWILIO
@Accept json
@Produce json
@Param data body NewMessageRequest true "body data"
@Success 201 {object} domainMessage.Response
@Failure 400 {object} MessageResponse
@Failure 500 {object} MessageResponse
@Router /messages/whatsapp [post]
type MessageResponse ¶
type MessageResponse struct {
Message string `json:"message"`
}
MessageResponse is a struct that contains the response body for the message
type NewMessageRequest ¶
type NewMessageRequest struct {
PhoneNumber string `json:"phone_number" example:"+919901170563" binding:"required"`
Body string `json:"body" example:"Something" binding:"required"`
}
NewMessageRequest is a struct that contains the new message request information
Click to show internal directories.
Click to hide internal directories.