donat-widget/internal/docs/swagger.yaml

570 lines
14 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.FilterSettingResponse:
properties:
enable_links:
type: boolean
filtered_words:
items:
type: string
type: array
type: object
donat-widget_internal_model.InnerDonatePageResponse:
properties:
avatar:
type: string
background_img:
type: string
description:
type: string
head_img:
type: string
text_after_donat:
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:
type: string
background_img:
type: string
description:
type: string
head_img:
type: string
login:
type: string
online:
type: string
type: object
donat-widget_internal_model.UpdateDonatPage:
properties:
description:
type: string
page_background:
type: string
profile_avatar:
type: boolean
text_after_donat:
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
min_price:
type: integer
scenery:
type: string
voice_sound_percent:
type: integer
voice_speed:
type: integer
type: object
donat-widget_internal_model.VoiceSettingsResponse:
properties:
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:
consumes:
- application/json
description: Update personal streamer donate page.
parameters:
- description: Update fields
in: body
name: request
required: true
schema:
$ref: '#/definitions/donat-widget_internal_model.UpdateDonatPage'
- description: Background image
in: formData
name: background
type: file
- description: Head image
in: formData
name: head-img
type: file
produces:
- application/json
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
/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'
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'
- description: Background image
in: formData
name: background
type: file
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'
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'
summary: Get donat moderation settings
tags:
- Donate
patch:
consumes:
- application/json
description: Update donat moderation settings
produces:
- application/json
responses:
"200":
description: Update moderation settings
schema:
$ref: '#/definitions/donat-widget_internal_model.UpdateModeration'
"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: 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'
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'
- description: Background image
in: formData
name: background
type: file
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'
summary: Update donat voice settings.
tags:
- Donate
/widgets:
get:
consumes:
- application/json
description: Get all streamer's widgets
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: Get all streamer's widgets
tags:
- GetWidgetDb
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:
- GetWidgetDb
securityDefinitions:
BearerAuth:
in: header
name: Authorization
type: apiKey
swagger: "2.0"