feat(ai): 升级AI生图模型及多视角一致性支持

- 将默认AI生图模型升级为flux-dev及seedream-5.0版本
- SiliconFlow模型由FLUX.1-dev切换为Kolors,优化调用参数和返回值
- 火山引擎Seedream升级至5.0 lite版本,支持多视角参考图传入
- 设计图片字段由字符串改为Text扩展URL长度限制
- 设计图下载支持远程URL重定向和本地文件兼容
- 生成AI图片时多视角保持风格一致,SiliconFlow复用seed,Seedream传参考图
- 后台配置界面更改模型名称及价格显示,新增API Key状态检测
- 前端照片下载从链接改为按钮,远程文件新窗口打开
- 设计相关接口支持较长请求超时,下载走API路径无/api前缀
- 前端页面兼容驼峰与下划线格式URL参数识别
- 用户中心设计图下载支持本地文件Token授权下载
- 初始化数据库新增完整表结构与约束,适配新版设计业务逻辑
This commit is contained in:
2026-03-27 17:39:01 +08:00
parent 032c43525a
commit bb84747917
21 changed files with 645 additions and 414 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

BIN
.qoder/.DS_Store vendored Normal file

Binary file not shown.

BIN
backend/.DS_Store vendored Normal file

Binary file not shown.

View File

@@ -18,7 +18,7 @@ class Settings(BaseSettings):
SILICONFLOW_BASE_URL: str = "https://api.siliconflow.cn/v1" SILICONFLOW_BASE_URL: str = "https://api.siliconflow.cn/v1"
VOLCENGINE_API_KEY: str = "" VOLCENGINE_API_KEY: str = ""
VOLCENGINE_BASE_URL: str = "https://ark.cn-beijing.volces.com/api/v3" VOLCENGINE_BASE_URL: str = "https://ark.cn-beijing.volces.com/api/v3"
AI_IMAGE_MODEL: str = "flux-dev" # flux-dev 或 seedream-4.5 AI_IMAGE_MODEL: str = "flux-dev" # flux-dev 或 seedream-5.0
AI_IMAGE_SIZE: int = 1024 AI_IMAGE_SIZE: int = 1024
class Config: class Config:

View File

@@ -35,7 +35,7 @@ app = FastAPI(
# 配置 CORS # 配置 CORS
app.add_middleware( app.add_middleware(
CORSMiddleware, CORSMiddleware,
allow_origins=["http://localhost:3000"], # 生产环境应限制具体域名 allow_origins=["https://c02.wsg.plus", "http://c02.wsg.plus", "http://localhost:3000"],
allow_credentials=True, allow_credentials=True,
allow_methods=["*"], allow_methods=["*"],
allow_headers=["*"], allow_headers=["*"],

View File

@@ -24,7 +24,7 @@ class Design(Base):
size_spec = Column(String(100), nullable=True, comment="尺寸规格") size_spec = Column(String(100), nullable=True, comment="尺寸规格")
surface_finish = Column(String(50), nullable=True, comment="表面处理") surface_finish = Column(String(50), nullable=True, comment="表面处理")
usage_scene = Column(String(50), nullable=True, comment="用途场景") usage_scene = Column(String(50), nullable=True, comment="用途场景")
image_url = Column(String(255), nullable=True, comment="设计图URL") image_url = Column(Text, nullable=True, comment="设计图URL")
status = Column(String(20), default="generating", comment="状态") status = Column(String(20), default="generating", comment="状态")
created_at = Column(DateTime, server_default=func.now(), comment="创建时间") created_at = Column(DateTime, server_default=func.now(), comment="创建时间")
updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment="更新时间") updated_at = Column(DateTime, server_default=func.now(), onupdate=func.now(), comment="更新时间")

View File

@@ -16,7 +16,7 @@ class DesignImage(Base):
id = Column(BigInteger, primary_key=True, autoincrement=True, comment="图片ID") id = Column(BigInteger, primary_key=True, autoincrement=True, comment="图片ID")
design_id = Column(BigInteger, ForeignKey("designs.id", ondelete="CASCADE"), nullable=False, comment="关联设计ID") design_id = Column(BigInteger, ForeignKey("designs.id", ondelete="CASCADE"), nullable=False, comment="关联设计ID")
view_name = Column(String(20), nullable=False, comment="视角名称: 效果图/正面图/侧面图/背面图") view_name = Column(String(20), nullable=False, comment="视角名称: 效果图/正面图/侧面图/背面图")
image_url = Column(String(255), nullable=True, comment="图片URL路径") image_url = Column(Text, nullable=True, comment="图片URL路径")
model_used = Column(String(50), nullable=True, comment="使用的AI模型: flux-dev/seedream-4.5") model_used = Column(String(50), nullable=True, comment="使用的AI模型: flux-dev/seedream-4.5")
prompt_used = Column(Text, nullable=True, comment="实际使用的英文prompt") prompt_used = Column(Text, nullable=True, comment="实际使用的英文prompt")
sort_order = Column(Integer, default=0, comment="排序") sort_order = Column(Integer, default=0, comment="排序")

View File

@@ -114,7 +114,7 @@ def init_default_configs(
("SILICONFLOW_BASE_URL", "https://api.siliconflow.cn/v1", "SiliconFlow 接口地址", "ai", "N"), ("SILICONFLOW_BASE_URL", "https://api.siliconflow.cn/v1", "SiliconFlow 接口地址", "ai", "N"),
("VOLCENGINE_API_KEY", "", "火山引擎 API Key", "ai", "Y"), ("VOLCENGINE_API_KEY", "", "火山引擎 API Key", "ai", "Y"),
("VOLCENGINE_BASE_URL", "https://ark.cn-beijing.volces.com/api/v3", "火山引擎接口地址", "ai", "N"), ("VOLCENGINE_BASE_URL", "https://ark.cn-beijing.volces.com/api/v3", "火山引擎接口地址", "ai", "N"),
("AI_IMAGE_MODEL", "flux-dev", "默认AI生图模型 (flux-dev / seedream-4.5)", "ai", "N"), ("AI_IMAGE_MODEL", "flux-dev", "默认AI生图模型 (flux-dev / seedream-5.0)", "ai", "N"),
("AI_IMAGE_SIZE", "1024", "AI生图默认尺寸", "ai", "N"), ("AI_IMAGE_SIZE", "1024", "AI生图默认尺寸", "ai", "N"),
] ]
for key, val, desc, group, secret in defaults: for key, val, desc, group, secret in defaults:

View File

@@ -4,7 +4,7 @@
""" """
import os import os
from fastapi import APIRouter, Depends, HTTPException, status, Query from fastapi import APIRouter, Depends, HTTPException, status, Query
from fastapi.responses import FileResponse from fastapi.responses import FileResponse, RedirectResponse
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
from ..database import get_db from ..database import get_db
@@ -182,6 +182,7 @@ def download_design(
""" """
下载设计图 下载设计图
只能下载自己的设计,非本人设计返回 404 只能下载自己的设计,非本人设计返回 404
支持远程 URL重定向和本地文件兼容历史数据
""" """
design = design_service.get_design_by_id( design = design_service.get_design_by_id(
db=db, db=db,
@@ -201,9 +202,12 @@ def download_design(
detail="设计图片不存在" detail="设计图片不存在"
) )
# 转换 URL 为文件路径 # 远程 URL 直接重定向
file_path = design.image_url.lstrip("/") if design.image_url.startswith("http"):
return RedirectResponse(url=design.image_url)
# 本地文件(兼容历史数据)
file_path = design.image_url.lstrip("/")
if not os.path.exists(file_path): if not os.path.exists(file_path):
raise HTTPException( raise HTTPException(
status_code=status.HTTP_404_NOT_FOUND, status_code=status.HTTP_404_NOT_FOUND,

View File

@@ -1,12 +1,12 @@
""" """
AI 生图服务 AI 生图服务
支持双模型SiliconFlow FLUX.1 [dev] 和 火山引擎 Seedream 4.5 支持双模型SiliconFlow Kolors 和 火山引擎 Seedream 5.0 lite
""" """
import os import os
import uuid import uuid
import logging import logging
import httpx import httpx
from typing import Optional from typing import Optional, Tuple
from ..config import settings from ..config import settings
from .config_service import get_ai_config from .config_service import get_ai_config
@@ -19,12 +19,15 @@ REQUEST_TIMEOUT = 90
MAX_RETRIES = 3 MAX_RETRIES = 3
async def _call_siliconflow(prompt: str, size: int = 1024, ai_config: dict = None) -> str: async def _call_siliconflow(prompt: str, size: int = 1024, ai_config: dict = None, seed: Optional[int] = None) -> Tuple[str, Optional[int]]:
""" """
调用 SiliconFlow FLUX.1 [dev] 生图 API 调用 SiliconFlow 生图 APIKolors 模型)
Args:
seed: 随机种子,传入相同 seed 可保持多视角图片风格一致
Returns: Returns:
远程图片 URL (远程图片 URL, 使用的 seed)
""" """
cfg = ai_config or get_ai_config() cfg = ai_config or get_ai_config()
url = f"{cfg['SILICONFLOW_BASE_URL']}/images/generations" url = f"{cfg['SILICONFLOW_BASE_URL']}/images/generations"
@@ -33,30 +36,38 @@ async def _call_siliconflow(prompt: str, size: int = 1024, ai_config: dict = Non
"Content-Type": "application/json", "Content-Type": "application/json",
} }
payload = { payload = {
"model": "black-forest-labs/FLUX.1-dev", "model": "Kwai-Kolors/Kolors",
"prompt": prompt, "prompt": prompt,
"image_size": f"{size}x{size}", "image_size": f"{size}x{size}",
"batch_size": 1,
"num_inference_steps": 20, "num_inference_steps": 20,
"guidance_scale": 7.5,
} }
if seed is not None:
payload["seed"] = seed
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client: async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client:
resp = await client.post(url, json=payload, headers=headers) resp = await client.post(url, json=payload, headers=headers)
resp.raise_for_status() resp.raise_for_status()
data = resp.json() data = resp.json()
# SiliconFlow 响应格式: {"images": [{"url": "https://..."}]} # SiliconFlow 响应格式: {"images": [{"url": "https://..."}], "seed": 12345}
images = data.get("images", []) images = data.get("images", [])
if not images: if not images:
raise ValueError("SiliconFlow 返回空图片列表") raise ValueError("SiliconFlow 返回空图片列表")
return images[0]["url"] returned_seed = data.get("seed")
return images[0]["url"], returned_seed
async def _call_seedream(prompt: str, size: int = 1024, ai_config: dict = None) -> str: async def _call_seedream(prompt: str, size: int = 1024, ai_config: dict = None, seed: Optional[int] = None, ref_image_url: Optional[str] = None) -> Tuple[str, Optional[int]]:
""" """
调用火山引擎 Seedream 4.5 生图 API 调用火山引擎 Seedream 5.0 lite 生图 API
Args:
ref_image_url: 参考图 URL用于多视角一致性将第一张图作为参考传入后续视角
Returns: Returns:
远程图片 URL (远程图片 URL, seed)
""" """
cfg = ai_config or get_ai_config() cfg = ai_config or get_ai_config()
url = f"{cfg['VOLCENGINE_BASE_URL']}/images/generations" url = f"{cfg['VOLCENGINE_BASE_URL']}/images/generations"
@@ -65,14 +76,20 @@ async def _call_seedream(prompt: str, size: int = 1024, ai_config: dict = None)
"Content-Type": "application/json", "Content-Type": "application/json",
} }
payload = { payload = {
"model": "doubao-seedream-4.5-t2i-250528", "model": "doubao-seedream-5-0-260128",
"prompt": prompt, "prompt": prompt,
"size": f"{size}x{size}", "size": "2K",
"response_format": "url", "response_format": "url",
"watermark": False,
} }
# 传入参考图保持多视角一致性API 要求数组格式)
if ref_image_url:
payload["image"] = [ref_image_url]
async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client: async with httpx.AsyncClient(timeout=REQUEST_TIMEOUT) as client:
resp = await client.post(url, json=payload, headers=headers) resp = await client.post(url, json=payload, headers=headers)
if resp.status_code != 200:
logger.error(f"Seedream API 错误: status={resp.status_code}, body={resp.text[:500]}")
resp.raise_for_status() resp.raise_for_status()
data = resp.json() data = resp.json()
@@ -80,22 +97,21 @@ async def _call_seedream(prompt: str, size: int = 1024, ai_config: dict = None)
items = data.get("data", []) items = data.get("data", [])
if not items: if not items:
raise ValueError("Seedream 返回空图片列表") raise ValueError("Seedream 返回空图片列表")
return items[0]["url"] return items[0]["url"], seed
async def generate_image(prompt: str, model: Optional[str] = None) -> str: async def generate_image(prompt: str, model: Optional[str] = None, seed: Optional[int] = None, ref_image_url: Optional[str] = None) -> Tuple[str, Optional[int]]:
""" """
统一生图接口,带重试机制 统一生图接口,带重试机制
Args: Args:
prompt: 英文提示词 prompt: 提示词
model: 模型名称 (flux-dev / seedream-4.5),为空则使用配置默认值 model: 模型名称 (flux-dev / seedream-5.0)
seed: 随机种子SiliconFlow Kolors 支持)
ref_image_url: 参考图 URLSeedream 5.0 支持,用于多视角一致性)
Returns: Returns:
远程图片 URL (远程图片 URL, 使用的 seed)
Raises:
Exception: 所有重试失败后抛出
""" """
ai_config = get_ai_config() ai_config = get_ai_config()
model = model or ai_config.get("AI_IMAGE_MODEL", "flux-dev") model = model or ai_config.get("AI_IMAGE_MODEL", "flux-dev")
@@ -104,12 +120,12 @@ async def generate_image(prompt: str, model: Optional[str] = None) -> str:
last_error: Optional[Exception] = None last_error: Optional[Exception] = None
for attempt in range(1, MAX_RETRIES + 1): for attempt in range(1, MAX_RETRIES + 1):
try: try:
if model == "seedream-4.5": if model in ("seedream-5.0", "seedream-4.5"):
image_url = await _call_seedream(prompt, size, ai_config) image_url, returned_seed = await _call_seedream(prompt, size, ai_config, seed, ref_image_url)
else: else:
image_url = await _call_siliconflow(prompt, size, ai_config) image_url, returned_seed = await _call_siliconflow(prompt, size, ai_config, seed)
logger.info(f"AI 生图成功 (model={model}, attempt={attempt})") logger.info(f"AI 生图成功 (model={model}, seed={returned_seed}, attempt={attempt})")
return image_url return image_url, returned_seed
except Exception as e: except Exception as e:
last_error = e last_error = e
logger.warning(f"AI 生图失败 (model={model}, attempt={attempt}/{MAX_RETRIES}): {e}") logger.warning(f"AI 生图失败 (model={model}, attempt={attempt}/{MAX_RETRIES}): {e}")

