108 lines
4.0 KiB
Python
108 lines
4.0 KiB
Python
from rest_framework.schemas import AutoSchema
|
||
import coreapi
|
||
import coreschema
|
||
|
||
class SongSchema(AutoSchema):
|
||
def get_serializer_fields(self, path, method):
|
||
return [
|
||
coreapi.Field(
|
||
name='azura_id',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='ID трека с Азуры')
|
||
),
|
||
coreapi.Field(
|
||
name='title',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Название трека')
|
||
),
|
||
coreapi.Field(
|
||
name='artist',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Исполнитель')
|
||
),
|
||
coreapi.Field(
|
||
name='album',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Альбом трека')
|
||
),
|
||
coreapi.Field(
|
||
name='genre',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Жанр трека')
|
||
),
|
||
coreapi.Field(
|
||
name='art',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Изображение трека')
|
||
),
|
||
]
|
||
|
||
class DeleteSongSchema(AutoSchema):
|
||
def get_serializer_fields(self, path, method):
|
||
return [
|
||
coreapi.Field(
|
||
name='azura_id',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='ID трека с Азуры')
|
||
),
|
||
]
|
||
|
||
class PlayListSchema(AutoSchema):
|
||
def get_serializer_fields(self, path, method):
|
||
return [
|
||
coreapi.Field(
|
||
name='name',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Название плейлиста')
|
||
),
|
||
coreapi.Field(
|
||
name='playlist_art',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.Integer(description='Обложка плейлиста')
|
||
),
|
||
coreapi.Field(
|
||
name='azura_id',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='ID трека с Азуры')
|
||
),
|
||
coreapi.Field(
|
||
name='title',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Название трека')
|
||
),
|
||
coreapi.Field(
|
||
name='artist',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Исполнитель')
|
||
),
|
||
coreapi.Field(
|
||
name='album',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Альбом трека')
|
||
),
|
||
coreapi.Field(
|
||
name='genre',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Жанр трека')
|
||
),
|
||
coreapi.Field(
|
||
name='art',
|
||
location='form',
|
||
required=False,
|
||
schema=coreschema.String(description='Изображение трека')
|
||
),
|
||
] |