انتقال تمام محتوای متنی سایت به دیتابیس — همه متن‌های فرانت‌اند از GET /api/site خوانده می‌شوند

This commit is contained in:
MMD
2026-09-06 20:16:17 +03:30
parent 8bb303dda2
commit 1fde4e30fc
36 changed files with 1096 additions and 454 deletions
+39
View File
@@ -14,17 +14,43 @@ from ..schemas import (
BeforeAfterOut,
BrandIn,
BrandOut,
ContactSectionIn,
ContactSectionOut,
ContactMessageOut,
FaqIn,
FaqOut,
FooterIn,
FooterOut,
GalleryImageIn,
GalleryImageOut,
HeroIn,
HeroOut,
InvestmentModelIn,
InvestmentModelOut,
LoginIn,
MessageReadIn,
NavItemIn,
NavItemOut,
NewsletterSectionIn,
NewsletterOut,
OfficeIn,
OfficeOut,
PageHeroIn,
PageHeroOut,
ProcessStepIn,
ProcessStepOut,
ProjectIn,
ProjectOut,
SectionHeadingIn,
SectionHeadingOut,
ServiceIn,
ServiceOut,
StatIn,
StatOut,
StatusLabelIn,
StatusLabelOut,
StoryIn,
StoryOut,
SubscriberOut,
TeamMemberIn,
TeamMemberOut,
@@ -107,6 +133,11 @@ def register_crud(path: str, model, out_schema, create_schema) -> None:
# CRUD محتوا
register_crud("brand", models.Brand, BrandOut, BrandIn)
register_crud("nav", models.NavItem, NavItemOut, NavItemIn)
register_crud("hero", models.Hero, HeroOut, HeroIn)
register_crud("story", models.StorySection, StoryOut, StoryIn)
register_crud("section-headings", models.SectionHeadingContent, SectionHeadingOut, SectionHeadingIn)
register_crud("page-heroes", models.PageHeroContent, PageHeroOut, PageHeroIn)
register_crud("services", models.Service, ServiceOut, ServiceIn)
register_crud("projects", models.Project, ProjectOut, ProjectIn)
register_crud("articles", models.Article, ArticleOut, ArticleIn)
@@ -117,6 +148,14 @@ register_crud("timeline", models.TimelineItem, TimelineItemOut, TimelineItemIn)
register_crud("stats", models.Stat, StatOut, StatIn)
register_crud("why-us", models.WhyUsItem, WhyUsItemOut, WhyUsItemIn)
register_crud("before-after", models.BeforeAfter, BeforeAfterOut, BeforeAfterIn)
register_crud("investment-models", models.InvestmentModel, InvestmentModelOut, InvestmentModelIn)
register_crud("process-steps", models.ProcessStep, ProcessStepOut, ProcessStepIn)
register_crud("offices", models.Office, OfficeOut, OfficeIn)
register_crud("gallery", models.GalleryImage, GalleryImageOut, GalleryImageIn)
register_crud("status-labels", models.StatusLabel, StatusLabelOut, StatusLabelIn)
register_crud("contact-section", models.ContactSectionContent, ContactSectionOut, ContactSectionIn)
register_crud("newsletter", models.NewsletterSectionContent, NewsletterOut, NewsletterSectionIn)
register_crud("footer", models.FooterContent, FooterOut, FooterIn)
# پیام‌های تماس