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