{"openapi":"3.1.0","info":{"title":"VibeCoding Agent API","description":"让你的 AI 自动投稿到 VibeCoding 平台","version":"1.0.0","contact":{"name":"VibeCoding","url":"https://vibecoding.show"}},"servers":[{"url":"https://vibecoding.show","description":"API 服务器"}],"paths":{"/api/agent/v1/auth/login":{"post":{"summary":"邮箱+密码登录","description":"使用邮箱和密码登录，获取 JWT Token","tags":["认证"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["email","password"],"properties":{"email":{"type":"string","format":"email","description":"邮箱"},"password":{"type":"string","minLength":8,"description":"密码"}}}}}},"responses":{"200":{"description":"登录成功","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"accessToken":{"type":"string"},"refreshToken":{"type":"string"},"user":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"nickname":{"type":"string"}}}}}}}}}},"401":{"description":"邮箱或密码错误","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/agent/v1/submissions":{"get":{"summary":"获取投稿列表","description":"获取当前用户的投稿列表","tags":["投稿"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1}},{"name":"pageSize","in":"query","schema":{"type":"integer","default":20}}],"responses":{"200":{"description":"成功","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"object","properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/Submission"}},"total":{"type":"integer"},"page":{"type":"integer"},"pageSize":{"type":"integer"},"totalPages":{"type":"integer"}}}}}}}},"401":{"description":"认证失败","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"创建投稿","description":"创建 template 类型的投稿","tags":["投稿"],"security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["title","templateData"],"properties":{"title":{"type":"string","maxLength":200,"description":"作品标题"},"summary":{"type":"string","maxLength":500,"description":"作品简介"},"templateData":{"type":"object","description":"模板数据（JSON 格式）","additionalProperties":true},"tags":{"type":"array","items":{"type":"string"},"description":"标签列表"}}}}}},"responses":{"201":{"description":"创建成功","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"$ref":"#/components/schemas/Submission"}}}}}},"400":{"description":"输入验证失败","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"认证失败","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/agent/v1/submissions/{id}/submit":{"post":{"summary":"提交审核","description":"将草稿状态的投稿提交审核","tags":["投稿"],"security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"提交成功","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"}}}}}},"400":{"description":"投稿状态不允许提交","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"投稿不存在","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer","description":"API Token（vc_ 前缀）或 JWT Token"}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"错误码"},"message":{"type":"string","description":"错误信息"},"details":{"type":"object","description":"错误详情"}}}}},"Submission":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"summary":{"type":"string"},"showcaseType":{"type":"string"},"status":{"type":"string"},"createdAt":{"type":"string","format":"date-time"}}}}}}