340 lines
8.0 KiB
Python
340 lines
8.0 KiB
Python
from pydantic import BaseModel, Field
|
|
from typing import Optional, List, Dict, Union, Any
|
|
|
|
|
|
# فیلد اجباری:
|
|
# str = Field(..., description=)
|
|
# فیلد اختیاری:
|
|
# Optional[str] = Field("", description=)
|
|
|
|
|
|
class Properties(BaseModel):
|
|
"""
|
|
Standard Form Of Foreign Key To Other Index
|
|
"""
|
|
|
|
id: str = Field(..., description="شناسه یکتا")
|
|
title: Optional[str] = Field("", description="عنوان")
|
|
author: Optional[str] = Field("", description="سازنده")
|
|
sub_type: Optional[str] = Field("", description="نوع دوم")
|
|
|
|
|
|
class TreeInfo(BaseModel):
|
|
title: str
|
|
parent_id: str = Field(..., description="")
|
|
child_order: int
|
|
level: int
|
|
full_path: Optional[str] = Field("", description="")
|
|
path_headings: str
|
|
|
|
|
|
class NlpParses(BaseModel):
|
|
main_type: str
|
|
nlp_type: str
|
|
begin: int
|
|
end: int
|
|
text: str
|
|
referes: str
|
|
dependency_infos: str # nested
|
|
|
|
|
|
class Embeddings(BaseModel):
|
|
type: Optional[str] = (Field("", description=""),)
|
|
dims: Optional[int] = (Field(1024, description=""),)
|
|
index: Optional[bool] = (Field(True, description=""),)
|
|
similarity: Optional[str] = Field("", description="")
|
|
|
|
|
|
class FileLinks(BaseModel):
|
|
title: str
|
|
link: str
|
|
type: str
|
|
description: str
|
|
|
|
|
|
class UserLogs(BaseModel):
|
|
id: str
|
|
user_id: int
|
|
username: str
|
|
time_edit: int
|
|
property: str
|
|
|
|
|
|
class MnSection(BaseModel):
|
|
id: str
|
|
old_id: str
|
|
main_type: str
|
|
html: str
|
|
content: str
|
|
meet_info: Properties
|
|
term_info: Properties
|
|
tree_info: TreeInfo
|
|
content_len: int
|
|
word_len: int
|
|
tags: str
|
|
keywords: str
|
|
sort_date_timestamp: int
|
|
nlp_parses: NlpParses
|
|
embeddings: Embeddings
|
|
file_links: FileLinks
|
|
time_edit: int
|
|
user_edit: int
|
|
user_logs: UserLogs
|
|
|
|
|
|
class MnTerm(BaseModel):
|
|
id: str
|
|
author: str
|
|
sub_type: Optional[str] = ""
|
|
title: Optional[str] = ""
|
|
begin_date: Optional[int] = ""
|
|
end_date: Optional[int] = ""
|
|
begin_year: Optional[int] = ""
|
|
main_type: Optional[str] = ""
|
|
content: Optional[str] = ""
|
|
tags: Optional[str] = ""
|
|
keywords: Optional[str] = ""
|
|
|
|
|
|
class MnMeetEntity(BaseModel):
|
|
id: str
|
|
main_type: str
|
|
sub_type: str
|
|
title: str
|
|
content: str
|
|
permit_tags: str
|
|
search_state: str
|
|
user_create: str
|
|
time_create: int
|
|
time_edit: int
|
|
file_links: FileLinks
|
|
meet_info: Properties
|
|
term_info: Properties
|
|
|
|
|
|
class Subjects(BaseModel):
|
|
id: int
|
|
title: str
|
|
|
|
|
|
class ReportInfo(BaseModel):
|
|
films: int
|
|
sounds: int
|
|
photos: int
|
|
|
|
|
|
class MnMeet(BaseModel):
|
|
"""
|
|
Monir Meet Standard fields foramt
|
|
"""
|
|
|
|
id: str
|
|
sanad_id: str
|
|
main_type: str
|
|
sub_type: Optional[str] = ""
|
|
person_code: Optional[str] = ""
|
|
research_code: str
|
|
meet_code: str
|
|
old_meet_id: int
|
|
title: str
|
|
meet_no: int
|
|
author: str
|
|
term_info: Optional[Properties] = Field("", description="کلید اتصال به جدول ترم")
|
|
subtitle: str
|
|
subjects: Optional[List[Subjects]] = []
|
|
allwords: str
|
|
tags: Optional[List[str]] = []
|
|
keywords: str
|
|
verb: str
|
|
sanad_year: Optional[int] = ""
|
|
sanad_date: Optional[int] = ""
|
|
amplify: str
|
|
ralation: str
|
|
city: str
|
|
place: str
|
|
address: str
|
|
audience: str
|
|
attendees: str
|
|
report_info: ReportInfo
|
|
mindex: Optional[str] = Field("", description="mindex index فهرست")
|
|
mintro: Optional[str] = Field("", description="mintro خلاصه ")
|
|
content: str
|
|
completion: Optional[str] = Field("", description="type: completion")
|
|
sort_date_timestamp: int
|
|
permit_tags: str
|
|
resource_info: str
|
|
|
|
|
|
class MnSanadLink(BaseModel):
|
|
text: Optional[str] = ""
|
|
link: str
|
|
in_search: bool
|
|
title: str
|
|
|
|
|
|
|
|
class Properties(BaseModel):
|
|
"""
|
|
Standard Form Of Foreign Key To Other Index
|
|
"""
|
|
|
|
id: str = Field(..., description="شناسه یکتا")
|
|
title: Optional[str] = Field("", description="عنوان")
|
|
author: Optional[str] = Field("", description="سازنده")
|
|
sub_type: Optional[str] = Field("", description="نوع دوم")
|
|
|
|
class TreeProperties(BaseModel):
|
|
parent_id :str
|
|
child_order: int
|
|
level: int
|
|
full_path: str
|
|
title: str
|
|
path_headings: str
|
|
|
|
class NlpParses(BaseModel):
|
|
main_type: str
|
|
nlp_type: str
|
|
begin: int
|
|
end: int
|
|
text: str
|
|
referes: str
|
|
dependency_infos: Dict
|
|
|
|
class UserLogs(BaseModel):
|
|
id:str
|
|
user_id:int
|
|
username:str
|
|
time_edit:int
|
|
property:str
|
|
|
|
class MNSection(BaseModel):
|
|
main_type : str
|
|
id : str
|
|
html : str
|
|
content : str
|
|
meet_info: Properties
|
|
term_info: Properties
|
|
tree_info: TreeProperties
|
|
content_len: int
|
|
word_len: int
|
|
tags: str
|
|
keywords: str
|
|
sort_date_timestamp: int
|
|
nlp_parses: NlpParses
|
|
embeddings: Embeddings
|
|
file_links:FileLinks
|
|
time_edit: int
|
|
user_edit: int
|
|
user_logs: UserLogs
|
|
|
|
|
|
class MnSanadVersionInfo(BaseModel):
|
|
timestamp: int
|
|
number: int
|
|
title: str
|
|
|
|
|
|
class SoundLinks(BaseModel):
|
|
link: str
|
|
title: str
|
|
|
|
|
|
class MnSanad(BaseModel):
|
|
id: Optional[str] = ""
|
|
sort_date_timestamp: Optional[int] = ""
|
|
title: Optional[str] = ""
|
|
subtitle: Optional[str] = ""
|
|
research_code: Optional[int] = ""
|
|
content: Optional[str] = ""
|
|
version_info: Optional[MnSanadVersionInfo] = ""
|
|
meet_lid: Optional[int] = ""
|
|
meet_id: Optional[int] = ""
|
|
meet_no: Optional[int] = ""
|
|
meet_code: Optional[int] = ""
|
|
allwords: Optional[str] = ""
|
|
keywords: Optional[str] = ""
|
|
person_code: Optional[str] = ""
|
|
subject: Optional[List] = ""
|
|
city: Optional[str] = ""
|
|
author: str
|
|
begin_year: Optional[int] = ""
|
|
begin_date: Optional[int] = ""
|
|
end_date: Optional[int] = ""
|
|
branch: Optional[str] = ""
|
|
ralation: Optional[str] = ""
|
|
research_id: Optional[int] = ""
|
|
mintro: Optional[str] = ""
|
|
mindex: Optional[str] = ""
|
|
RowNum: Optional[int] = ""
|
|
resource_info: Optional[str] = ""
|
|
in_tadvin: Optional[bool] = ""
|
|
format: Optional[str] = ""
|
|
verb: Optional[str] = ""
|
|
address: Optional[str] = ""
|
|
attendees: Optional[str] = ""
|
|
amplify: Optional[str] = ""
|
|
audience: Optional[str] = ""
|
|
place: Optional[str] = ""
|
|
permit_tags: Optional[str] = ""
|
|
photos: Optional[int] = ""
|
|
tags: Optional[List[str]] = ""
|
|
films: Optional[int] = ""
|
|
sounds: Optional[int] = ""
|
|
file_links: Optional[List[MnSanadLink]] = ""
|
|
sound_links: Optional[List[SoundLinks]] = ""
|
|
video_links: Optional[List[SoundLinks]] = ""
|
|
photo_links: Optional[List[SoundLinks]] = ""
|
|
|
|
model_config = {"exclude_" "": True}
|
|
|
|
|
|
class MnSanad2Meet(BaseModel):
|
|
id: str
|
|
sort_date_timestamp: Optional[int] = ""
|
|
title: str
|
|
subtitle: str
|
|
research_code: str
|
|
format: str
|
|
content: str
|
|
# version_info: Optional[List|dict] = ""
|
|
meet_lid: Optional[str] = ""
|
|
meet_id: Optional[int] = ""
|
|
meet_no: Optional[int] = ""
|
|
meet_code: Optional[str] = ""
|
|
allwords: Optional[str] = ""
|
|
keywords: Optional[str] = ""
|
|
person_code: Optional[str] = ""
|
|
subject: Optional[List] = []
|
|
city: Optional[str] = ""
|
|
author: str
|
|
begin_year: Optional[int] = ""
|
|
begin_date: Optional[str] = ""
|
|
end_date: Optional[str] = ""
|
|
branch: str
|
|
ralation: Optional[str] = ""
|
|
research_id: int
|
|
mintro: Optional[str] = ""
|
|
mindex: Optional[str] = ""
|
|
# RowNum: Optional[int]= ""
|
|
resource_info: Optional[str] = ""
|
|
# in_tadvin: Optional[bool] = ""
|
|
verb: Optional[str] = ""
|
|
address: Optional[str] = ""
|
|
attendees: Optional[str] = ""
|
|
amplify: Optional[str] = ""
|
|
audience: Optional[str] = ""
|
|
place: Optional[str] = ""
|
|
permit_tags: Optional[str] = ""
|
|
photos: Optional[int] = 0
|
|
tags: Optional[List[str]] = []
|
|
films: Optional[int] = 0
|
|
sounds: Optional[int] = 0
|
|
file_links: Optional[List[MnSanadLink]] = ""
|
|
sound_links: Optional[List[SoundLinks]] = ""
|
|
video_links: Optional[List[SoundLinks]] = ""
|
|
photo_links: Optional[List[SoundLinks]] = ""
|
|
|
|
# model_config = {
|
|
# "exclude_""": True
|
|
# }
|