docs(readme): 编写项目README文档,描述功能与架构

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

View File

@@ -0,0 +1,25 @@
"""
Pydantic Schemas
导出所有 Schema 类型
"""
from .user import UserCreate, UserLogin, UserResponse, Token, UserUpdate, PasswordChange
from .category import CategoryResponse, SubTypeResponse, ColorResponse
from .design import DesignCreate, DesignResponse, DesignListResponse
__all__ = [
# User schemas
"UserCreate",
"UserLogin",
"UserResponse",
"Token",
"UserUpdate",
"PasswordChange",
# Category schemas
"CategoryResponse",
"SubTypeResponse",
"ColorResponse",
# Design schemas
"DesignCreate",
"DesignResponse",
"DesignListResponse",
]

View File

@@ -0,0 +1,42 @@
"""
品类相关 Pydantic Schemas
"""
from pydantic import BaseModel
from typing import Optional
class CategoryResponse(BaseModel):
"""品类响应"""
id: int
name: str
icon: Optional[str] = None
sort_order: int
flow_type: str
class Config:
from_attributes = True
class SubTypeResponse(BaseModel):
"""子类型响应"""
id: int
category_id: int
name: str
description: Optional[str] = None
preview_image: Optional[str] = None
sort_order: int
class Config:
from_attributes = True
class ColorResponse(BaseModel):
"""颜色响应"""
id: int
category_id: int
name: str
hex_code: str
sort_order: int
class Config:
from_attributes = True

View File

@@ -0,0 +1,53 @@
"""
设计作品相关 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

View File

@@ -0,0 +1,51 @@
"""
用户相关 Pydantic Schemas
"""
from pydantic import BaseModel, Field
from datetime import datetime
from typing import Optional
class UserCreate(BaseModel):
"""用户注册请求"""
username: str = Field(..., min_length=2, max_length=50, description="用户名")
password: str = Field(..., min_length=6, max_length=100, description="密码")
nickname: Optional[str] = Field(None, max_length=50, description="昵称")
class UserLogin(BaseModel):
"""用户登录请求"""
username: str = Field(..., description="用户名")
password: str = Field(..., description="密码")
class UserResponse(BaseModel):
"""用户响应"""
id: int
username: str
nickname: Optional[str] = None
phone: Optional[str] = None
avatar: Optional[str] = None
created_at: datetime
class Config:
from_attributes = True
class Token(BaseModel):
"""认证令牌响应"""
access_token: str
token_type: str = "bearer"
class UserUpdate(BaseModel):
"""用户信息更新请求"""
nickname: Optional[str] = Field(None, max_length=50, description="昵称")
phone: Optional[str] = Field(None, max_length=20, description="手机号")
avatar: Optional[str] = Field(None, max_length=255, description="头像URL")
class PasswordChange(BaseModel):
"""修改密码请求"""
old_password: str = Field(..., description="旧密码")
new_password: str = Field(..., min_length=6, max_length=100, description="新密码")