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
+68
View File
@@ -154,6 +154,26 @@ definitions:
message:
type: string
type: object
handler.SendInstantMessageRequest:
properties:
contact_ids:
items:
type: string
type: array
message_id:
type: string
user_id:
type: string
type: object
handler.SendInstantMessageResponse:
properties:
data:
items:
$ref: '#/definitions/message.MessageEventResponse'
type: array
message:
type: string
type: object
message.Message:
properties:
content:
@@ -163,6 +183,21 @@ definitions:
user_id:
type: string
type: object
message.MessageEventResponse:
properties:
id:
type: string
response:
items:
type: integer
type: array
scheduled_message_event_id:
type: string
sent:
type: string
user_id:
type: string
type: object
scheduling.ScheduledMessage:
properties:
created:
@@ -266,6 +301,39 @@ paths:
summary: Add contact
tags:
- contacts
/instant/message:
post:
consumes:
- application/json
description: Send a message without the constraints of scheduled messages (requires
JWT)
parameters:
- description: Send an instnt message
in: body
name: request
required: true
schema:
$ref: '#/definitions/handler.SendInstantMessageRequest'
produces:
- application/json
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'
security:
- BearerAuth: []
summary: Send instant message
tags:
- messages
/message:
get:
consumes: