#!/usr/bin/python
# -*- coding: utf-8 -*-
# @version        : 1.0
# @Create Time    : 2025/04/03 10:31
# @File           : project_detect_log.py
# @IDE            : PyCharm
# @desc           : pydantic 模型，用于数据库序列化操作

from core.data_types import DatetimeStr

from typing import Optional
from pydantic import BaseModel, Field, ConfigDict


class ProjectDetectLogIn(BaseModel):
    detect_id: Optional[int] = Field(..., description="推理集合id")
    train_id: Optional[int] = Field(..., description="训练结果id")
    pt_type: Optional[str] = Field('best', description="权重文件类型")


class ProjectDetectLogOut(BaseModel):
    id: Optional[int]
    detect_id: Optional[int]
    detect_version: Optional[str]
    detect_name: Optional[str]
    train_id: Optional[int]
    train_version: Optional[str]
    pt_type: Optional[str]
    create_datetime: DatetimeStr

    model_config = ConfigDict(from_attributes=True)