View File

@@ -19,11 +19,13 @@ logger = logging.getLogger(__name__)
def _has_ai_key() -> bool: def _has_ai_key() -> bool:
"""检查是否配置了 AI API Key""" """检查是否配置了 AI API Key(从数据库配置优先读取)"""
model = settings.AI_IMAGE_MODEL from .config_service import get_ai_config
if model == "seedream-4.5": ai_config = get_ai_config()
return bool(settings.VOLCENGINE_API_KEY) model = ai_config.get("AI_IMAGE_MODEL", "flux-dev")
return bool(settings.SILICONFLOW_API_KEY) if model in ("seedream-5.0", "seedream-4.5"):
return bool(ai_config.get("VOLCENGINE_API_KEY"))
return bool(ai_config.get("SILICONFLOW_API_KEY"))
async def create_design_async(db: Session, user_id: int, design_data: DesignCreate) -> Design: async def create_design_async(db: Session, user_id: int, design_data: DesignCreate) -> Design:
@@ -115,9 +117,19 @@ async def _generate_ai_images(
color, color,
design_data: DesignCreate, design_data: DesignCreate,
) -> None: ) -> None:
"""使用 AI 模型为每个视角生成图片""" """使用 AI 模型为每个视角生成图片
多视角一致性策略:
- SiliconFlow Kolors: 通过复用 seed 保持一致
- Seedream 5.0 lite: 通过参考图image参数保持一致
"""
views = get_views_for_category(category.name) views = get_views_for_category(category.name)
model = settings.AI_IMAGE_MODEL from .config_service import get_ai_config
ai_config = get_ai_config()
model = ai_config.get("AI_IMAGE_MODEL", "flux-dev")
shared_seed = None # Kolors 用: 第一张图的 seed
first_remote_url = None # Seedream 用: 第一张图的远程 URL 作为参考图
for idx, view_name in enumerate(views): for idx, view_name in enumerate(views):
# 构建 prompt # 构建 prompt
@@ -136,19 +148,27 @@ async def _generate_ai_images(
) )
# 调用 AI 生图 # 调用 AI 生图
remote_url = await ai_generator.generate_image(prompt_text, model) # 后续视角传入 seedKolors或参考图 URLSeedream保持一致性
ref_url = first_remote_url if idx > 0 else None
# 下载保存到本地 remote_url, returned_seed = await ai_generator.generate_image(
save_path = os.path.join( prompt_text, model, seed=shared_seed, ref_image_url=ref_url
settings.UPLOAD_DIR, "designs", f"{design.id}_{view_name}.png"
) )
local_url = await ai_generator.download_and_save(remote_url, save_path)
# 第一张图保存信息供后续视角复用
if idx == 0:
first_remote_url = remote_url
if returned_seed is not None:
shared_seed = returned_seed
logger.info(f"多视角生图: seed={shared_seed}, ref_url={remote_url[:60]}...")
# 直接使用远程 URL不下载到本地节省服务器存储空间
image_url = remote_url
# 创建 DesignImage 记录 # 创建 DesignImage 记录
design_image = DesignImage( design_image = DesignImage(
design_id=design.id, design_id=design.id,
view_name=view_name, view_name=view_name,
image_url=local_url, image_url=image_url,
model_used=model, model_used=model,
prompt_used=prompt_text, prompt_used=prompt_text,
sort_order=idx, sort_order=idx,
@@ -157,7 +177,7 @@ async def _generate_ai_images(
# 第一张图(效果图)存入 design.image_url 兼容旧逻辑 # 第一张图(效果图)存入 design.image_url 兼容旧逻辑
if idx == 0: if idx == 0:
design.image_url = local_url design.image_url = image_url
design.status = "completed" design.status = "completed"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

View File

@@ -7,7 +7,7 @@ export const getDashboard = () => request.get('/admin/dashboard')
export const getConfigs = (group?: string) => export const getConfigs = (group?: string) =>
request.get('/admin/configs', { params: group ? { group } : {} }) request.get('/admin/configs', { params: group ? { group } : {} })
export const updateConfigs = (configs: Record<string, string>) => export const updateConfigs = (_configs: Record<string, string>) =>
request.post('/admin/configs', null, { request.post('/admin/configs', null, {
// PUT 方法 // PUT 方法
}) })

View File

@@ -70,9 +70,9 @@ export function getDesignApi(id: number) {
return request.get<any, Design>(`/designs/${id}`) return request.get<any, Design>(`/designs/${id}`)
} }
// 生成设计 // 生成设计AI生图需要较长时间超时设为5分钟
export function generateDesignApi(data: GenerateDesignParams) { export function generateDesignApi(data: GenerateDesignParams) {
return request.post<any, Design>('/designs/generate', data) return request.post<any, Design>('/designs/generate', data, { timeout: 300000 })
} }
// 删除设计 // 删除设计
@@ -80,7 +80,7 @@ export function deleteDesignApi(id: number) {
return request.delete(`/designs/${id}`) return request.delete(`/designs/${id}`)
} }
// 获取设计下载 URL // 获取设计下载 URL(相对于 baseURL /api
export function getDesignDownloadUrl(id: number) { export function getDesignDownloadUrl(id: number) {
return `/api/designs/${id}/download` return `/designs/${id}/download`
} }

View File

@@ -85,14 +85,14 @@
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div class="action-buttons"> <div class="action-buttons">
<a <button
:href="downloadUrl"
:download="downloadFilename"
class="action-btn download-btn" class="action-btn download-btn"
@click="handleDownload"
:disabled="downloading"
> >
<el-icon><Download /></el-icon> <el-icon><Download /></el-icon>
<span>下载设计图</span> <span>{{ downloading ? '下载中...' : '下载设计图' }}</span>
</a> </button>
<button class="action-btn secondary-btn" @click="goToUserCenter"> <button class="action-btn secondary-btn" @click="goToUserCenter">
<el-icon><User /></el-icon> <el-icon><User /></el-icon>
<span>查看我的设计</span> <span>查看我的设计</span>
@@ -108,6 +108,7 @@ import { Loading, PictureFilled, ZoomIn, ZoomOut, RefreshRight, Download, User }
import { ElMessage } from 'element-plus' import { ElMessage } from 'element-plus'
import type { Design } from '@/stores/design' import type { Design } from '@/stores/design'
import { getDesignDownloadUrl } from '@/api/design' import { getDesignDownloadUrl } from '@/api/design'
import request from '@/api/request'
const props = defineProps<{ const props = defineProps<{
design: Design design: Design
@@ -134,11 +135,13 @@ const activeViewName = computed(() => {
return '' return ''
}) })
// 获取图片URL添加API前缀 // 获取图片URL
const toImageUrl = (url: string | null): string => { const toImageUrl = (url: string | null): string => {
if (!url) return '' if (!url) return ''
if (url.startsWith('http')) return url if (url.startsWith('http')) return url
return `/api${url}` // /uploads 路径已由 Vite 代理到后端,不需要加 /api 前缀
if (url.startsWith('/uploads')) return url
return url
} }
// 当前显示的图片URL // 当前显示的图片URL
@@ -159,8 +162,8 @@ const allImageUrls = computed(() => {
return [toImageUrl(props.design.image_url)] return [toImageUrl(props.design.image_url)]
}) })
// 下载URL // 下载状态
const downloadUrl = computed(() => getDesignDownloadUrl(props.design.id)) const downloading = ref(false)
// 下载文件名 // 下载文件名
const downloadFilename = computed(() => { const downloadFilename = computed(() => {
@@ -170,6 +173,40 @@ const downloadFilename = computed(() => {
return `${category}${subType ? '-' + subType : ''}${viewSuffix}-${props.design.id}.png` return `${category}${subType ? '-' + subType : ''}${viewSuffix}-${props.design.id}.png`
}) })
// 下载设计图
const handleDownload = () => {
const imgUrl = currentImageUrl.value
if (!imgUrl) {
ElMessage.error('图片不存在')
return
}
// 远程 URL 直接新窗口打开(用户右键可保存)
if (imgUrl.startsWith('http')) {
window.open(imgUrl, '_blank')
return
}
// 本地文件通过 axios 携带 Token 下载
downloading.value = true
request.get(getDesignDownloadUrl(props.design.id), {
responseType: 'blob'
}).then((response: any) => {
const blob = new Blob([response], { type: 'image/png' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a')
link.href = url
link.download = downloadFilename.value
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
window.URL.revokeObjectURL(url)
ElMessage.success('下载成功')
}).catch(() => {
ElMessage.error('下载失败,请重试')
}).finally(() => {
downloading.value = false
})
}
// 切换视角时重置缩放 // 切换视角时重置缩放
watch(activeViewIndex, () => { watch(activeViewIndex, () => {
scale.value = 1 scale.value = 1

View File

@@ -20,7 +20,7 @@
</header> </header>
<!-- 缺少参数错误提示 --> <!-- 缺少参数错误提示 -->
<div v-if="!categoryId" class="error-state"> <div v-if="!categoryId && !designId" class="error-state">
<div class="error-icon"> <div class="error-icon">
<el-icon><WarningFilled /></el-icon> <el-icon><WarningFilled /></el-icon>
</div> </div>
@@ -243,42 +243,46 @@ const router = useRouter()
const designStore = useDesignStore() const designStore = useDesignStore()
const categoryStore = useCategoryStore() const categoryStore = useCategoryStore()
// URL参数 // URL参数(兼容驼峰和下划线格式)
const designId = computed(() => {
const id = route.query.design_id || route.query.designId
return id ? Number(id) : null
})
const categoryId = computed(() => { const categoryId = computed(() => {
const id = route.query.categoryId const id = route.query.category_id || route.query.categoryId
return id ? Number(id) : null return id ? Number(id) : null
}) })
const subTypeId = computed(() => { const subTypeId = computed(() => {
const id = route.query.subTypeId const id = route.query.sub_type_id || route.query.subTypeId
return id ? Number(id) : null return id ? Number(id) : null
}) })
const colorId = computed(() => { const colorId = computed(() => {
const id = route.query.colorId const id = route.query.color_id || route.query.colorId
return id ? Number(id) : null return id ? Number(id) : null
}) })
// 名称从store缓存获取 // 名称(从 store 缓存或已加载的设计中获取)
const categoryName = computed(() => { const categoryName = computed(() => {
// 优先从已加载的设计中获取
if (currentDesign.value?.category?.name) return currentDesign.value.category.name
if (!categoryId.value) return '' if (!categoryId.value) return ''
// 优先从 currentCategory 获取
if (categoryStore.currentCategory?.id === categoryId.value) { if (categoryStore.currentCategory?.id === categoryId.value) {
return categoryStore.currentCategory.name return categoryStore.currentCategory.name
} }
// 否则从列表中查找
const cat = categoryStore.categories.find(c => c.id === categoryId.value) const cat = categoryStore.categories.find(c => c.id === categoryId.value)
return cat?.name || '设计' return cat?.name || '设计'
}) })
const subTypeName = computed(() => { const subTypeName = computed(() => {
if (currentDesign.value?.sub_type?.name) return currentDesign.value.sub_type.name
if (!subTypeId.value) return '' if (!subTypeId.value) return ''
// 从 store 的 subTypes 中查找
const st = categoryStore.subTypes.find(s => s.id === subTypeId.value) const st = categoryStore.subTypes.find(s => s.id === subTypeId.value)
return st?.name || '' return st?.name || ''
}) })
const colorName = computed(() => { const colorName = computed(() => {
if (currentDesign.value?.color?.name) return currentDesign.value.color.name
if (!colorId.value) return '' if (!colorId.value) return ''
// 从 store 的 colors 中查找
const c = categoryStore.colors.find(col => col.id === colorId.value) const c = categoryStore.colors.find(col => col.id === colorId.value)
return c?.name || '' return c?.name || ''
}) })
@@ -399,13 +403,26 @@ const handleRegenerate = () => {
// 页面挂载时,确保有品类数据 // 页面挂载时,确保有品类数据
onMounted(async () => { onMounted(async () => {
// 清除之前的设计状态
designStore.clearCurrentDesign()
// 如果 store 中没有品类数据,尝试加载 // 如果 store 中没有品类数据,尝试加载
if (categoryStore.categories.length === 0) { if (categoryStore.categories.length === 0) {
await categoryStore.fetchCategories() await categoryStore.fetchCategories()
} }
// 如果有 design_id直接加载已有设计并显示预览
if (designId.value) {
try {
await designStore.fetchDesign(designId.value)
// 填充 prompt
if (currentDesign.value?.prompt) {
prompt.value = currentDesign.value.prompt
}
} catch {
ElMessage.error('加载设计详情失败')
}
} else {
// 清除之前的设计状态
designStore.clearCurrentDesign()
}
}) })
// 离开页面时清理状态 // 离开页面时清理状态

View File

@@ -174,6 +174,7 @@ import { useUserStore } from '@/stores/user'
import { useDesignStore, type Design } from '@/stores/design' import { useDesignStore, type Design } from '@/stores/design'
import { updateProfileApi, changePasswordApi } from '@/api/auth' import { updateProfileApi, changePasswordApi } from '@/api/auth'
import { getDesignDownloadUrl } from '@/api/design' import { getDesignDownloadUrl } from '@/api/design'
import request from '@/api/request'
const router = useRouter() const router = useRouter()
const userStore = useUserStore() const userStore = useUserStore()
@@ -282,18 +283,34 @@ const handleCardClick = (design: Design) => {
} }
// Handle download // Handle download
const handleDownload = (design: Design) => { const handleDownload = async (design: Design) => {
if (!design.image_url) { if (!design.image_url) {
ElMessage.warning('暂无可下载的图片') ElMessage.warning('暂无可下载的图片')
return return
} }
// 远程 URL 直接新窗口打开
const imgUrl = design.image_url
if (imgUrl.startsWith('http')) {
window.open(imgUrl, '_blank')
return
}
// 本地文件通过 axios 携带 Token 下载
try {
const response = await request.get(getDesignDownloadUrl(design.id), {
responseType: 'blob'
}) as any
const blob = new Blob([response], { type: 'image/png' })
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') const link = document.createElement('a')
link.href = getDesignDownloadUrl(design.id) link.href = url
link.download = `design_${design.id}.png` link.download = `design_${design.id}.png`
link.target = '_blank'
document.body.appendChild(link) document.body.appendChild(link)
link.click() link.click()
document.body.removeChild(link) document.body.removeChild(link)
window.URL.revokeObjectURL(url)
} catch {
ElMessage.error('下载失败,请重试')
}
} }
// Handle delete // Handle delete

View File

@@ -10,18 +10,18 @@
@click="setDefaultModel('flux-dev')" @click="setDefaultModel('flux-dev')"
> >
<div class="model-badge">默认</div> <div class="model-badge">默认</div>
<div class="model-name">SiliconFlow FLUX.1 [dev]</div> <div class="model-name">SiliconFlow Kolors</div>
<div class="model-price">~0.13 /</div> <div class="model-price">~0.04 /</div>
<div class="model-tag">性价比高</div> <div class="model-tag">性价比高</div>
</div> </div>
<div <div
class="model-option" class="model-option"
:class="{ active: defaultModel === 'seedream-4.5' }" :class="{ active: defaultModel === 'seedream-5.0' }"
@click="setDefaultModel('seedream-4.5')" @click="setDefaultModel('seedream-5.0')"
> >
<div class="model-badge">备选</div> <div class="model-badge">备选</div>
<div class="model-name">火山引擎 Seedream 4.5</div> <div class="model-name">火山引擎 Seedream 5.0 lite</div>
<div class="model-price">~0.30 /</div> <div class="model-price">~0.04 /</div>
<div class="model-tag">高质量</div> <div class="model-tag">高质量</div>
</div> </div>
</div> </div>
@@ -31,12 +31,12 @@
<div class="section-card"> <div class="section-card">
<div class="card-header"> <div class="card-header">
<div class="card-title-row"> <div class="card-title-row">
<h3 class="section-title">SiliconFlow FLUX.1 [dev]</h3> <h3 class="section-title">SiliconFlow Kolors</h3>
<el-tag :type="siliconflowStatus" size="small"> <el-tag :type="siliconflowStatus" size="small">
{{ siliconflowStatusText }} {{ siliconflowStatusText }}
</el-tag> </el-tag>
</div> </div>
<p class="card-desc">硅基流动文生图 API基于 FLUX.1 开源模型性价比高</p> <p class="card-desc">硅基流动文生图 API基于 Kolors 开源模型性价比高</p>
</div> </div>
<el-form label-width="120px" class="config-form"> <el-form label-width="120px" class="config-form">
<el-form-item label="API Key"> <el-form-item label="API Key">
@@ -66,12 +66,12 @@
<div class="section-card"> <div class="section-card">
<div class="card-header"> <div class="card-header">
<div class="card-title-row"> <div class="card-title-row">
<h3 class="section-title">火山引擎 Seedream 4.5</h3> <h3 class="section-title">火山引擎 Seedream 5.0 lite</h3>
<el-tag :type="volcengineStatus" size="small"> <el-tag :type="volcengineStatus" size="small">
{{ volcengineStatusText }} {{ volcengineStatusText }}
</el-tag> </el-tag>
</div> </div>
<p class="card-desc">字节跳动火山引擎文生图 APISeedream 4.5 模型高质量输出</p> <p class="card-desc">字节跳动火山引擎文生图 APISeedream 5.0 lite 模型支持中英文提示词高质量输出</p>
</div> </div>
<el-form label-width="120px" class="config-form"> <el-form label-width="120px" class="config-form">
<el-form-item label="API Key"> <el-form-item label="API Key">
@@ -136,17 +136,21 @@ const volcengineUrl = ref('https://ark.cn-beijing.volces.com/api/v3')
const imageSize = ref('1024') const imageSize = ref('1024')
const saving = ref(false) const saving = ref(false)
// 后端是否已配置 API Key脱敏值也算已配置
const siliconflowConfigured = ref(false)
const volcengineConfigured = ref(false)
// 测试状态 // 测试状态
const testingSiliconflow = ref(false) const testingSiliconflow = ref(false)
const testingVolcengine = ref(false) const testingVolcengine = ref(false)
const siliconflowTestResult = ref<{ ok: boolean; msg: string } | null>(null) const siliconflowTestResult = ref<{ ok: boolean; msg: string } | null>(null)
const volcengineTestResult = ref<{ ok: boolean; msg: string } | null>(null) const volcengineTestResult = ref<{ ok: boolean; msg: string } | null>(null)
// 状态计算 // 状态计算:输入框有值 或 后端已配置 都算"已配置"
const siliconflowStatus = computed(() => siliconflowKey.value ? 'success' : 'info') const siliconflowStatus = computed(() => (siliconflowKey.value || siliconflowConfigured.value) ? 'success' : 'info')
const siliconflowStatusText = computed(() => siliconflowKey.value ? '已配置' : '未配置') const siliconflowStatusText = computed(() => (siliconflowKey.value || siliconflowConfigured.value) ? '已配置' : '未配置')
const volcengineStatus = computed(() => volcengineKey.value ? 'success' : 'info') const volcengineStatus = computed(() => (volcengineKey.value || volcengineConfigured.value) ? 'success' : 'info')
const volcengineStatusText = computed(() => volcengineKey.value ? '已配置' : '未配置') const volcengineStatusText = computed(() => (volcengineKey.value || volcengineConfigured.value) ? '已配置' : '未配置')
// 加载配置 // 加载配置
const loadConfigs = async () => { const loadConfigs = async () => {
@@ -160,6 +164,10 @@ const loadConfigs = async () => {
defaultModel.value = map['AI_IMAGE_MODEL'] || 'flux-dev' defaultModel.value = map['AI_IMAGE_MODEL'] || 'flux-dev'
// 注意API Key 是脱敏的(****),不回填到输入框 // 注意API Key 是脱敏的(****),不回填到输入框
// 只有完整值才回填 // 只有完整值才回填
// 记录后端是否已有 API Key脱敏值也算已配置
siliconflowConfigured.value = !!map['SILICONFLOW_API_KEY']
volcengineConfigured.value = !!map['VOLCENGINE_API_KEY']
// 脱敏值不回填输入框,只有完整值才回填
if (map['SILICONFLOW_API_KEY'] && !map['SILICONFLOW_API_KEY'].includes('****')) { if (map['SILICONFLOW_API_KEY'] && !map['SILICONFLOW_API_KEY'].includes('****')) {
siliconflowKey.value = map['SILICONFLOW_API_KEY'] siliconflowKey.value = map['SILICONFLOW_API_KEY']
} }

View File

@@ -226,7 +226,7 @@ async function loadTemplates() {
templateLoading.value = true templateLoading.value = true
try { try {
const res = await getPromptTemplates() const res = await getPromptTemplates()
templates.value = res.data templates.value = res as any
} catch { /* ignore */ } finally { templateLoading.value = false } } catch { /* ignore */ } finally { templateLoading.value = false }
} }
@@ -240,7 +240,7 @@ async function saveTemplate(tpl: Template) {
async function loadMappingTypes() { async function loadMappingTypes() {
try { try {
const res = await getMappingTypes() const res = await getMappingTypes()
mappingTypes.value = res.data mappingTypes.value = res as any
} catch { /* ignore */ } } catch { /* ignore */ }
} }
@@ -248,7 +248,7 @@ async function loadMappings() {
mappingLoading.value = true mappingLoading.value = true
try { try {
const res = await getPromptMappings(currentType.value || undefined) const res = await getPromptMappings(currentType.value || undefined)
mappings.value = res.data mappings.value = res as any
} catch { /* ignore */ } finally { mappingLoading.value = false } } catch { /* ignore */ } finally { mappingLoading.value = false }
} }
@@ -312,7 +312,7 @@ async function handlePreview() {
previewing.value = true previewing.value = true
try { try {
const res = await previewPrompt(previewParams.value) const res = await previewPrompt(previewParams.value)
previewResult.value = res.data.prompt previewResult.value = (res as any).prompt
} catch (e: any) { } catch (e: any) {
ElMessage.error(e?.response?.data?.detail || '预览失败') ElMessage.error(e?.response?.data?.detail || '预览失败')
} finally { previewing.value = false } } finally { previewing.value = false }

View File

@@ -1,328 +1,97 @@
-- 玉宗 - 珠宝设计大师 数据库初始化脚本 -- 玉宗 - 珠宝设计大师 数据库初始化脚本(全量数据)
-- 使用前请先创建数据库: CREATE DATABASE yuzong CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; -- 使用前请先创建数据库: CREATE DATABASE yssjs CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- 导入命令: mysql --default-character-set=utf8mb4 -u root -p yuzong < init_data.sql -- 导入命令: mysql --default-character-set=utf8mb4 -u yssjs -pyssjs yssjs < init_data.sql
-- 注意: designs 表包含 6 个可选设计参数字段: -- 注意: system_configs 中的 API Key 已脱敏,部署后请在后台管理系统中重新配置
-- carving_technique(雕刻工艺), design_style(设计风格), motif(题材纹样),
-- size_spec(尺寸规格), surface_finish(表面处理), usage_scene(用途场景)
SET NAMES utf8mb4; SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ======================================== -- ========================================
-- 品类数据 (12个品类) -- 建表: users
-- ======================================== -- ========================================
INSERT INTO categories (id, name, icon, sort_order, flow_type) VALUES CREATE TABLE IF NOT EXISTS `users` (
(1, '牌子', NULL, 1, 'full'), `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '用户ID',
(2, '珠子', NULL, 2, 'size_color'), `username` VARCHAR(50) NOT NULL UNIQUE COMMENT '用户名',
(3, '手把件', NULL, 3, 'full'), `phone` VARCHAR(20) DEFAULT NULL UNIQUE COMMENT '手机号',
(4, '雕刻件', NULL, 4, 'full'), `hashed_password` VARCHAR(255) NOT NULL COMMENT '加密密码',
(5, '摆件', NULL, 5, 'full'), `nickname` VARCHAR(50) DEFAULT NULL COMMENT '昵称',
(6, '手镯', NULL, 6, 'full'), `avatar` VARCHAR(255) DEFAULT NULL COMMENT '头像URL',
(7, '耳钉', NULL, 7, 'full'), `is_admin` TINYINT(1) NOT NULL DEFAULT 0 COMMENT '是否管理员',
(8, '耳饰', NULL, 8, 'full'), `created_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
(9, '手链', NULL, 9, 'size_color'), `updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
(10, '项链', NULL, 10, 'full'), ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='用户表';
(11, '戒指', NULL, 11, 'full'),
(12, '表带', NULL, 12, 'size_color');
-- ======================================== -- ========================================
-- 牌子的子类型 (category_id=1) - 牌型 -- 建表: categories
-- ======================================== -- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES CREATE TABLE IF NOT EXISTS `categories` (
(1, '二五牌', NULL, NULL, 1), `id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '品类ID',
(1, '三角牌', NULL, NULL, 2), `name` VARCHAR(50) NOT NULL COMMENT '品类名称',
(1, '三五牌', NULL, NULL, 3), `icon` VARCHAR(255) DEFAULT NULL COMMENT '品类图标',
(1, '四六牌', NULL, NULL, 4), `sort_order` INT DEFAULT 0 COMMENT '排序',
(1, '正方形', NULL, NULL, 5), `flow_type` VARCHAR(20) NOT NULL COMMENT '流程类型full/size_color/simple'
(1, '椭圆形', NULL, NULL, 6); ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='品类表';
-- ======================================== -- ========================================
-- 珠子的子类型 (category_id=2) - 尺寸 -- 建表: sub_types
-- ======================================== -- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES CREATE TABLE IF NOT EXISTS `sub_types` (
(2, '4mm', NULL, NULL, 1), `id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '子类型ID',
(2, '6mm', NULL, NULL, 2), `category_id` INT NOT NULL COMMENT '所属品类',
(2, '8mm', NULL, NULL, 3), `name` VARCHAR(50) NOT NULL COMMENT '名称',
(2, '10mm', NULL, NULL, 4), `description` VARCHAR(255) DEFAULT NULL COMMENT '描述',
(2, '12mm', NULL, NULL, 5), `preview_image` VARCHAR(255) DEFAULT NULL COMMENT '预览图',
(2, '14mm', NULL, NULL, 6), `sort_order` INT DEFAULT 0 COMMENT '排序',
(2, '16mm', NULL, NULL, 7), CONSTRAINT `fk_sub_types_category` FOREIGN KEY (`category_id`) REFERENCES `categories`(`id`)
(2, '18mm', NULL, NULL, 8), ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='子类型表';
(2, '20mm', NULL, NULL, 9);
-- ======================================== -- ========================================
-- 手把件的子类型 (category_id=3) - 题材 -- 建表: colors
-- ======================================== -- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES CREATE TABLE IF NOT EXISTS `colors` (
(3, '山水手把件', '山水意境题材', NULL, 1), `id` INT AUTO_INCREMENT PRIMARY KEY COMMENT '颜色ID',
(3, '动物手把件', '动物造型题材', NULL, 2), `category_id` INT NOT NULL COMMENT '适用品类',
(3, '瑞兽手把件', '貔貅、麒麟等瑞兽', NULL, 3), `name` VARCHAR(50) NOT NULL COMMENT '颜色名称',
(3, '人物手把件', '人物造型题材', NULL, 4), `hex_code` VARCHAR(7) NOT NULL COMMENT '色值',
(3, '花鸟手把件', '花鸟自然题材', NULL, 5), `sort_order` INT DEFAULT 0 COMMENT '排序',
(3, '佛像手把件', '佛教题材', NULL, 6); CONSTRAINT `fk_colors_category` FOREIGN KEY (`category_id`) REFERENCES `categories`(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='颜色表';
-- ======================================== -- ========================================
-- 雕刻件的子类型 (category_id=4) - 题材 -- 建表: designs
-- ======================================== -- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES CREATE TABLE IF NOT EXISTS `designs` (
(4, '山水雕刻', '山水意境雕刻', NULL, 1), `id` BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '设计ID',
(4, '花鸟雕刻', '花鸟自然雕刻', NULL, 2), `user_id` BIGINT NOT NULL COMMENT '用户ID',
(4, '人物雕刻', '人物造型雕刻', NULL, 3), `category_id` INT NOT NULL COMMENT '品类ID',
(4, '佛像雕刻', '佛教题材雕刻', NULL, 4), `sub_type_id` INT DEFAULT NULL COMMENT '子类型ID',
(4, '瑞兽雕刻', '瑞兽神兽雕刻', NULL, 5), `color_id` INT DEFAULT NULL COMMENT '颜色ID',
(4, '仿古雕刻', '仿古纹饰雕刻', NULL, 6); `prompt` TEXT NOT NULL COMMENT '设计需求',
`carving_technique` VARCHAR(50) DEFAULT NULL COMMENT '雕刻工艺',
`design_style` VARCHAR(50) DEFAULT NULL COMMENT '设计风格',
`motif` VARCHAR(100) DEFAULT NULL COMMENT '题材纹样',
`size_spec` VARCHAR(100) DEFAULT NULL COMMENT '尺寸规格',
`surface_finish` VARCHAR(50) DEFAULT NULL COMMENT '表面处理',
`usage_scene` VARCHAR(50) DEFAULT NULL COMMENT '用途场景',
`image_url` TEXT DEFAULT NULL COMMENT '设计图URL',
`status` VARCHAR(20) DEFAULT 'generating' COMMENT '状态',
`created_at` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
`updated_at` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
CONSTRAINT `fk_designs_user` FOREIGN KEY (`user_id`) REFERENCES `users`(`id`),
CONSTRAINT `fk_designs_category` FOREIGN KEY (`category_id`) REFERENCES `categories`(`id`),
CONSTRAINT `fk_designs_sub_type` FOREIGN KEY (`sub_type_id`) REFERENCES `sub_types`(`id`),
CONSTRAINT `fk_designs_color` FOREIGN KEY (`color_id`) REFERENCES `colors`(`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='设计作品表';
-- ======================================== -- ========================================
-- 摆件的子类型 (category_id=5) - 题材 -- 建表: design_images如不存在
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(5, '山水摆件', '山水意境摆件', NULL, 1),
(5, '人物摆件', '人物造型摆件', NULL, 2),
(5, '动物摆件', '动物造型摆件', NULL, 3),
(5, '佛像摆件', '佛教题材摆件', NULL, 4),
(5, '花鸟摆件', '花鸟自然摆件', NULL, 5),
(5, '器皿摆件', '香炉、花瓶等器皿', NULL, 6);
-- ========================================
-- 手镯的子类型 (category_id=6) - 镯型
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(6, '平安镯', '内平外圆,最经典的镯型', NULL, 1),
(6, '福镯', '内圆外圆,圆条造型', NULL, 2),
(6, '贵妃镯', '椭圆形,贴合手腕', NULL, 3),
(6, '美人镯', '条杆纤细,秀气典雅', NULL, 4),
(6, '方镯', '方形截面,棱角分明', NULL, 5),
(6, '雕花镯', '表面雕刻纹饰', NULL, 6);
-- ========================================
-- 耳钉的子类型 (category_id=7) - 形状
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(7, '圆形耳钉', '经典圆形造型', NULL, 1),
(7, '水滴形耳钉', '水滴形优雅造型', NULL, 2),
(7, '方形耳钉', '方形简约造型', NULL, 3),
(7, '花朵形耳钉', '花朵造型', NULL, 4),
(7, '心形耳钉', '心形浪漫造型', NULL, 5),
(7, '几何形耳钉', '几何抽象造型', NULL, 6);
-- ========================================
-- 耳饰的子类型 (category_id=8) - 款式
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(8, '耳环', '圆环形耳饰', NULL, 1),
(8, '耳坠', '垂坠型耳饰', NULL, 2),
(8, '耳夹', '无需耳洞的耳饰', NULL, 3),
(8, '流苏耳饰', '长款流苏造型', NULL, 4);
-- ========================================
-- 手链的子类型 (category_id=9) - 珠径
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(9, '6mm', NULL, NULL, 1),
(9, '8mm', NULL, NULL, 2),
(9, '10mm', NULL, NULL, 3),
(9, '12mm', NULL, NULL, 4),
(9, '14mm', NULL, NULL, 5);
-- ========================================
-- 项链的子类型 (category_id=10) - 款式
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(10, '锁骨链', '短款锁骨链', NULL, 1),
(10, '吊坠项链', '搭配玉石吊坠', NULL, 2),
(10, '串珠项链', '玉珠串联而成', NULL, 3),
(10, '编绳项链', '编织绳搭配玉石', NULL, 4),
(10, '毛衣链', '长款毛衣链', NULL, 5);
-- ========================================
-- 戒指的子类型 (category_id=11) - 款式
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(11, '素面戒指', '光面简约戒指', NULL, 1),
(11, '镶嵌戒指', '金属镶嵌玉石', NULL, 2),
(11, '雕花戒指', '表面雕刻纹饰', NULL, 3),
(11, '扳指', '传统扳指造型', NULL, 4),
(11, '指环', '环形简约指环', NULL, 5);
-- ========================================
-- 表带的子类型 (category_id=12) - 宽度
-- ========================================
INSERT INTO sub_types (category_id, name, description, preview_image, sort_order) VALUES
(12, '18mm', NULL, NULL, 1),
(12, '20mm', NULL, NULL, 2),
(12, '22mm', NULL, NULL, 3),
(12, '24mm', NULL, NULL, 4);
-- ========================================
-- 颜色数据
-- 基于和田玉国标颜色分类及市场主流色种
-- ========================================
-- 牌子颜色 (category_id=1) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(1, '白玉', '#FEFEF2', 1),
(1, '青白玉', '#E8EDE4', 2),
(1, '青玉', '#7A8B6E', 3),
(1, '碧玉', '#2D5F2D', 4),
(1, '翠青', '#6BAF8D', 5),
(1, '黄玉', '#D4A843', 6),
(1, '糖玉', '#C4856C', 7),
(1, '墨玉', '#2C2C2C', 8),
(1, '藕粉', '#E8B4B8', 9),
(1, '烟紫', '#8B7D9B', 10);
-- 珠子颜色 (category_id=2) - 11种(含糖白)
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(2, '糖白', '#F5F0E8', 1),
(2, '白玉', '#FEFEF2', 2),
(2, '碧玉', '#2D5F2D', 3),
(2, '青白玉', '#E8EDE4', 4),
(2, '青玉', '#7A8B6E', 5),
(2, '翠青', '#6BAF8D', 6),
(2, '黄玉', '#D4A843', 7),
(2, '糖玉', '#C4856C', 8),
(2, '墨玉', '#2C2C2C', 9),
(2, '藕粉', '#E8B4B8', 10),
(2, '烟紫', '#8B7D9B', 11);
-- 手把件颜色 (category_id=3) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(3, '白玉', '#FEFEF2', 1),
(3, '青白玉', '#E8EDE4', 2),
(3, '青玉', '#7A8B6E', 3),
(3, '碧玉', '#2D5F2D', 4),
(3, '翠青', '#6BAF8D', 5),
(3, '黄玉', '#D4A843', 6),
(3, '糖玉', '#C4856C', 7),
(3, '墨玉', '#2C2C2C', 8),
(3, '藕粉', '#E8B4B8', 9),
(3, '烟紫', '#8B7D9B', 10);
-- 雕刻件颜色 (category_id=4) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(4, '白玉', '#FEFEF2', 1),
(4, '青白玉', '#E8EDE4', 2),
(4, '青玉', '#7A8B6E', 3),
(4, '碧玉', '#2D5F2D', 4),
(4, '翠青', '#6BAF8D', 5),
(4, '黄玉', '#D4A843', 6),
(4, '糖玉', '#C4856C', 7),
(4, '墨玉', '#2C2C2C', 8),
(4, '藕粉', '#E8B4B8', 9),
(4, '烟紫', '#8B7D9B', 10);
-- 摆件颜色 (category_id=5) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(5, '白玉', '#FEFEF2', 1),
(5, '青白玉', '#E8EDE4', 2),
(5, '青玉', '#7A8B6E', 3),
(5, '碧玉', '#2D5F2D', 4),
(5, '翠青', '#6BAF8D', 5),
(5, '黄玉', '#D4A843', 6),
(5, '糖玉', '#C4856C', 7),
(5, '墨玉', '#2C2C2C', 8),
(5, '藕粉', '#E8B4B8', 9),
(5, '烟紫', '#8B7D9B', 10);
-- 手镯颜色 (category_id=6) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(6, '白玉', '#FEFEF2', 1),
(6, '青白玉', '#E8EDE4', 2),
(6, '青玉', '#7A8B6E', 3),
(6, '碧玉', '#2D5F2D', 4),
(6, '翠青', '#6BAF8D', 5),
(6, '黄玉', '#D4A843', 6),
(6, '糖玉', '#C4856C', 7),
(6, '墨玉', '#2C2C2C', 8),
(6, '藕粉', '#E8B4B8', 9),
(6, '烟紫', '#8B7D9B', 10);
-- 耳钉颜色 (category_id=7) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(7, '白玉', '#FEFEF2', 1),
(7, '青白玉', '#E8EDE4', 2),
(7, '青玉', '#7A8B6E', 3),
(7, '碧玉', '#2D5F2D', 4),
(7, '翠青', '#6BAF8D', 5),
(7, '黄玉', '#D4A843', 6),
(7, '糖玉', '#C4856C', 7),
(7, '墨玉', '#2C2C2C', 8),
(7, '藕粉', '#E8B4B8', 9),
(7, '烟紫', '#8B7D9B', 10);
-- 耳饰颜色 (category_id=8) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(8, '白玉', '#FEFEF2', 1),
(8, '青白玉', '#E8EDE4', 2),
(8, '青玉', '#7A8B6E', 3),
(8, '碧玉', '#2D5F2D', 4),
(8, '翠青', '#6BAF8D', 5),
(8, '黄玉', '#D4A843', 6),
(8, '糖玉', '#C4856C', 7),
(8, '墨玉', '#2C2C2C', 8),
(8, '藕粉', '#E8B4B8', 9),
(8, '烟紫', '#8B7D9B', 10);
-- 手链颜色 (category_id=9) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(9, '白玉', '#FEFEF2', 1),
(9, '青白玉', '#E8EDE4', 2),
(9, '青玉', '#7A8B6E', 3),
(9, '碧玉', '#2D5F2D', 4),
(9, '翠青', '#6BAF8D', 5),
(9, '黄玉', '#D4A843', 6),
(9, '糖玉', '#C4856C', 7),
(9, '墨玉', '#2C2C2C', 8),
(9, '藕粉', '#E8B4B8', 9),
(9, '烟紫', '#8B7D9B', 10);
-- 项链颜色 (category_id=10) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(10, '白玉', '#FEFEF2', 1),
(10, '青白玉', '#E8EDE4', 2),
(10, '青玉', '#7A8B6E', 3),
(10, '碧玉', '#2D5F2D', 4),
(10, '翠青', '#6BAF8D', 5),
(10, '黄玉', '#D4A843', 6),
(10, '糖玉', '#C4856C', 7),
(10, '墨玉', '#2C2C2C', 8),
(10, '藕粉', '#E8B4B8', 9),
(10, '烟紫', '#8B7D9B', 10);
-- 戒指颜色 (category_id=11) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(11, '白玉', '#FEFEF2', 1),
(11, '青白玉', '#E8EDE4', 2),
(11, '青玉', '#7A8B6E', 3),
(11, '碧玉', '#2D5F2D', 4),
(11, '翠青', '#6BAF8D', 5),
(11, '黄玉', '#D4A843', 6),
(11, '糖玉', '#C4856C', 7),
(11, '墨玉', '#2C2C2C', 8),
(11, '藕粉', '#E8B4B8', 9),
(11, '烟紫', '#8B7D9B', 10);
-- 表带颜色 (category_id=12) - 全部10种
INSERT INTO colors (category_id, name, hex_code, sort_order) VALUES
(12, '白玉', '#FEFEF2', 1),
(12, '青白玉', '#E8EDE4', 2),
(12, '青玉', '#7A8B6E', 3),
(12, '碧玉', '#2D5F2D', 4),
(12, '翠青', '#6BAF8D', 5),
(12, '黄玉', '#D4A843', 6),
(12, '糖玉', '#C4856C', 7),
(12, '墨玉', '#2C2C2C', 8),
(12, '藕粉', '#E8B4B8', 9),
(12, '烟紫', '#8B7D9B', 10);
-- ========================================
-- design_images 表AI 多视角设计图)
-- ======================================== -- ========================================
CREATE TABLE IF NOT EXISTS design_images ( CREATE TABLE IF NOT EXISTS design_images (
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '图片ID', id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '图片ID',
design_id BIGINT NOT NULL COMMENT '关联设计ID', design_id BIGINT NOT NULL COMMENT '关联设计ID',
view_name VARCHAR(20) NOT NULL COMMENT '视角名称: 效果图/正面图/侧面图/背面图', view_name VARCHAR(20) NOT NULL COMMENT '视角名称: 效果图/正面图/侧面图/背面图',
image_url VARCHAR(255) DEFAULT NULL COMMENT '图片URL路径', image_url TEXT DEFAULT NULL COMMENT '图片URL路径',
model_used VARCHAR(50) DEFAULT NULL COMMENT '使用的AI模型: flux-dev/seedream-4.5', model_used VARCHAR(50) DEFAULT NULL COMMENT '使用的AI模型',
prompt_used TEXT DEFAULT NULL COMMENT '实际使用的英文prompt', prompt_used TEXT DEFAULT NULL COMMENT '实际使用的英文prompt',
sort_order INT DEFAULT 0 COMMENT '排序', sort_order INT DEFAULT 0 COMMENT '排序',
created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间', created_at DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
@@ -331,7 +100,7 @@ CREATE TABLE IF NOT EXISTS design_images (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI多视角设计图'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='AI多视角设计图';
-- ======================================== -- ========================================
-- system_configs 表(系统配置 -- 建表: system_configs(如不存在
-- ======================================== -- ========================================
CREATE TABLE IF NOT EXISTS system_configs ( CREATE TABLE IF NOT EXISTS system_configs (
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '配置ID', id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT '配置ID',
@@ -343,14 +112,357 @@ CREATE TABLE IF NOT EXISTS system_configs (
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间' updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统配置表'; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='系统配置表';
-- 插入默认 AI 配置项 -- ========================================
INSERT IGNORE INTO system_configs (config_key, config_value, description, config_group, is_secret) VALUES -- 建表: prompt_mappings如不存在
('SILICONFLOW_API_KEY', '', 'SiliconFlow API Key', 'ai', 'Y'), -- ========================================
('SILICONFLOW_BASE_URL', 'https://api.siliconflow.cn/v1', 'SiliconFlow 接口地址', 'ai', 'N'), CREATE TABLE IF NOT EXISTS prompt_mappings (
('VOLCENGINE_API_KEY', '', '火山引擎 API Key', 'ai', 'Y'), id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
('VOLCENGINE_BASE_URL', 'https://ark.cn-beijing.volces.com/api/v3', '火山引擎接口地址', 'ai', 'N'), mapping_type VARCHAR(20) NOT NULL COMMENT '映射类型: category/color/view/carving/style/motif/finish/scene/sub_type',
('AI_IMAGE_MODEL', 'flux-dev', '默认AI生图模型 (flux-dev / seedream-4.5)', 'ai', 'N'), cn_key VARCHAR(50) NOT NULL COMMENT '中文键',
('AI_IMAGE_SIZE', '1024', 'AI生图默认尺寸', 'ai', 'N'); en_value TEXT NOT NULL COMMENT '英文值',
sort_order INT DEFAULT 0 COMMENT '排序',
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
UNIQUE KEY uk_type_key (mapping_type, cn_key)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='中英文提示词映射表';
-- ========================================
-- 建表: prompt_templates如不存在
-- ========================================
CREATE TABLE IF NOT EXISTS prompt_templates (
id BIGINT AUTO_INCREMENT PRIMARY KEY COMMENT 'ID',
template_key VARCHAR(50) NOT NULL UNIQUE COMMENT '模板键',
template_value TEXT NOT NULL COMMENT '模板内容',
description VARCHAR(255) COMMENT '说明',
updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='提示词模板表';
-- ========================================
-- categories 数据 (12 条)
-- ========================================
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (1, '牌子', NULL, 1, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (2, '珠子', NULL, 2, 'size_color');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (3, '手把件', NULL, 3, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (4, '雕刻件', NULL, 4, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (5, '摆件', NULL, 5, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (6, '手镯', NULL, 6, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (7, '耳钉', NULL, 7, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (8, '耳饰', NULL, 8, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (9, '手链', NULL, 9, 'size_color');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (10, '项链', NULL, 10, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (11, '戒指', NULL, 11, 'full');
INSERT IGNORE INTO `categories` (`id`, `name`, `icon`, `sort_order`, `flow_type`) VALUES (12, '表带', NULL, 12, 'size_color');
-- ========================================
-- sub_types 数据 (68 条)
-- ========================================
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (1, 1, '二五牌', NULL, NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (2, 1, '三角牌', NULL, NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (3, 1, '三五牌', NULL, NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (4, 1, '四六牌', NULL, NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (5, 1, '正方形', NULL, NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (6, 1, '椭圆形', NULL, NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (7, 2, '4mm', NULL, NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (8, 2, '6mm', NULL, NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (9, 2, '8mm', NULL, NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (10, 2, '10mm', NULL, NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (11, 2, '12mm', NULL, NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (12, 2, '14mm', NULL, NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (13, 2, '16mm', NULL, NULL, 7);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (14, 2, '18mm', NULL, NULL, 8);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (15, 2, '20mm', NULL, NULL, 9);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (16, 3, '山水手把件', '山水意境题材', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (17, 3, '动物手把件', '动物造型题材', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (18, 3, '瑞兽手把件', '貔貅、麒麟等瑞兽', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (19, 3, '人物手把件', '人物造型题材', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (20, 3, '花鸟手把件', '花鸟自然题材', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (21, 3, '佛像手把件', '佛教题材', NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (22, 4, '山水雕刻', '山水意境雕刻', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (23, 4, '花鸟雕刻', '花鸟自然雕刻', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (24, 4, '人物雕刻', '人物造型雕刻', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (25, 4, '佛像雕刻', '佛教题材雕刻', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (26, 4, '瑞兽雕刻', '瑞兽神兽雕刻', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (27, 4, '仿古雕刻', '仿古纹饰雕刻', NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (28, 5, '山水摆件', '山水意境摆件', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (29, 5, '人物摆件', '人物造型摆件', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (30, 5, '动物摆件', '动物造型摆件', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (31, 5, '佛像摆件', '佛教题材摆件', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (32, 5, '花鸟摆件', '花鸟自然摆件', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (33, 5, '器皿摆件', '香炉、花瓶等器皿', NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (34, 6, '平安镯', '内平外圆,最经典的镯型', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (35, 6, '福镯', '内圆外圆,圆条造型', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (36, 6, '贵妃镯', '椭圆形,贴合手腕', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (37, 6, '美人镯', '条杆纤细,秀气典雅', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (38, 6, '方镯', '方形截面,棱角分明', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (39, 6, '雕花镯', '表面雕刻纹饰', NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (40, 7, '圆形耳钉', '经典圆形造型', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (41, 7, '水滴形耳钉', '水滴形优雅造型', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (42, 7, '方形耳钉', '方形简约造型', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (43, 7, '花朵形耳钉', '花朵造型', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (44, 7, '心形耳钉', '心形浪漫造型', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (45, 7, '几何形耳钉', '几何抽象造型', NULL, 6);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (46, 8, '耳环', '圆环形耳饰', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (47, 8, '耳坠', '垂坠型耳饰', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (48, 8, '耳夹', '无需耳洞的耳饰', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (49, 8, '流苏耳饰', '长款流苏造型', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (50, 9, '6mm', NULL, NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (51, 9, '8mm', NULL, NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (52, 9, '10mm', NULL, NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (53, 9, '12mm', NULL, NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (54, 9, '14mm', NULL, NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (55, 10, '锁骨链', '短款锁骨链', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (56, 10, '吊坠项链', '搭配玉石吊坠', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (57, 10, '串珠项链', '玉珠串联而成', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (58, 10, '编绳项链', '编织绳搭配玉石', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (59, 10, '毛衣链', '长款毛衣链', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (60, 11, '素面戒指', '光面简约戒指', NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (61, 11, '镶嵌戒指', '金属镶嵌玉石', NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (62, 11, '雕花戒指', '表面雕刻纹饰', NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (63, 11, '扳指', '传统扳指造型', NULL, 4);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (64, 11, '指环', '环形简约指环', NULL, 5);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (65, 12, '18mm', NULL, NULL, 1);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (66, 12, '20mm', NULL, NULL, 2);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (67, 12, '22mm', NULL, NULL, 3);
INSERT IGNORE INTO `sub_types` (`id`, `category_id`, `name`, `description`, `preview_image`, `sort_order`) VALUES (68, 12, '24mm', NULL, NULL, 4);
-- ========================================
-- colors 数据 (121 条)
-- ========================================
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (1, 2, '糖白', '#F5F0E8', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (2, 2, '白玉', '#FEFEF2', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (3, 2, '碧玉', '#2D5F2D', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (4, 1, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (5, 1, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (6, 1, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (7, 1, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (8, 1, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (9, 1, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (10, 1, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (11, 1, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (12, 1, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (13, 1, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (14, 3, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (15, 3, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (16, 3, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (17, 3, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (18, 3, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (19, 3, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (20, 3, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (21, 3, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (22, 3, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (23, 3, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (24, 4, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (25, 4, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (26, 4, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (27, 4, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (28, 4, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (29, 4, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (30, 4, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (31, 4, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (32, 4, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (33, 4, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (34, 5, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (35, 5, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (36, 5, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (37, 5, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (38, 5, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (39, 5, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (40, 5, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (41, 5, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (42, 5, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (43, 5, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (44, 6, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (45, 6, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (46, 6, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (47, 6, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (48, 6, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (49, 6, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (50, 6, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (51, 6, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (52, 6, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (53, 6, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (54, 7, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (55, 7, '碧玉', '#2D5F2D', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (56, 7, '翠青', '#6BAF8D', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (57, 7, '黄玉', '#D4A843', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (58, 7, '藕粉', '#E8B4B8', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (59, 7, '烟紫', '#8B7D9B', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (60, 8, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (61, 8, '碧玉', '#2D5F2D', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (62, 8, '翠青', '#6BAF8D', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (63, 8, '黄玉', '#D4A843', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (64, 8, '藕粉', '#E8B4B8', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (65, 8, '烟紫', '#8B7D9B', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (66, 9, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (67, 9, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (68, 9, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (69, 9, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (70, 9, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (71, 9, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (72, 9, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (73, 9, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (74, 9, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (75, 9, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (76, 10, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (77, 10, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (78, 10, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (79, 10, '碧玉', '#2D5F2D', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (80, 10, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (81, 10, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (82, 10, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (83, 10, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (84, 10, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (85, 10, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (86, 11, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (87, 11, '碧玉', '#2D5F2D', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (88, 11, '翠青', '#6BAF8D', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (89, 11, '黄玉', '#D4A843', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (90, 11, '墨玉', '#2C2C2C', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (91, 11, '藕粉', '#E8B4B8', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (92, 12, '白玉', '#FEFEF2', 1);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (93, 12, '青玉', '#7A8B6E', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (94, 12, '碧玉', '#2D5F2D', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (95, 12, '糖玉', '#C4856C', 4);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (96, 12, '墨玉', '#2C2C2C', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (97, 2, '青白玉', '#E8EDE4', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (98, 2, '青玉', '#7A8B6E', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (99, 2, '翠青', '#6BAF8D', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (100, 2, '黄玉', '#D4A843', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (101, 2, '糖玉', '#C4856C', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (102, 2, '墨玉', '#2C2C2C', 11);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (103, 2, '藕粉', '#E8B4B8', 12);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (104, 2, '烟紫', '#8B7D9B', 13);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (105, 7, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (106, 7, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (107, 7, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (108, 7, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (109, 8, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (110, 8, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (111, 8, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (112, 8, '墨玉', '#2C2C2C', 8);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (113, 11, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (114, 11, '青玉', '#7A8B6E', 3);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (115, 11, '糖玉', '#C4856C', 7);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (116, 11, '烟紫', '#8B7D9B', 10);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (117, 12, '青白玉', '#E8EDE4', 2);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (118, 12, '翠青', '#6BAF8D', 5);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (119, 12, '黄玉', '#D4A843', 6);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (120, 12, '藕粉', '#E8B4B8', 9);
INSERT IGNORE INTO `colors` (`id`, `category_id`, `name`, `hex_code`, `sort_order`) VALUES (121, 12, '烟紫', '#8B7D9B', 10);
-- ========================================
-- prompt_mappings 数据 (92 条)
-- ========================================
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (1, 'category', '牌子', 'Chinese Hetian nephrite jade pendant plaque, rectangular tablet shape', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (2, 'category', '珠子', 'Chinese Hetian nephrite jade bead, perfectly round sphere', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (3, 'category', '手把件', 'Chinese Hetian nephrite jade hand piece (palm stone), ergonomic carved ornament for hand play', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (4, 'category', '雕刻件', 'Chinese Hetian nephrite jade carving, intricate sculptural artwork', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (5, 'category', '摆件', 'Chinese Hetian nephrite jade display sculpture, decorative art piece on wooden stand', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (6, 'category', '手镯', 'Chinese Hetian nephrite jade bangle bracelet, smooth circular form', 5, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (7, 'category', '耳钉', 'Chinese Hetian nephrite jade stud earring, delicate small jewelry piece', 6, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (8, 'category', '耳饰', 'Chinese Hetian nephrite jade drop earring, elegant dangling jewelry', 7, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (9, 'category', '手链', 'Chinese Hetian nephrite jade bead bracelet, string of polished beads', 8, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (10, 'category', '项链', 'Chinese Hetian nephrite jade necklace, elegant pendant on chain', 9, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (11, 'category', '戒指', 'Chinese Hetian nephrite jade ring, polished jade mounted on band', 10, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (12, 'category', '表带', 'Chinese Hetian nephrite jade watch strap, segmented jade links', 11, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (13, 'color', '白玉', 'pure white nephrite jade, milky translucent, warm ivory tone', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (14, 'color', '青白玉', 'celadon-white nephrite jade, pale greenish-white, subtle cool tone', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (15, 'color', '青玉', 'celadon nephrite jade, muted sage green, natural earthy green', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (16, 'color', '碧玉', 'deep green jasper nephrite jade, rich forest green, vivid saturated', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (17, 'color', '翠青', 'emerald-tinted nephrite jade, fresh spring green with blue undertone', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (18, 'color', '黄玉', 'golden yellow nephrite jade, warm honey amber, rich golden hue', 5, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (19, 'color', '糖玉', 'sugar-brown nephrite jade, warm caramel brown with reddish tint', 6, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (20, 'color', '墨玉', 'ink-black nephrite jade, deep charcoal black, mysterious dark', 7, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (21, 'color', '藕粉', 'lotus-pink nephrite jade, soft blush pink, delicate pastel rose', 8, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (22, 'color', '烟紫', 'smoky purple nephrite jade, muted lavender grey, subtle violet', 9, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (23, 'color', '糖白', 'sugar-white nephrite jade, creamy white with light brown edges', 10, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (24, 'view', '效果图', 'three-quarter view, 45-degree angle, hero shot, dramatic perspective showing depth and dimension', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (25, 'view', '正面图', 'front view, straight-on, flat lay centered, facing camera directly', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (26, 'view', '侧面图', 'side profile view, 90-degree lateral angle, showing thickness and contour', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (27, 'view', '背面图', 'back view, rear side, showing reverse surface and texture', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (28, 'carving', '浮雕', 'relief carving with raised design emerging from surface', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (29, 'carving', '圆雕', 'full three-dimensional round carving, sculptural in the round', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (30, 'carving', '镂空雕', 'openwork pierced carving, intricate hollow cutout patterns', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (31, 'carving', '阴刻', 'intaglio engraving, incised lines carved into the surface', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (32, 'carving', '线雕', 'fine line engraving, delicate linear incised pattern', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (33, 'carving', '俏色雕', 'qiaose color-play carving utilizing natural jade skin color contrast', 5, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (34, 'carving', '薄意雕', 'shallow thin-relief carving, subtle and understated surface design', 6, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (35, 'carving', '素面', 'plain polished surface, smooth minimalist finish without carving', 7, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (36, 'style', '古典传统', 'classical traditional Chinese style, antique aesthetic, heritage craftsmanship', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (37, 'style', '新中式', 'modern neo-Chinese style, contemporary Asian minimalism with traditional elements', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (38, 'style', '写实', 'realistic naturalistic style, lifelike detailed representation', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (39, 'style', '抽象意境', 'abstract artistic impression, fluid organic forms, poetic mood', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (40, 'style', '极简素面', 'ultra-minimalist clean design, sleek smooth surface, zen aesthetic', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (41, 'motif', '观音', 'Guanyin Bodhisattva figure, serene Buddhist deity of mercy', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (42, 'motif', '弥勒', 'Maitreya laughing Buddha, jovial happy Buddha figure', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (43, 'motif', '莲花', 'lotus flower motif, sacred Buddhist lotus blossom petals', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (44, 'motif', '貔貅', 'Pixiu mythical beast, Chinese fortune guardian creature', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (45, 'motif', '龙凤', 'dragon and phoenix motif, imperial auspicious dual creatures', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (46, 'motif', '麒麟', 'Qilin mythical unicorn, auspicious Chinese legendary beast', 5, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (47, 'motif', '山水', 'Chinese mountain and water landscape, shanshui scenery', 6, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (48, 'motif', '花鸟', 'flower and bird motif, traditional Chinese nature painting theme', 7, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (49, 'motif', '人物', 'human figure motif, classical Chinese character portrayal', 8, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (50, 'motif', '回纹', 'Greek key fret pattern, Chinese meander geometric border', 9, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (51, 'motif', '如意', 'Ruyi scepter motif, auspicious cloud-head wish-granting symbol', 10, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (52, 'motif', '平安扣', 'Ping\'an buckle motif, smooth circular safety and peace symbol', 11, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (53, 'finish', '', 'high-gloss mirror polish, reflective glossy surface', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (54, 'finish', '/', 'matte satin finish, soft non-reflective surface', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (55, 'finish', '', 'frosted textured finish, fine granular surface', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (56, 'finish', '', 'natural jade skin preserved, raw russet-brown outer skin layer retained', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (57, 'scene', '', 'designed for daily wear, comfortable and practical', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (58, 'scene', '', 'museum-quality collector piece, exquisite showpiece', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (59, 'scene', '', 'premium gift piece, ceremonial and auspicious', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (60, 'scene', '', 'tactile palm play piece, smooth hand-feel for meditation', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (61, 'sub_type', '', '2:5 ratio rectangular plaque', 0, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (62, 'sub_type', '', 'triangular shaped pendant', 1, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (63, 'sub_type', '', '3:5 ratio rectangular plaque', 2, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (64, 'sub_type', '', '4:6 ratio rectangular plaque', 3, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (65, 'sub_type', '', 'square shaped plaque', 4, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (66, 'sub_type', '', 'oval shaped plaque', 5, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (67, 'sub_type', '', 'flat interior round exterior classic bangle', 6, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (68, 'sub_type', '', 'round interior round exterior full-round bangle', 7, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (69, 'sub_type', '', 'oval elliptical shape bangle fitting wrist contour', 8, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (70, 'sub_type', '', 'slim delicate thin bangle, elegant refined', 9, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (71, 'sub_type', '', 'square cross-section angular bangle', 10, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (72, 'sub_type', '', 'carved decorative pattern bangle', 11, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (73, 'sub_type', '', 'round circular stud', 12, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (74, 'sub_type', '', 'teardrop shaped stud', 13, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (75, 'sub_type', '', 'square geometric stud', 14, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (76, 'sub_type', '', 'flower blossom shaped stud', 15, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (77, 'sub_type', '', 'heart shaped stud', 16, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (78, 'sub_type', '', 'abstract geometric stud', 17, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (79, 'sub_type', '', 'hoop earring', 18, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (80, 'sub_type', '', 'drop dangle earring', 19, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (81, 'sub_type', '', 'clip-on earring', 20, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (82, 'sub_type', '', 'tassel fringe long earring', 21, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (83, 'sub_type', '', 'plain smooth surface ring', 22, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (84, 'sub_type', '', 'metal-set mounted jade ring', 23, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (85, 'sub_type', '', 'carved decorative ring', 24, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (86, 'sub_type', '', 'traditional archer thumb ring', 25, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (87, 'sub_type', '', 'simple band ring', 26, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (88, 'sub_type', '', 'short collarbone chain necklace', 27, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (89, 'sub_type', '', 'pendant necklace with jade drop', 28, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (90, 'sub_type', '', 'beaded jade strand necklace', 29, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (91, 'sub_type', '', 'braided cord necklace with jade', 30, '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_mappings` (`id`, `mapping_type`, `cn_key`, `en_value`, `sort_order`, `updated_at`) VALUES (92, 'sub_type', '', 'long sweater chain necklace', 31, '2026-03-27 07:20:55');
-- ========================================
-- prompt_templates 数据 (3 条)
-- ========================================
INSERT IGNORE INTO `prompt_templates` (`id`, `template_key`, `template_value`, `description`, `updated_at`) VALUES (1, 'main_template', '{subject}, {sub_type}, {color}, {motif}, {carving}, {style}, {finish}, {scene}, {size}, {user_prompt}, {view}, {quality}', ' - prompt: {subject}, {sub_type}, {color}, {motif}, {carving}, {style}, {finish}, {scene}, {size}, {user_prompt}, {view}, {quality}', '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_templates` (`id`, `template_key`, `template_value`, `description`, `updated_at`) VALUES (2, 'quality_suffix', 'professional jewelry product photography, studio lighting setup, pure white background, ultra-detailed, sharp focus, 8K resolution, photorealistic rendering, high-end commercial quality', ' - prompt末尾的通用质量描述', '2026-03-27 07:20:55');
INSERT IGNORE INTO `prompt_templates` (`id`, `template_key`, `template_value`, `description`, `updated_at`) VALUES (3, 'default_color', 'natural Hetian nephrite jade with warm luster', '', '2026-03-27 07:20:55');
-- ========================================
-- system_configs 数据 (6 条)
-- ========================================
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (1, 'SILICONFLOW_API_KEY', '', 'SiliconFlow API Key', 'ai', 'Y', '2026-03-27 07:43:07');
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (2, 'SILICONFLOW_BASE_URL', 'https://api.siliconflow.cn/v1', 'SiliconFlow ', 'ai', 'N', '2026-03-27 07:09:05');
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (3, 'VOLCENGINE_API_KEY', '', ' API Key', 'ai', 'Y', '2026-03-27 08:13:23');
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (4, 'VOLCENGINE_BASE_URL', 'https://ark.cn-beijing.volces.com/api/v3', '', 'ai', 'N', '2026-03-27 07:09:05');
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (5, 'AI_IMAGE_MODEL', 'seedream-5.0', 'AI生图模型 (flux-dev / seedream-4.5)', 'ai', 'N', '2026-03-27 08:20:02');
INSERT IGNORE INTO `system_configs` (`id`, `config_key`, `config_value`, `description`, `config_group`, `is_secret`, `updated_at`) VALUES (6, 'AI_IMAGE_SIZE', '1024', 'AI生图默认尺寸', 'ai', 'N', '2026-03-27 07:09:05');
SET FOREIGN_KEY_CHECKS = 1;
-- users 表添加 is_admin 字段(如果不存在) -- users 表添加 is_admin 字段(如果不存在)
-- ALTER TABLE users ADD COLUMN is_admin TINYINT(1) NOT NULL DEFAULT 0 COMMENT '' AFTER avatar; -- ALTER TABLE users ADD COLUMN is_admin TINYINT(1) NOT NULL DEFAULT 0 COMMENT '' AFTER avatar;

BIN
init_data.sql.zip Normal file

Binary file not shown.