36 lines
823 B
Python
36 lines
823 B
Python
from fastapi import APIRouter, HTTPException
|
|
import uuid
|
|
|
|
playlists = [] # In-memory storage
|
|
|
|
router = APIRouter()
|
|
|
|
@router.post("/login")
|
|
async def create_playlist(
|
|
name: str = "My Playlist",
|
|
description: str = "My awesome playlist",
|
|
user_id: str = "user_123"
|
|
):
|
|
"""Create new playlist endpoint"""
|
|
playlist_id = str(uuid.uuid4())
|
|
|
|
playlist = {
|
|
"id": playlist_id,
|
|
"name": name,
|
|
"description": description,
|
|
"user_id": user_id,
|
|
"tracks": [],
|
|
"created_at": "2024-01-01T00:00:00Z"
|
|
}
|
|
|
|
playlists.append(playlist)
|
|
|
|
return {
|
|
"message": "Playlist created successfully",
|
|
"playlist_id": playlist_id,
|
|
"name": name,
|
|
"features": {
|
|
"max_tracks": 100,
|
|
"visibility": "public"
|
|
}
|
|
} |