Files
YuShiSheJiShi/backend/app/schemas/design.py
changyoutongxue e3ff55b4db docs(readme): 编写项目README文档,描述功能与架构
- 完整撰写玉宗珠宝设计大师项目README,介绍项目概况及核心功能
- 说明用户认证系统实现及优势,包含JWT鉴权和密码加密细节
- 详细描述品类管理系统,支持多流程类型和多种玉石品类
- 说明设计图生成方案及技术,包含Pillow生成示例及字体支持
- 介绍设计管理功能,支持分页浏览、预览、下载和删除设计
- 个人信息管理模块说明,涵盖昵称、手机号、密码的安全修改
- 绘制业务流程图和关键数据流图,清晰展现系统架构与数据流
- 提供详细API调用链路及参数说明,涵盖用户、品类、设计接口
- 列明技术栈及版本,包含前后端框架、ORM、认证、加密等工具
- 展示目录结构,标明后端与前端项目布局
- 规划本地开发环境与启动步骤,包括数据库初始化及运行命令
- 说明服务器部署流程和Nginx配置方案
- 详细数据库表结构说明及环境变量配置指导
- 汇总常用开发及测试命令,方便开发调试与部署管理
2026-03-27 13:10:17 +08:00

54 lines
1.8 KiB
Python

"""
设计作品相关 Pydantic Schemas
"""
from pydantic import BaseModel, Field
from datetime import datetime
from typing import Optional, List
from .category import CategoryResponse, SubTypeResponse, ColorResponse
class DesignCreate(BaseModel):
"""创建设计请求"""
category_id: int = Field(..., description="品类ID")
sub_type_id: Optional[int] = Field(None, description="子类型ID")
color_id: Optional[int] = Field(None, description="颜色ID")
prompt: str = Field(..., min_length=1, max_length=2000, description="设计需求")
carving_technique: Optional[str] = Field(None, max_length=50, description="雕刻工艺")
design_style: Optional[str] = Field(None, max_length=50, description="设计风格")
motif: Optional[str] = Field(None, max_length=100, description="题材纹样")
size_spec: Optional[str] = Field(None, max_length=100, description="尺寸规格")
surface_finish: Optional[str] = Field(None, max_length=50, description="表面处理")
usage_scene: Optional[str] = Field(None, max_length=50, description="用途场景")
class DesignResponse(BaseModel):
"""设计作品响应"""
id: int
user_id: int
category: CategoryResponse
sub_type: Optional[SubTypeResponse] = None
color: Optional[ColorResponse] = None
prompt: str
carving_technique: Optional[str] = None
design_style: Optional[str] = None
motif: Optional[str] = None
size_spec: Optional[str] = None
surface_finish: Optional[str] = None
usage_scene: Optional[str] = None
image_url: Optional[str] = None
status: str
created_at: datetime
updated_at: datetime
class Config:
from_attributes = True
class DesignListResponse(BaseModel):
"""设计作品列表响应"""
items: List[DesignResponse]
total: int
page: int
page_size: int