Files
Neo-ZQYY/apps/backend/app/schemas/xcx_notes.py

38 lines
1.0 KiB
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.
"""
小程序备注相关 Pydantic 模型。
覆盖:备注创建请求、备注输出等场景。
"""
from __future__ import annotations
from pydantic import Field
from app.schemas.base import CamelModel
class NoteCreateRequest(CamelModel):
"""创建备注请求(含手动评分:再次服务意愿 + 再来店可能性,各 1-5"""
target_type: str = Field(default="member")
target_id: int
content: str = Field(..., min_length=1)
task_id: int | None = None
rating_service_willingness: int | None = Field(None, ge=1, le=5, description="再次服务意愿1-5")
rating_revisit_likelihood: int | None = Field(None, ge=1, le=5, description="再来店可能性1-5")
class NoteOut(CamelModel):
"""备注输出模型(含评分 + AI 评分)。"""
id: int
type: str
content: str
rating_service_willingness: int | None
rating_revisit_likelihood: int | None
ai_score: int | None
ai_analysis: str | None
task_id: int | None
created_at: str
updated_at: str