ITRadio/server/proj/audio/schemas.py

55 lines
1.9 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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='song_id',
location='form',
required=False,
schema=coreschema.String(description='ID трека')
),
]