Skip to content

Commit

Permalink
Add ability to store multiple heartbeats in 1 request
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Nov 25, 2024
1 parent 50082e0 commit 98fd2d7
Show file tree
Hide file tree
Showing 8 changed files with 200 additions and 184 deletions.
116 changes: 51 additions & 65 deletions api/docs/docs.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Code generated by swaggo/swag. DO NOT EDIT.

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import "github.com/swaggo/swag"
Expand Down Expand Up @@ -1913,6 +1913,44 @@ const docTemplate = `{
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Deletes the currently authenticated user together with all their data.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Users"
],
"summary": "Delete a user",
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/responses.NoContent"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/users/subscription": {
Expand Down Expand Up @@ -2669,11 +2707,7 @@ const docTemplate = `{
},
"sim": {
"description": "SIM is the SIM card to use to send the message\n* SMS1: use the SIM card in slot 1\n* SMS2: use the SIM card in slot 2\n* DEFAULT: used the default communication SIM card",
"allOf": [
{
"$ref": "#/definitions/entities.SIM"
}
],
"type": "string",
"example": "DEFAULT"
},
"status": {
Expand Down Expand Up @@ -2811,7 +2845,8 @@ const docTemplate = `{
"example": "+18005550199"
},
"sim": {
"$ref": "#/definitions/entities.SIM"
"description": "SIM card that received the message",
"type": "string"
},
"updated_at": {
"type": "string",
Expand All @@ -2823,48 +2858,6 @@ const docTemplate = `{
}
}
},
"entities.SIM": {
"type": "string",
"enum": [
"SIM1",
"SIM2"
],
"x-enum-varnames": [
"SIM1",
"SIM2"
]
},
"entities.SubscriptionName": {
"type": "string",
"enum": [
"free",
"pro-monthly",
"pro-yearly",
"ultra-monthly",
"ultra-yearly",
"pro-lifetime",
"20k-monthly",
"100k-monthly",
"50k-monthly",
"20k-yearly",
"100k-yearly",
"50k-yearly"
],
"x-enum-varnames": [
"SubscriptionNameFree",
"SubscriptionNameProMonthly",
"SubscriptionNameProYearly",
"SubscriptionNameUltraMonthly",
"SubscriptionNameUltraYearly",
"SubscriptionNameProLifetime",
"SubscriptionName20KMonthly",
"SubscriptionName100KMonthly",
"SubscriptionName50KMonthly",
"SubscriptionName20KYearly",
"SubscriptionName100KYearly",
"SubscriptionName50KYearly"
]
},
"entities.User": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2926,11 +2919,7 @@ const docTemplate = `{
"example": "8f9c71b8-b84e-4417-8408-a62274f65a08"
},
"subscription_name": {
"allOf": [
{
"$ref": "#/definitions/entities.SubscriptionName"
}
],
"type": "string",
"example": "free"
},
"subscription_renews_at": {
Expand Down Expand Up @@ -3051,14 +3040,17 @@ const docTemplate = `{
"type": "object",
"required": [
"charging",
"owner"
"phone_numbers"
],
"properties": {
"charging": {
"type": "boolean"
},
"owner": {
"type": "string"
"phone_numbers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down Expand Up @@ -3178,11 +3170,7 @@ const docTemplate = `{
},
"sim": {
"description": "SIM card that received the message",
"allOf": [
{
"$ref": "#/definitions/entities.SIM"
}
],
"type": "string",
"example": "SIM1"
},
"timestamp": {
Expand Down Expand Up @@ -3874,8 +3862,6 @@ var SwaggerInfo = &swag.Spec{
Description: "API to send SMS messages using android [SmsManager](https://developer.android.com/reference/android/telephony/SmsManager) via HTTP",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
LeftDelim: "{{",
RightDelim: "}}",
}

func init() {
Expand Down
98 changes: 43 additions & 55 deletions api/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,38 @@
}
}
}
},
"delete": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Deletes the currently authenticated user together with all their data.",
"consumes": ["application/json"],
"produces": ["application/json"],
"tags": ["Users"],
"summary": "Delete a user",
"responses": {
"201": {
"description": "Created",
"schema": {
"$ref": "#/definitions/responses.NoContent"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/responses.Unauthorized"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/responses.InternalServerError"
}
}
}
}
},
"/users/subscription": {
Expand Down Expand Up @@ -2445,11 +2477,7 @@
},
"sim": {
"description": "SIM is the SIM card to use to send the message\n* SMS1: use the SIM card in slot 1\n* SMS2: use the SIM card in slot 2\n* DEFAULT: used the default communication SIM card",
"allOf": [
{
"$ref": "#/definitions/entities.SIM"
}
],
"type": "string",
"example": "DEFAULT"
},
"status": {
Expand Down Expand Up @@ -2587,7 +2615,8 @@
"example": "+18005550199"
},
"sim": {
"$ref": "#/definitions/entities.SIM"
"description": "SIM card that received the message",
"type": "string"
},
"updated_at": {
"type": "string",
Expand All @@ -2599,42 +2628,6 @@
}
}
},
"entities.SIM": {
"type": "string",
"enum": ["SIM1", "SIM2"],
"x-enum-varnames": ["SIM1", "SIM2"]
},
"entities.SubscriptionName": {
"type": "string",
"enum": [
"free",
"pro-monthly",
"pro-yearly",
"ultra-monthly",
"ultra-yearly",
"pro-lifetime",
"20k-monthly",
"100k-monthly",
"50k-monthly",
"20k-yearly",
"100k-yearly",
"50k-yearly"
],
"x-enum-varnames": [
"SubscriptionNameFree",
"SubscriptionNameProMonthly",
"SubscriptionNameProYearly",
"SubscriptionNameUltraMonthly",
"SubscriptionNameUltraYearly",
"SubscriptionNameProLifetime",
"SubscriptionName20KMonthly",
"SubscriptionName100KMonthly",
"SubscriptionName50KMonthly",
"SubscriptionName20KYearly",
"SubscriptionName100KYearly",
"SubscriptionName50KYearly"
]
},
"entities.User": {
"type": "object",
"required": [
Expand Down Expand Up @@ -2696,11 +2689,7 @@
"example": "8f9c71b8-b84e-4417-8408-a62274f65a08"
},
"subscription_name": {
"allOf": [
{
"$ref": "#/definitions/entities.SubscriptionName"
}
],
"type": "string",
"example": "free"
},
"subscription_renews_at": {
Expand Down Expand Up @@ -2806,13 +2795,16 @@
},
"requests.HeartbeatStore": {
"type": "object",
"required": ["charging", "owner"],
"required": ["charging", "phone_numbers"],
"properties": {
"charging": {
"type": "boolean"
},
"owner": {
"type": "string"
"phone_numbers": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
Expand Down Expand Up @@ -2908,11 +2900,7 @@
},
"sim": {
"description": "SIM card that received the message",
"allOf": [
{
"$ref": "#/definitions/entities.SIM"
}
],
"type": "string",
"example": "SIM1"
},
"timestamp": {
Expand Down
Loading

0 comments on commit 98fd2d7

Please sign in to comment.