Add shared ref-17 Studio cover template trial
studio CI and deployment / verify-and-deploy (push) Successful in 3m58s

This commit is contained in:
2026-10-26 19:59:51 +08:00
parent f8fde443f5
commit c3765e7a07
9 changed files with 242 additions and 8 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
import type {NextApiRequest,NextApiResponse} from 'next';
const docs:Record<string,string>={
'/studio/api/export/{slug}': '# 导出创作方案\n\n方法:GET\n路径参数:slug,创作方案的稳定标识。\n查询参数:format=markdown 返回 Markdown;其他值或省略时返回带 version:1 的方案 JSON,带附件文件名。\n示例:GET /studio/api/export/{slug}\n错误:404 方案不存在;405 方法不支持。',
'/studio/api/export/{slug}': '# 导出创作方案\n\n方法:GET\n路径参数:slug,创作方案的稳定标识。\n查询参数:format=markdown 返回 Markdown;format=svg&slide=0 返回模板封面 SVG(slide 为从 0 开始的整数,默认 0);其他值或省略时返回方案 JSON,带附件文件名。普通方案 version:1;模板方案 version:2,包含 template 来源链接、画板比例、原图九个 slots 及 slides 文字和颜色。模板几何共用,图片位为占位色块。\n示例:GET /studio/api/export/{slug}\n错误:400 SVG 模板或 slide 参数无效;404 方案不存在;405 方法不支持。',
'/studio/api/health': '# 创作站健康检查\n\n方法:GET, HEAD\n无业务参数。GET 返回 200 JSON:{"status":"ok","service":"prompt-studio"};HEAD 无正文。\n示例:GET /studio/api/health\n错误:405 方法不支持。',
};
export function serveApiDocumentation(req:NextApiRequest,res:NextApiResponse,path:string){