mirror of
https://github.com/makayabou/asg-server.git
synced 2026-05-02 17:43:36 +02:00
[docs] fix GET /api/3rdparty/v1/message/{id} path param
This commit is contained in:
parent
ca50e26e39
commit
278678a473
116
api/swagger.json
116
api/swagger.json
@ -8,7 +8,7 @@
|
||||
"title": "SMS Gateway for Android™ API",
|
||||
"contact": {
|
||||
"name": "Aleksandr Soloshenko",
|
||||
"email": "i@capcom.me"
|
||||
"email": "sms@capcom.me"
|
||||
},
|
||||
"version": "{APP_VERSION}"
|
||||
},
|
||||
@ -151,57 +151,6 @@
|
||||
}
|
||||
},
|
||||
"/3rdparty/v1/message": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"ApiAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns message state by ID",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User",
|
||||
"Messages"
|
||||
],
|
||||
"summary": "Get message state",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Message ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message state",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.MessageState"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
@ -277,6 +226,59 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"/3rdparty/v1/message/{id}": {
|
||||
"get": {
|
||||
"security": [
|
||||
{
|
||||
"ApiAuth": []
|
||||
}
|
||||
],
|
||||
"description": "Returns message state by ID",
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"User",
|
||||
"Messages"
|
||||
],
|
||||
"summary": "Get message state",
|
||||
"parameters": [
|
||||
{
|
||||
"type": "string",
|
||||
"description": "Message ID",
|
||||
"name": "id",
|
||||
"in": "path",
|
||||
"required": true
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Message state",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.MessageState"
|
||||
}
|
||||
},
|
||||
"400": {
|
||||
"description": "Invalid request",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"401": {
|
||||
"description": "Unauthorized",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
},
|
||||
"500": {
|
||||
"description": "Internal server error",
|
||||
"schema": {
|
||||
"$ref": "#/definitions/smsgateway.ErrorResponse"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/3rdparty/v1/webhooks": {
|
||||
"get": {
|
||||
"security": [
|
||||
@ -1164,7 +1166,7 @@
|
||||
"description": "The type of event the webhook is triggered for.",
|
||||
"allOf": [
|
||||
{
|
||||
"$ref": "#/definitions/smsgateway.WebhookEvent"
|
||||
"$ref": "#/definitions/webhooks.EventType"
|
||||
}
|
||||
],
|
||||
"example": "sms:received"
|
||||
@ -1182,15 +1184,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"smsgateway.WebhookEvent": {
|
||||
"webhooks.EventType": {
|
||||
"type": "string",
|
||||
"enum": [
|
||||
"sms:received",
|
||||
"sms:sent",
|
||||
"system:ping"
|
||||
],
|
||||
"x-enum-varnames": [
|
||||
"WebhookEventSmsReceived",
|
||||
"WebhookEventSystemPing"
|
||||
"EventTypeSmsReceived",
|
||||
"EventTypeSmsSent",
|
||||
"EventTypeSystemPing"
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
@ -332,7 +332,7 @@ definitions:
|
||||
properties:
|
||||
event:
|
||||
allOf:
|
||||
- $ref: '#/definitions/smsgateway.WebhookEvent'
|
||||
- $ref: '#/definitions/webhooks.EventType'
|
||||
description: The type of event the webhook is triggered for.
|
||||
example: sms:received
|
||||
id:
|
||||
@ -348,18 +348,20 @@ definitions:
|
||||
- event
|
||||
- url
|
||||
type: object
|
||||
smsgateway.WebhookEvent:
|
||||
webhooks.EventType:
|
||||
enum:
|
||||
- sms:received
|
||||
- sms:sent
|
||||
- system:ping
|
||||
type: string
|
||||
x-enum-varnames:
|
||||
- WebhookEventSmsReceived
|
||||
- WebhookEventSystemPing
|
||||
- EventTypeSmsReceived
|
||||
- EventTypeSmsSent
|
||||
- EventTypeSystemPing
|
||||
host: sms.capcom.me
|
||||
info:
|
||||
contact:
|
||||
email: i@capcom.me
|
||||
email: sms@capcom.me
|
||||
name: Aleksandr Soloshenko
|
||||
description: This API provides programmatic access to sending SMS messages on Android
|
||||
devices. Features include sending SMS, checking message status, device management,
|
||||
@ -457,39 +459,6 @@ paths:
|
||||
- System
|
||||
- Logs
|
||||
/3rdparty/v1/message:
|
||||
get:
|
||||
description: Returns message state by ID
|
||||
parameters:
|
||||
- description: Message ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Message state
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.MessageState'
|
||||
"400":
|
||||
description: Invalid request
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
security:
|
||||
- ApiAuth: []
|
||||
summary: Get message state
|
||||
tags:
|
||||
- User
|
||||
- Messages
|
||||
post:
|
||||
consumes:
|
||||
- application/json
|
||||
@ -539,6 +508,40 @@ paths:
|
||||
tags:
|
||||
- User
|
||||
- Messages
|
||||
/3rdparty/v1/message/{id}:
|
||||
get:
|
||||
description: Returns message state by ID
|
||||
parameters:
|
||||
- description: Message ID
|
||||
in: path
|
||||
name: id
|
||||
required: true
|
||||
type: string
|
||||
produces:
|
||||
- application/json
|
||||
responses:
|
||||
"200":
|
||||
description: Message state
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.MessageState'
|
||||
"400":
|
||||
description: Invalid request
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
"401":
|
||||
description: Unauthorized
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
"500":
|
||||
description: Internal server error
|
||||
schema:
|
||||
$ref: '#/definitions/smsgateway.ErrorResponse'
|
||||
security:
|
||||
- ApiAuth: []
|
||||
summary: Get message state
|
||||
tags:
|
||||
- User
|
||||
- Messages
|
||||
/3rdparty/v1/webhooks:
|
||||
get:
|
||||
description: Returns list of registered webhooks
|
||||
|
||||
@ -16,14 +16,14 @@ import (
|
||||
// @description This API provides programmatic access to sending SMS messages on Android devices. Features include sending SMS, checking message status, device management, webhook configuration, and system health checks.
|
||||
|
||||
// @contact.name Aleksandr Soloshenko
|
||||
// @contact.email i@capcom.me
|
||||
// @contact.email sms@capcom.me
|
||||
|
||||
// @host localhost:3000
|
||||
// @host sms.capcom.me
|
||||
// @schemes https
|
||||
// @BasePath /api
|
||||
//
|
||||
// SMS Gateway
|
||||
// SMS Gateway for Android
|
||||
func main() {
|
||||
smsgateway.Run()
|
||||
}
|
||||
|
||||
4
go.sum
4
go.sum
@ -26,10 +26,6 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc
|
||||
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
|
||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw=
|
||||
github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk=
|
||||
github.com/android-sms-gateway/client-go v1.0.2 h1:kXWzVeSgBu2bM1yN4ac8tTEm0fX2Tqsn+yr9mMNjNfI=
|
||||
github.com/android-sms-gateway/client-go v1.0.2/go.mod h1:DQsReciU1xcaVW3T5Z2bqslNdsAwCFCtghawmA6g6L4=
|
||||
github.com/android-sms-gateway/client-go v1.0.3 h1:Q2pMI/1Lhsw7wu+I+nAaMD4yYvzhQPsP2py71HG7rVo=
|
||||
github.com/android-sms-gateway/client-go v1.0.3/go.mod h1:DQsReciU1xcaVW3T5Z2bqslNdsAwCFCtghawmA6g6L4=
|
||||
github.com/android-sms-gateway/client-go v1.0.4 h1:QZ72TRBJKm11WL/jim+ba7m2J5RLBaICMcy7f/RVfuQ=
|
||||
github.com/android-sms-gateway/client-go v1.0.4/go.mod h1:DQsReciU1xcaVW3T5Z2bqslNdsAwCFCtghawmA6g6L4=
|
||||
github.com/andybalholm/brotli v1.1.0 h1:eLKJA0d02Lf0mVpIDgYnqXcUn0GqVmEFny3VuID1U3M=
|
||||
|
||||
@ -125,7 +125,7 @@ func (h *thirdPartyHandler) postMessage(user models.User, c *fiber.Ctx) error {
|
||||
// @Failure 400 {object} smsgateway.ErrorResponse "Invalid request"
|
||||
// @Failure 401 {object} smsgateway.ErrorResponse "Unauthorized"
|
||||
// @Failure 500 {object} smsgateway.ErrorResponse "Internal server error"
|
||||
// @Router /3rdparty/v1/message [get]
|
||||
// @Router /3rdparty/v1/message/{id} [get]
|
||||
//
|
||||
// Get message state
|
||||
func (h *thirdPartyHandler) getMessage(user models.User, c *fiber.Ctx) error {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user