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):
|
class SolarLogBase(BaseModel):
|
||||||
"""발전 로그 기본 정보 스키마"""
|
"""발전 로그 기본 정보 스키마"""
|
||||||
|
model_config = {"from_attributes": True}
|
||||||
|
|
||||||
id: int
|
id: int
|
||||||
plant_id: int
|
plant_id: str # DB에서 'nrems-01' 같은 문자열 형식 사용
|
||||||
timestamp: datetime
|
created_at: datetime # DB 컬럼명과 일치
|
||||||
power_output: Optional[float] = Field(None, description="현재 발전량 (kW)")
|
power_output: Optional[float] = Field(None, description="현재 발전량 (kW)")
|
||||||
daily_generation: Optional[float] = Field(None, description="일일 발전량 (kWh)")
|
daily_generation: Optional[float] = Field(None, description="일일 발전량 (kWh)")
|
||||||
total_generation: Optional[float] = Field(None, description="누적 발전량 (kWh)")
|
total_generation: Optional[float] = Field(None, description="누적 발전량 (kWh)")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user