tsk-59: Added endpoint constant and made changes to handler
This commit is contained in:
@@ -12,5 +12,7 @@ const GetScheduledMessageEventEndpoint = "/api/v1/schedule/message/event"
|
||||
const DeleteScheduledMessageEventEndpoint = "/api/v1/schedule/message/event/{id}"
|
||||
const UpdateScheduledMessageStatusEndpoint = "/api/v1/schedule/message/status/update"
|
||||
const FetchNextScheduledMessageEndpoint = "/api/v1/schedule/message/fetch"
|
||||
// TODO: Make RecordEventResponse more consistent with MessageEventResponse
|
||||
const RecordEventResponse = "/api/v1/schedule/message/event/response/record"
|
||||
const FetchMessageEventResponse = "/api/v1/schedule/message/event/response"
|
||||
const SendInstantMessageEndpoint = "/api/v1/instant/message"
|
||||
|
||||
@@ -86,3 +86,15 @@ func (e *EventResponseHandler) RecordResponse(w http.ResponseWriter, r *http.Req
|
||||
|
||||
RespondWithJSON(w, statusCode, &resp)
|
||||
}
|
||||
|
||||
type GetMessageEventResponseFetchedResponse struct {
|
||||
Message string `json:"message"`
|
||||
Data []*message.MessageEventResponse `json:"data"`
|
||||
}
|
||||
|
||||
func (e *EventResponseHandler) Fetch(w http.ResponseWriter, r *http.Request) {
|
||||
var statusCode int
|
||||
var resp GetMessageEventResponseFetchedResponse
|
||||
|
||||
RespondWithJSON(w, statusCode, &resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user