- Frontend: Next.js 14 with TypeScript - Backend: FastAPI with SQLAlchemy - Agent: Carmodoo sync agent - Deployment: Docker Compose based staging/production setup - Scripts: Automated deployment with rollback support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
60 lines
2.4 KiB
Python
60 lines
2.4 KiB
Python
"""
|
|
차량 상세사양 (Car Specifications) 모델
|
|
카모두 상세사양조회 서비스에서 가져온 차량 스펙 정보를 저장
|
|
"""
|
|
|
|
from sqlalchemy import Column, Integer, String, ForeignKey, DateTime, Text, JSON
|
|
from sqlalchemy.orm import relationship
|
|
from sqlalchemy.sql import func
|
|
from ..database import Base
|
|
|
|
|
|
class CarSpecification(Base):
|
|
"""차량 상세사양"""
|
|
__tablename__ = "car_specifications"
|
|
|
|
id = Column(Integer, primary_key=True, index=True)
|
|
car_id = Column(Integer, ForeignKey("cars.id", ondelete="CASCADE"), nullable=False, unique=True)
|
|
|
|
# 기본 정보
|
|
manufacturer = Column(String(50)) # 제조사
|
|
model_name = Column(String(100)) # 모델명
|
|
grade = Column(String(100)) # 등급/트림
|
|
model_year = Column(String(20)) # 연식
|
|
|
|
# 엔진/성능
|
|
displacement = Column(Integer) # 배기량 (cc)
|
|
fuel_type = Column(String(30)) # 연료 (가솔린/디젤/하이브리드/전기)
|
|
transmission = Column(String(30)) # 변속기 (자동/수동/CVT)
|
|
drive_type = Column(String(30)) # 구동방식 (전륜/후륜/4륜)
|
|
max_power = Column(String(50)) # 최고출력 (예: 180ps/6,000rpm)
|
|
max_torque = Column(String(50)) # 최대토크 (예: 23.5kg.m/4,200rpm)
|
|
fuel_efficiency = Column(String(50)) # 연비 (예: 12.5km/L)
|
|
|
|
# 차체
|
|
body_type = Column(String(30)) # 차체형태 (세단/SUV/해치백 등)
|
|
door_count = Column(Integer) # 도어수
|
|
seating_capacity = Column(Integer) # 승차정원
|
|
|
|
# 제원
|
|
length = Column(Integer) # 전장 (mm)
|
|
width = Column(Integer) # 전폭 (mm)
|
|
height = Column(Integer) # 전고 (mm)
|
|
wheelbase = Column(Integer) # 축거 (mm)
|
|
curb_weight = Column(Integer) # 공차중량 (kg)
|
|
|
|
# 옵션/편의장치 (JSON 배열)
|
|
safety_options = Column(JSON) # 안전옵션 ["에어백", "ABS", ...]
|
|
comfort_options = Column(JSON) # 편의옵션 ["썬루프", "열선시트", ...]
|
|
exterior_options = Column(JSON) # 외장옵션 ["LED헤드램프", ...]
|
|
interior_options = Column(JSON) # 내장옵션 ["가죽시트", ...]
|
|
|
|
# 원본 데이터
|
|
raw_data = Column(JSON) # 전체 원본 데이터 (파싱하지 못한 정보 포함)
|
|
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
|
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
|
|
|
# Relationship
|
|
car = relationship("Car", back_populates="specification")
|