Initial commit: AuroraMusic monorepo
This commit is contained in:
@@ -0,0 +1,71 @@
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from typing import Literal
|
||||
|
||||
from pydantic import BaseModel, EmailStr, Field
|
||||
|
||||
|
||||
class SignupRequest(BaseModel):
|
||||
email: EmailStr
|
||||
password: str = Field(min_length=8, max_length=200)
|
||||
display_name: str = Field(min_length=1, max_length=100)
|
||||
|
||||
|
||||
class LoginRequest(BaseModel):
|
||||
email: EmailStr
|
||||
password: str
|
||||
|
||||
|
||||
class TokenResponse(BaseModel):
|
||||
access_token: str
|
||||
token_type: str = "bearer"
|
||||
|
||||
|
||||
class UserOut(BaseModel):
|
||||
id: uuid.UUID
|
||||
email: EmailStr
|
||||
display_name: str
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class SongCreateRequest(BaseModel):
|
||||
title: str = Field(min_length=1, max_length=200)
|
||||
prompt: str = Field(min_length=1, max_length=2000)
|
||||
mode: Literal["instrumental", "vocals"] = "instrumental"
|
||||
lyrics: str | None = Field(default=None, max_length=4000)
|
||||
is_public: bool = False
|
||||
|
||||
|
||||
class SongUpdateRequest(BaseModel):
|
||||
title: str | None = Field(default=None, min_length=1, max_length=200)
|
||||
is_public: bool | None = None
|
||||
|
||||
|
||||
class SongOut(BaseModel):
|
||||
id: uuid.UUID
|
||||
user_id: uuid.UUID
|
||||
owner_display_name: str | None = None
|
||||
title: str
|
||||
prompt: str
|
||||
lyrics: str | None
|
||||
mode: str
|
||||
status: str
|
||||
error_message: str | None
|
||||
duration_seconds: float | None
|
||||
cover_seed: int
|
||||
is_public: bool
|
||||
like_count: int
|
||||
liked_by_me: bool = False
|
||||
audio_url: str | None = None
|
||||
created_at: datetime
|
||||
|
||||
class Config:
|
||||
from_attributes = True
|
||||
|
||||
|
||||
class SongListResponse(BaseModel):
|
||||
items: list[SongOut]
|
||||
total: int
|
||||
Reference in New Issue
Block a user