donat-widget/internal/docs/swagger.json

1233 lines
42 KiB
JSON

{
"swagger": "2.0",
"info": {
"description": "Donate auth service docs.",
"title": "Donate Auth Documentation",
"contact": {},
"version": "3.0"
},
"basePath": "/api/widget",
"paths": {
"/donat-page": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update personal streamer donate page with optional background and head image files.",
"tags": [
"Donate"
],
"summary": "Update personal streamer donate page",
"parameters": [
{
"type": "string",
"example": "A great donation page",
"name": "description",
"in": "formData"
},
{
"type": "string",
"example": "#13161E",
"name": "page_background",
"in": "formData"
},
{
"type": "boolean",
"example": true,
"name": "profile_avatar",
"in": "formData"
},
{
"type": "string",
"example": "Thank you for your support!",
"name": "text_after_donat",
"in": "formData"
},
{
"type": "file",
"description": "Background image",
"name": "background",
"in": "formData"
},
{
"type": "file",
"description": "Head image",
"name": "head_img",
"in": "formData"
}
],
"responses": {
"200": {
"description": "Donat page updated successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/files": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Add new File",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Files"
],
"summary": "Add new File",
"parameters": [
{
"type": "file",
"description": "New file",
"name": "new_file",
"in": "formData"
}
],
"responses": {
"200": {
"description": "GetWidgetDb has been uploaded successfully!",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/files/widgets": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Retrieve all widget files, filtered by type if specified",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Files"
],
"summary": "Get all widget files",
"parameters": [
{
"enum": [
"audio",
"image"
],
"type": "string",
"description": "File type (audio or image)",
"name": "type",
"in": "query"
}
],
"responses": {
"200": {
"description": "List of files",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/donat-widget_internal_model.DataFile"
}
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/files/{file_id}": {
"get": {
"description": "Retrieve a file by its ID",
"consumes": [
"application/json"
],
"produces": [
"application/octet-stream"
],
"tags": [
"Files"
],
"summary": "Get a file",
"parameters": [
{
"type": "string",
"description": "File ID",
"name": "file_id",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "File content",
"schema": {
"type": "file"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"404": {
"description": "File not found",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/filters-settings": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get donat filters settings",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Get donat filters settings",
"responses": {
"200": {
"description": "Current filters settings",
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.FilterSettingResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update donat filters settings.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Update donat filters settings.",
"parameters": [
{
"description": "Update fields",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.UpdateFilterSettings"
}
}
],
"responses": {
"200": {
"description": "Voice settings updated successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/inner-donate-page": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get inner donate page info",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Get inner donate page info",
"responses": {
"200": {
"description": "Current donate page state",
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.InnerDonatePageResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/moderation-settings": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get donat moderation settings",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Get donat moderation settings",
"responses": {
"200": {
"description": "Current moderation settings",
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.ModerationResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update donat moderation settings",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Update donat moderation settings",
"parameters": [
{
"description": "Update fields",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.UpdateModeration"
}
}
],
"responses": {
"200": {
"description": "Moderation settings updated successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/outer-donate-page/{streamer-login}": {
"get": {
"description": "Get outer donate page info",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Get outer donate page info",
"parameters": [
{
"type": "string",
"description": "Login стримера",
"name": "streamer-login",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "Current donate page state",
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.OuterDonatePageResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/voice-settings": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get donat voice settings",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Get donat voice settings",
"responses": {
"200": {
"description": "Current voice settings",
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.VoiceSettingsResponse"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
},
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update donat voice settings.",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Donate"
],
"summary": "Update donat voice settings.",
"parameters": [
{
"description": "Update fields",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.UpdateVoiceSettings"
}
}
],
"responses": {
"200": {
"description": "Voice settings updated successfully",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/widgets": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "Get all streamer's widgets",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Widget"
],
"summary": "Get all streamer's widgets",
"responses": {
"200": {
"description": "Success widgets response",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/donat-widget_internal_model.GetWidgetDb"
}
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
},
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Create new widget",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Widget"
],
"summary": "Create new widget",
"parameters": [
{
"description": "Create widget",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.CreateWidgetBody"
}
}
],
"responses": {
"200": {
"description": "GetWidgetDb has been created successfully!",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
},
"/widgets/{widget_id}": {
"patch": {
"security": [
{
"BearerAuth": []
}
],
"description": "Update an existing widget",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Widget"
],
"summary": "Update an existing widget",
"parameters": [
{
"type": "integer",
"description": "Widget ID",
"name": "widget_id",
"in": "path",
"required": true
},
{
"description": "Update widget",
"name": "request",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/donat-widget_internal_model.UpdateWidget"
}
}
],
"responses": {
"200": {
"description": "Widget has been updated successfully!",
"schema": {
"type": "string"
}
},
"400": {
"description": "Bad request",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"401": {
"description": "Unauthorized or expired token",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"404": {
"description": "Widget not found",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
},
"422": {
"description": "Validation error",
"schema": {
"$ref": "#/definitions/echo.HTTPError"
}
}
}
}
}
},
"definitions": {
"donat-widget_internal_model.CreateWidgetBody": {
"type": "object",
"required": [
"audio",
"duration",
"image",
"max_amount",
"min_amount",
"name",
"template_id"
],
"properties": {
"audio": {
"type": "string",
"format": "uuid",
"example": "550e8400-e29b-41d4-a716-446655440001"
},
"duration": {
"type": "integer",
"example": 30
},
"image": {
"type": "string",
"format": "uuid",
"example": "550e8400-e29b-41d4-a716-446655440000"
},
"max_amount": {
"type": "integer",
"example": 100
},
"min_amount": {
"type": "integer",
"example": 10
},
"name": {
"type": "string",
"example": "My GetWidgetDb"
},
"template_id": {
"type": "integer",
"example": 1
}
}
},
"donat-widget_internal_model.DataFile": {
"type": "object",
"properties": {
"created_at": {
"type": "string"
},
"entity": {
"type": "string"
},
"extension": {
"type": "string"
},
"file_link": {
"type": "string"
},
"file_name": {
"type": "string"
},
"file_type": {
"type": "string"
},
"id": {
"type": "string"
},
"size": {
"type": "number"
},
"streamer_id": {
"type": "integer"
}
}
},
"donat-widget_internal_model.FilterSettingResponse": {
"type": "object",
"properties": {
"enable_links": {
"type": "boolean"
},
"filtered_words": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"donat-widget_internal_model.GetWidgetDb": {
"type": "object",
"properties": {
"audio_file_name": {
"type": "string",
"example": "alert.mp3"
},
"audio_id": {
"description": "Поля для аудио",
"type": "string",
"format": "uuid",
"example": "123e4567-e89b-12d3-a456-426614174000"
},
"audio_link": {
"type": "string",
"example": "https://cdn.example.com/audio/123e4567-e89b-12d3-a456-426614174000"
},
"audio_type": {
"type": "string",
"example": "audio/mp3"
},
"created_at": {
"type": "string",
"format": "date-time",
"example": "2025-03-06T13:37:36Z"
},
"duration": {
"type": "integer",
"format": "int64",
"example": 30
},
"group_id": {
"type": "integer",
"format": "int64",
"example": 2
},
"id": {
"type": "integer",
"format": "int64",
"example": 1
},
"image_file_name": {
"type": "string",
"example": "background.png"
},
"image_id": {
"description": "Поля для изображения",
"type": "string",
"format": "uuid",
"example": "550e8400-e29b-41d4-a716-446655440000"
},
"image_link": {
"type": "string",
"example": "https://cdn.example.com/images/550e8400-e29b-41d4-a716-446655440000"
},
"image_type": {
"type": "string",
"example": "image/png"
},
"is_active": {
"type": "boolean",
"example": true
},
"max_amount": {
"type": "integer",
"format": "int64",
"example": 1000
},
"min_amount": {
"type": "integer",
"format": "int64",
"example": 100
},
"streamer_id": {
"type": "integer",
"format": "int64",
"example": 1001
},
"template_id": {
"type": "integer",
"format": "int64",
"example": 5
},
"updated_at": {
"type": "string",
"format": "date-time",
"example": "2025-03-07T10:15:30Z"
}
}
},
"donat-widget_internal_model.InnerDonatePageResponse": {
"type": "object",
"properties": {
"avatar": {
"$ref": "#/definitions/donat-widget_internal_model.InnerFile"
},
"background_img": {
"$ref": "#/definitions/donat-widget_internal_model.InnerFile"
},
"description": {
"type": "string"
},
"head_img": {
"$ref": "#/definitions/donat-widget_internal_model.InnerFile"
},
"text_after_donat": {
"type": "string"
}
}
},
"donat-widget_internal_model.InnerFile": {
"type": "object",
"properties": {
"file_id": {
"type": "string",
"example": "550e8400-e29b-41d4-a716-446655440000"
},
"file_link": {
"type": "string",
"example": "https://cdn.example.com/images/550e8400-e29b-41d4-a716-446655440000"
},
"file_name": {
"type": "string",
"example": "header.png"
},
"file_size": {
"type": "integer",
"example": 1024
},
"file_type": {
"type": "string",
"example": "image/png"
}
}
},
"donat-widget_internal_model.Language": {
"type": "object",
"properties": {
"en_name": {
"type": "string"
},
"id": {
"type": "integer"
},
"iso_code": {
"type": "string"
},
"ru_name": {
"type": "string"
}
}
},
"donat-widget_internal_model.ModerationResponse": {
"type": "object",
"properties": {
"duration": {
"type": "integer"
},
"enable": {
"type": "boolean"
}
}
},
"donat-widget_internal_model.OuterDonatePageResponse": {
"type": "object",
"properties": {
"avatar_img": {
"type": "string",
"example": "https://cdn.example.com/images/avatar.png"
},
"background_img": {
"type": "string",
"example": "https://cdn.example.com/images/background.png"
},
"description": {
"type": "string",
"example": "Поддержи этого стримера"
},
"head_img": {
"type": "string",
"example": "https://cdn.example.com/images/header.png"
},
"login": {
"type": "string",
"example": "streamer123"
},
"online": {
"type": "string",
"example": "online"
}
}
},
"donat-widget_internal_model.UpdateFilterSettings": {
"type": "object",
"properties": {
"add_words": {
"type": "array",
"items": {
"type": "string"
}
},
"enable_links": {
"type": "boolean"
},
"remove_words": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"donat-widget_internal_model.UpdateModeration": {
"type": "object",
"properties": {
"duration": {
"type": "integer"
},
"enable": {
"type": "boolean"
}
}
},
"donat-widget_internal_model.UpdateVoiceSettings": {
"type": "object",
"properties": {
"enable": {
"type": "boolean"
},
"languages": {
"type": "array",
"items": {
"type": "string"
}
},
"min_price": {
"type": "integer"
},
"scenery": {
"type": "string"
},
"voice_sound_percent": {
"type": "integer"
},
"voice_speed": {
"type": "integer"
}
}
},
"donat-widget_internal_model.UpdateWidget": {
"type": "object",
"properties": {
"audio": {
"type": "string",
"example": "a0f9e244-f61f-4bfe-a7a0-3b5e91fe7364"
},
"duration": {
"type": "integer",
"example": 120
},
"image": {
"type": "string",
"example": "d2c2f03f-3fe5-4bfc-b963-5478a057149e"
},
"is_active": {
"type": "boolean",
"example": true
},
"max_amount": {
"type": "integer",
"example": 100
},
"min_amount": {
"type": "integer",
"example": 10
},
"name": {
"type": "string",
"example": "Awesome Widget"
}
}
},
"donat-widget_internal_model.VoiceSettingsResponse": {
"type": "object",
"properties": {
"languages": {
"description": "Новое поле",
"type": "array",
"items": {
"$ref": "#/definitions/donat-widget_internal_model.Language"
}
},
"min_price": {
"type": "integer"
},
"scenery": {
"type": "string"
},
"voice_sound_percent": {
"type": "integer"
},
"voice_speed": {
"type": "integer"
}
}
},
"echo.HTTPError": {
"type": "object",
"properties": {
"message": {}
}
}
},
"securityDefinitions": {
"BearerAuth": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
}
}