Skip to content

Commit 98fd2d7

Browse files
committed
Add ability to store multiple heartbeats in 1 request
1 parent 50082e0 commit 98fd2d7

File tree

8 files changed

+200
-184
lines changed

8 files changed

+200
-184
lines changed

api/docs/docs.go

Lines changed: 51 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// Code generated by swaggo/swag. DO NOT EDIT.
2-
1+
// Package docs GENERATED BY SWAG; DO NOT EDIT
2+
// This file was generated by swaggo/swag
33
package docs
44

55
import "github.com/swaggo/swag"
@@ -1913,6 +1913,44 @@ const docTemplate = `{
19131913
}
19141914
}
19151915
}
1916+
},
1917+
"delete": {
1918+
"security": [
1919+
{
1920+
"ApiKeyAuth": []
1921+
}
1922+
],
1923+
"description": "Deletes the currently authenticated user together with all their data.",
1924+
"consumes": [
1925+
"application/json"
1926+
],
1927+
"produces": [
1928+
"application/json"
1929+
],
1930+
"tags": [
1931+
"Users"
1932+
],
1933+
"summary": "Delete a user",
1934+
"responses": {
1935+
"201": {
1936+
"description": "Created",
1937+
"schema": {
1938+
"$ref": "#/definitions/responses.NoContent"
1939+
}
1940+
},
1941+
"401": {
1942+
"description": "Unauthorized",
1943+
"schema": {
1944+
"$ref": "#/definitions/responses.Unauthorized"
1945+
}
1946+
},
1947+
"500": {
1948+
"description": "Internal Server Error",
1949+
"schema": {
1950+
"$ref": "#/definitions/responses.InternalServerError"
1951+
}
1952+
}
1953+
}
19161954
}
19171955
},
19181956
"/users/subscription": {
@@ -2669,11 +2707,7 @@ const docTemplate = `{
26692707
},
26702708
"sim": {
26712709
"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",
2672-
"allOf": [
2673-
{
2674-
"$ref": "#/definitions/entities.SIM"
2675-
}
2676-
],
2710+
"type": "string",
26772711
"example": "DEFAULT"
26782712
},
26792713
"status": {
@@ -2811,7 +2845,8 @@ const docTemplate = `{
28112845
"example": "+18005550199"
28122846
},
28132847
"sim": {
2814-
"$ref": "#/definitions/entities.SIM"
2848+
"description": "SIM card that received the message",
2849+
"type": "string"
28152850
},
28162851
"updated_at": {
28172852
"type": "string",
@@ -2823,48 +2858,6 @@ const docTemplate = `{
28232858
}
28242859
}
28252860
},
2826-
"entities.SIM": {
2827-
"type": "string",
2828-
"enum": [
2829-
"SIM1",
2830-
"SIM2"
2831-
],
2832-
"x-enum-varnames": [
2833-
"SIM1",
2834-
"SIM2"
2835-
]
2836-
},
2837-
"entities.SubscriptionName": {
2838-
"type": "string",
2839-
"enum": [
2840-
"free",
2841-
"pro-monthly",
2842-
"pro-yearly",
2843-
"ultra-monthly",
2844-
"ultra-yearly",
2845-
"pro-lifetime",
2846-
"20k-monthly",
2847-
"100k-monthly",
2848-
"50k-monthly",
2849-
"20k-yearly",
2850-
"100k-yearly",
2851-
"50k-yearly"
2852-
],
2853-
"x-enum-varnames": [
2854-
"SubscriptionNameFree",
2855-
"SubscriptionNameProMonthly",
2856-
"SubscriptionNameProYearly",
2857-
"SubscriptionNameUltraMonthly",
2858-
"SubscriptionNameUltraYearly",
2859-
"SubscriptionNameProLifetime",
2860-
"SubscriptionName20KMonthly",
2861-
"SubscriptionName100KMonthly",
2862-
"SubscriptionName50KMonthly",
2863-
"SubscriptionName20KYearly",
2864-
"SubscriptionName100KYearly",
2865-
"SubscriptionName50KYearly"
2866-
]
2867-
},
28682861
"entities.User": {
28692862
"type": "object",
28702863
"required": [
@@ -2926,11 +2919,7 @@ const docTemplate = `{
29262919
"example": "8f9c71b8-b84e-4417-8408-a62274f65a08"
29272920
},
29282921
"subscription_name": {
2929-
"allOf": [
2930-
{
2931-
"$ref": "#/definitions/entities.SubscriptionName"
2932-
}
2933-
],
2922+
"type": "string",
29342923
"example": "free"
29352924
},
29362925
"subscription_renews_at": {
@@ -3051,14 +3040,17 @@ const docTemplate = `{
30513040
"type": "object",
30523041
"required": [
30533042
"charging",
3054-
"owner"
3043+
"phone_numbers"
30553044
],
30563045
"properties": {
30573046
"charging": {
30583047
"type": "boolean"
30593048
},
3060-
"owner": {
3061-
"type": "string"
3049+
"phone_numbers": {
3050+
"type": "array",
3051+
"items": {
3052+
"type": "string"
3053+
}
30623054
}
30633055
}
30643056
},
@@ -3178,11 +3170,7 @@ const docTemplate = `{
31783170
},
31793171
"sim": {
31803172
"description": "SIM card that received the message",
3181-
"allOf": [
3182-
{
3183-
"$ref": "#/definitions/entities.SIM"
3184-
}
3185-
],
3173+
"type": "string",
31863174
"example": "SIM1"
31873175
},
31883176
"timestamp": {
@@ -3874,8 +3862,6 @@ var SwaggerInfo = &swag.Spec{
38743862
Description: "API to send SMS messages using android [SmsManager](https://developer.android.com/reference/android/telephony/SmsManager) via HTTP",
38753863
InfoInstanceName: "swagger",
38763864
SwaggerTemplate: docTemplate,
3877-
LeftDelim: "{{",
3878-
RightDelim: "}}",
38793865
}
38803866

38813867
func init() {

api/docs/swagger.json

Lines changed: 43 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1733,6 +1733,38 @@
17331733
}
17341734
}
17351735
}
1736+
},
1737+
"delete": {
1738+
"security": [
1739+
{
1740+
"ApiKeyAuth": []
1741+
}
1742+
],
1743+
"description": "Deletes the currently authenticated user together with all their data.",
1744+
"consumes": ["application/json"],
1745+
"produces": ["application/json"],
1746+
"tags": ["Users"],
1747+
"summary": "Delete a user",
1748+
"responses": {
1749+
"201": {
1750+
"description": "Created",
1751+
"schema": {
1752+
"$ref": "#/definitions/responses.NoContent"
1753+
}
1754+
},
1755+
"401": {
1756+
"description": "Unauthorized",
1757+
"schema": {
1758+
"$ref": "#/definitions/responses.Unauthorized"
1759+
}
1760+
},
1761+
"500": {
1762+
"description": "Internal Server Error",
1763+
"schema": {
1764+
"$ref": "#/definitions/responses.InternalServerError"
1765+
}
1766+
}
1767+
}
17361768
}
17371769
},
17381770
"/users/subscription": {
@@ -2445,11 +2477,7 @@
24452477
},
24462478
"sim": {
24472479
"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",
2448-
"allOf": [
2449-
{
2450-
"$ref": "#/definitions/entities.SIM"
2451-
}
2452-
],
2480+
"type": "string",
24532481
"example": "DEFAULT"
24542482
},
24552483
"status": {
@@ -2587,7 +2615,8 @@
25872615
"example": "+18005550199"
25882616
},
25892617
"sim": {
2590-
"$ref": "#/definitions/entities.SIM"
2618+
"description": "SIM card that received the message",
2619+
"type": "string"
25912620
},
25922621
"updated_at": {
25932622
"type": "string",
@@ -2599,42 +2628,6 @@
25992628
}
26002629
}
26012630
},
2602-
"entities.SIM": {
2603-
"type": "string",
2604-
"enum": ["SIM1", "SIM2"],
2605-
"x-enum-varnames": ["SIM1", "SIM2"]
2606-
},
2607-
"entities.SubscriptionName": {
2608-
"type": "string",
2609-
"enum": [
2610-
"free",
2611-
"pro-monthly",
2612-
"pro-yearly",
2613-
"ultra-monthly",
2614-
"ultra-yearly",
2615-
"pro-lifetime",
2616-
"20k-monthly",
2617-
"100k-monthly",
2618-
"50k-monthly",
2619-
"20k-yearly",
2620-
"100k-yearly",
2621-
"50k-yearly"
2622-
],
2623-
"x-enum-varnames": [
2624-
"SubscriptionNameFree",
2625-
"SubscriptionNameProMonthly",
2626-
"SubscriptionNameProYearly",
2627-
"SubscriptionNameUltraMonthly",
2628-
"SubscriptionNameUltraYearly",
2629-
"SubscriptionNameProLifetime",
2630-
"SubscriptionName20KMonthly",
2631-
"SubscriptionName100KMonthly",
2632-
"SubscriptionName50KMonthly",
2633-
"SubscriptionName20KYearly",
2634-
"SubscriptionName100KYearly",
2635-
"SubscriptionName50KYearly"
2636-
]
2637-
},
26382631
"entities.User": {
26392632
"type": "object",
26402633
"required": [
@@ -2696,11 +2689,7 @@
26962689
"example": "8f9c71b8-b84e-4417-8408-a62274f65a08"
26972690
},
26982691
"subscription_name": {
2699-
"allOf": [
2700-
{
2701-
"$ref": "#/definitions/entities.SubscriptionName"
2702-
}
2703-
],
2692+
"type": "string",
27042693
"example": "free"
27052694
},
27062695
"subscription_renews_at": {
@@ -2806,13 +2795,16 @@
28062795
},
28072796
"requests.HeartbeatStore": {
28082797
"type": "object",
2809-
"required": ["charging", "owner"],
2798+
"required": ["charging", "phone_numbers"],
28102799
"properties": {
28112800
"charging": {
28122801
"type": "boolean"
28132802
},
2814-
"owner": {
2815-
"type": "string"
2803+
"phone_numbers": {
2804+
"type": "array",
2805+
"items": {
2806+
"type": "string"
2807+
}
28162808
}
28172809
}
28182810
},
@@ -2908,11 +2900,7 @@
29082900
},
29092901
"sim": {
29102902
"description": "SIM card that received the message",
2911-
"allOf": [
2912-
{
2913-
"$ref": "#/definitions/entities.SIM"
2914-
}
2915-
],
2903+
"type": "string",
29162904
"example": "SIM1"
29172905
},
29182906
"timestamp": {

0 commit comments

Comments
 (0)