tsk-57: Change schema of scheduled_message_events (#65)

Closes #57

Reviewed-on: phoenix/textsender-api#65
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2026-01-01 00:59:14 +00:00
committed by phoenix
parent 29f8c943a6
commit 8860d6c801
19 changed files with 195 additions and 189 deletions
+19 -16
View File
@@ -72,20 +72,23 @@ func (e *EventResponseHandler) RecordResponse(w http.ResponseWriter, r *http.Req
rp.Sent = *req.Sent
switch req.Status {
case message.Message_Event_Response_Status_Instant: {
log.Println("Status:", req.Status)
rp.Status = req.Status
rp.MessageId = req.MessageId
rp.ContactId = req.ContactId
}
case message.Message_Event_Response_Status_Scheduled: {
log.Println("Status:", req.Status)
rp.Status = req.Status
}
default: {
statusCode = http.StatusBadRequest
resp.Message = "Status is invalid"
}
case message.Message_Event_Response_Status_Instant:
{
log.Println("Status:", req.Status)
rp.Status = req.Status
rp.MessageId = req.MessageId
rp.ContactId = req.ContactId
}
case message.Message_Event_Response_Status_Scheduled:
{
log.Println("Status:", req.Status)
rp.Status = req.Status
}
default:
{
statusCode = http.StatusBadRequest
resp.Message = "Status is invalid"
}
}
ctx := r.Context()
@@ -103,8 +106,8 @@ func (e *EventResponseHandler) RecordResponse(w http.ResponseWriter, r *http.Req
}
type GetMessageEventResponseFetchedResponse struct {
Message string `json:"message"`
Data []*message.MessageEventResponse `json:"data"`
Message string `json:"message"`
Data []*message.MessageEventResponse `json:"data"`
}
func (e *EventResponseHandler) Fetch(w http.ResponseWriter, r *http.Request) {