init
This commit is contained in:
6
app/schemas/__init__.py
Normal file
6
app/schemas/__init__.py
Normal file
@ -0,0 +1,6 @@
|
||||
from .token import Token, TokenPayload
|
||||
from .user import User, UserCreate, UserInDB, UserUpdate
|
||||
from .response import Response
|
||||
from .site import Site
|
||||
from .subscribe import Subscribe
|
||||
from .context import Context
|
BIN
app/schemas/__pycache__/__init__.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/__init__.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/context.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/context.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/response.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/response.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/site.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/site.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/subscribe.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/subscribe.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/token.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/token.cpython-310.pyc
Normal file
Binary file not shown.
BIN
app/schemas/__pycache__/user.cpython-310.pyc
Normal file
BIN
app/schemas/__pycache__/user.cpython-310.pyc
Normal file
Binary file not shown.
86
app/schemas/context.py
Normal file
86
app/schemas/context.py
Normal file
@ -0,0 +1,86 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class MetaInfo(BaseModel):
|
||||
# 是否处理的文件
|
||||
isfile: bool = False
|
||||
# 原字符串
|
||||
org_string: Optional[str] = None
|
||||
# 副标题
|
||||
subtitle: Optional[str] = None
|
||||
# 类型 电影、电视剧
|
||||
type: Optional[str] = None
|
||||
# 识别的中文名
|
||||
cn_name: Optional[str] = None
|
||||
# 识别的英文名
|
||||
en_name: Optional[str] = None
|
||||
# 年份
|
||||
year: Optional[str] = None
|
||||
# 总季数
|
||||
total_seasons: int = 0
|
||||
# 识别的开始季 数字
|
||||
begin_season: Optional[int] = None
|
||||
# 识别的结束季 数字
|
||||
end_season: Optional[int] = None
|
||||
# 总集数
|
||||
total_episodes: int = 0
|
||||
# 识别的开始集
|
||||
begin_episode: Optional[int] = None
|
||||
# 识别的结束集
|
||||
end_episode: Optional[int] = None
|
||||
# Partx Cd Dvd Disk Disc
|
||||
part: Optional[str] = None
|
||||
# 识别的资源类型
|
||||
resource_type: Optional[str] = None
|
||||
# 识别的效果
|
||||
resource_effect: Optional[str] = None
|
||||
# 识别的分辨率
|
||||
resource_pix: Optional[str] = None
|
||||
# 识别的制作组/字幕组
|
||||
resource_team: Optional[str] = None
|
||||
# 视频编码
|
||||
video_encode: Optional[str] = None
|
||||
# 音频编码
|
||||
audio_encode: Optional[str] = None
|
||||
|
||||
|
||||
class MediaInfo(BaseModel):
|
||||
# 类型 电影、电视剧
|
||||
type: Optional[str] = None
|
||||
# 媒体标题
|
||||
title: Optional[str] = None
|
||||
# 年份
|
||||
year: Optional[str] = None
|
||||
# TMDB ID
|
||||
tmdb_id: Optional[str] = None
|
||||
# IMDB ID
|
||||
imdb_id: Optional[str] = None
|
||||
# TVDB ID
|
||||
tvdb_id: Optional[str] = None
|
||||
# 豆瓣ID
|
||||
douban_id: Optional[str] = None
|
||||
# 媒体原语种
|
||||
original_language: Optional[str] = None
|
||||
# 媒体原发行标题
|
||||
original_title: Optional[str] = None
|
||||
# 媒体发行日期
|
||||
release_date: Optional[str] = None
|
||||
# 背景图片
|
||||
backdrop_path: Optional[str] = None
|
||||
# 海报图片
|
||||
poster_path: Optional[str] = None
|
||||
# 评分
|
||||
vote_average: int = 0
|
||||
# 描述
|
||||
overview: Optional[str] = None
|
||||
# 二级分类
|
||||
category: str = ""
|
||||
|
||||
|
||||
class Context(BaseModel):
|
||||
# 元数据
|
||||
meta_info: Optional[MetaInfo]
|
||||
# 媒体信息
|
||||
media_info: Optional[MediaInfo]
|
8
app/schemas/response.py
Normal file
8
app/schemas/response.py
Normal file
@ -0,0 +1,8 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Response(BaseModel):
|
||||
success: bool
|
||||
message: Optional[str] = None
|
23
app/schemas/site.py
Normal file
23
app/schemas/site.py
Normal file
@ -0,0 +1,23 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Site(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
domain: str
|
||||
url: str
|
||||
pri: Optional[int] = 0
|
||||
rss: Optional[str] = None
|
||||
cookie: Optional[str] = None
|
||||
ua: Optional[str] = None
|
||||
filter: Optional[str] = None
|
||||
note: Optional[str] = None
|
||||
limit_interval: Optional[int] = 0
|
||||
limit_count: Optional[int] = 0
|
||||
limit_seconds: Optional[int] = 0
|
||||
is_active: Optional[str] = 'N'
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
26
app/schemas/subscribe.py
Normal file
26
app/schemas/subscribe.py
Normal file
@ -0,0 +1,26 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Subscribe(BaseModel):
|
||||
id: int
|
||||
name: str
|
||||
year: str
|
||||
type: str
|
||||
keyword: Optional[str]
|
||||
tmdbid: str
|
||||
doubanid: Optional[str]
|
||||
season: Optional[int]
|
||||
image: Optional[str]
|
||||
description: Optional[str]
|
||||
filter: Optional[str]
|
||||
include: Optional[str]
|
||||
exclude: Optional[str]
|
||||
total_episode: Optional[int]
|
||||
start_episode: Optional[int]
|
||||
lack_episode: Optional[int]
|
||||
note: Optional[str]
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
12
app/schemas/token.py
Normal file
12
app/schemas/token.py
Normal file
@ -0,0 +1,12 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
class Token(BaseModel):
|
||||
access_token: str
|
||||
token_type: str
|
||||
|
||||
|
||||
class TokenPayload(BaseModel):
|
||||
sub: Optional[int] = None
|
42
app/schemas/user.py
Normal file
42
app/schemas/user.py
Normal file
@ -0,0 +1,42 @@
|
||||
from typing import Optional
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
|
||||
# Shared properties
|
||||
class UserBase(BaseModel):
|
||||
email: Optional[str] = None
|
||||
is_active: Optional[bool] = True
|
||||
is_superuser: bool = False
|
||||
full_name: Optional[str] = None
|
||||
|
||||
|
||||
# Properties to receive via API on creation
|
||||
class UserCreate(UserBase):
|
||||
full_name: str
|
||||
email: str
|
||||
password: str
|
||||
|
||||
|
||||
# Properties to receive via API on update
|
||||
class UserUpdate(UserBase):
|
||||
full_name: str
|
||||
password: Optional[str] = None
|
||||
|
||||
|
||||
class UserInDBBase(UserBase):
|
||||
id: Optional[int] = None
|
||||
|
||||
class Config:
|
||||
orm_mode = True
|
||||
|
||||
|
||||
# Additional properties to return via API
|
||||
class User(UserInDBBase):
|
||||
full_name: str
|
||||
email: str
|
||||
|
||||
|
||||
# Additional properties stored in DB
|
||||
class UserInDB(UserInDBBase):
|
||||
hashed_password: str
|
Reference in New Issue
Block a user