# -*- coding: utf-8 -*-
# @Author  : {{ table.function_author }}
# @FileName: {{ table.class_name }}.py
# @Time    : {{ datetime }}

from typing import Optional
from datetime import datetime
from pydantic import Field
from ruoyi_common.base.model import BaseEntity

class {{ table.class_name }}(BaseEntity):
    """
    {{ table.table_comment }}对象
    """
{%- for column in table.columns %}
{%- if column.java_type == 'String' or column.java_type == 'str' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[str] = Field(default=None, description="{{ column.column_comment }}")
{%- elif column.java_type == 'Integer' or column.java_type == 'int' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[int] = Field(default=None, description="{{ column.column_comment }}")
{%- elif column.java_type == 'Long' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[int] = Field(default=None, description="{{ column.column_comment }}")
{%- elif column.java_type == 'Float' or column.java_type == 'Double' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[float] = Field(default=None, description="{{ column.column_comment }}")
{%- elif column.java_type == 'Boolean' or column.java_type == 'bool' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[bool] = Field(default=None, description="{{ column.column_comment }}")
{%- elif column.java_type == 'Date' or column.java_type == 'DateTime' %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[datetime] = Field(default=None, description="{{ column.column_comment }}")
{%- else %}
    # {{ column.column_comment }}
    {{ underscore(column.java_field) }}: Optional[str] = Field(default=None, description="{{ column.column_comment }}")
{%- endif %}
{%- endfor %}