tsk-51: Send message endpoint (#52)

Closes #51

Reviewed-on: phoenix/textsender-api#52
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
This commit is contained in:
phoenix
2025-12-10 21:35:02 +00:00
committed by phoenix
parent 20ffc45f89
commit 0d252bc261
32 changed files with 753 additions and 96 deletions
+105
View File
@@ -116,6 +116,57 @@
}
}
},
"/instant/message": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Send a message without the constraints of scheduled messages (requires JWT)",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"messages"
],
"summary": "Send instant message",
"parameters": [
{
"description": "Send an instnt message",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/handler.SendInstantMessageRequest"
}
}
],
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/handler.SendInstantMessageResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/handler.SendInstantMessageResponse"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/handler.SendInstantMessageResponse"
}
}
}
}
},
"/message": {
"get": {
"security": [
@@ -822,6 +873,37 @@
}
}
},
"handler.SendInstantMessageRequest": {
"type": "object",
"properties": {
"contact_ids": {
"type": "array",
"items": {
"type": "string"
}
},
"message_id": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"handler.SendInstantMessageResponse": {
"type": "object",
"properties": {
"data": {
"type": "array",
"items": {
"$ref": "#/definitions/message.MessageEventResponse"
}
},
"message": {
"type": "string"
}
}
},
"message.Message": {
"type": "object",
"properties": {
@@ -836,6 +918,29 @@
}
}
},
"message.MessageEventResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"response": {
"type": "array",
"items": {
"type": "integer"
}
},
"scheduled_message_event_id": {
"type": "string"
},
"sent": {
"type": "string"
},
"user_id": {
"type": "string"
}
}
},
"scheduling.ScheduledMessage": {
"type": "object",
"properties": {