add crawler and generate
This commit is contained in:
1 parent
9e7e8eee4e
commit
369f530ec5
19 files changed
+6426
-488
No files matched your search
+27
-16
@@ -9,14 +9,7 @@ Home 모듈 SQLAlchemy 모델 정의
|
||||
from datetime import datetime
|
||||
from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
from sqlalchemy import (
|
||||
DateTime,
|
||||
Index,
|
||||
Integer,
|
||||
String,
|
||||
Text,
|
||||
func,
|
||||
)
|
||||
from sqlalchemy import DateTime, Index, Integer, String, Text, func
|
||||
from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
|
||||
from app.database.session import Base
|
||||
@@ -53,7 +46,11 @@ class Project(Base):
|
||||
Index("idx_project_task_id", "task_id"),
|
||||
Index("idx_project_store_name", "store_name"),
|
||||
Index("idx_project_region", "region"),
|
||||
{"mysql_engine": "InnoDB", "mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"},
|
||||
{
|
||||
"mysql_engine": "InnoDB",
|
||||
"mysql_charset": "utf8mb4",
|
||||
"mysql_collate": "utf8mb4_unicode_ci",
|
||||
},
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(
|
||||
@@ -81,7 +78,6 @@ class Project(Base):
|
||||
task_id: Mapped[str] = mapped_column(
|
||||
String(36),
|
||||
nullable=False,
|
||||
unique=True,
|
||||
comment="프로젝트 작업 고유 식별자 (UUID)",
|
||||
)
|
||||
|
||||
@@ -152,7 +148,11 @@ class Image(Base):
|
||||
|
||||
__tablename__ = "image"
|
||||
__table_args__ = (
|
||||
{"mysql_engine": "InnoDB", "mysql_charset": "utf8mb4", "mysql_collate": "utf8mb4_unicode_ci"},
|
||||
{
|
||||
"mysql_engine": "InnoDB",
|
||||
"mysql_charset": "utf8mb4",
|
||||
"mysql_collate": "utf8mb4_unicode_ci",
|
||||
},
|
||||
)
|
||||
|
||||
id: Mapped[int] = mapped_column(
|
||||
@@ -166,14 +166,12 @@ class Image(Base):
|
||||
task_id: Mapped[str] = mapped_column(
|
||||
String(36),
|
||||
nullable=False,
|
||||
unique=True,
|
||||
comment="이미지 업로드 작업 고유 식별자 (UUID)",
|
||||
)
|
||||
|
||||
img_name: Mapped[str] = mapped_column(
|
||||
String(255),
|
||||
nullable=False,
|
||||
unique=True,
|
||||
comment="이미지명",
|
||||
)
|
||||
|
||||
@@ -183,6 +181,13 @@ class Image(Base):
|
||||
comment="이미지 URL (blob, CDN 경로)",
|
||||
)
|
||||
|
||||
img_order: Mapped[int] = mapped_column(
|
||||
Integer,
|
||||
nullable=False,
|
||||
default=0,
|
||||
comment="이미지 순서",
|
||||
)
|
||||
|
||||
created_at: Mapped[datetime] = mapped_column(
|
||||
DateTime,
|
||||
nullable=False,
|
||||
@@ -191,7 +196,13 @@ class Image(Base):
|
||||
)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
task_id_str = (self.task_id[:10] + "...") if len(self.task_id) > 10 else self.task_id
|
||||
img_name_str = (self.img_name[:10] + "...") if len(self.img_name) > 10 else self.img_name
|
||||
task_id_str = (
|
||||
(self.task_id[:10] + "...") if len(self.task_id) > 10 else self.task_id
|
||||
)
|
||||
img_name_str = (
|
||||
(self.img_name[:10] + "...") if len(self.img_name) > 10 else self.img_name
|
||||
)
|
||||
|
||||
return f"<Image(id={self.id}, task_id='{task_id_str}', img_name='{img_name_str}')>"
|
||||
return (
|
||||
f"<Image(id={self.id}, task_id='{task_id_str}', img_name='{img_name_str}')>"
|
||||
)
|
||||
Reference in new issue
Block a user