guzhi/app/schemas/esg.py
2025-09-30 22:26:02 +08:00

28 lines
753 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from datetime import datetime
from typing import Optional
from pydantic import BaseModel, Field
from app.models.enums import ESGType
class BaseESG(BaseModel):
code: str = Field(..., description="行业代码", example="001")
name: str = Field(..., description="行业名称", example="农业")
level: ESGType = Field(..., description="ESG价值等级", example=ESGType.A)
number: int = Field(0, description="ESG基准分", example=85)
remark: str = Field("简要说明ESG视角", description="备注", example="环保友好型行业")
class ESGCreate(BaseESG):
pass
class ESGUpdate(BaseESG):
id: int
class ESGResponse(BaseESG):
id: int
created_at: Optional[datetime]
updated_at: Optional[datetime]