fix: change plant_id to str, timestamp to created_at for DB schema match
This commit is contained in:
parent
f826028161
commit
903d2cfb0b
|
|
@ -20,9 +20,11 @@ class PlantBase(BaseModel):
|
|||
|
||||
class SolarLogBase(BaseModel):
|
||||
"""발전 로그 기본 정보 스키마"""
|
||||
model_config = {"from_attributes": True}
|
||||
|
||||
id: int
|
||||
plant_id: int
|
||||
timestamp: datetime
|
||||
plant_id: str # DB에서 'nrems-01' 같은 문자열 형식 사용
|
||||
created_at: datetime # DB 컬럼명과 일치
|
||||
power_output: Optional[float] = Field(None, description="현재 발전량 (kW)")
|
||||
daily_generation: Optional[float] = Field(None, description="일일 발전량 (kWh)")
|
||||
total_generation: Optional[float] = Field(None, description="누적 발전량 (kWh)")
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user