openapi: 3.0.3 info: title: AmoraiCook API description: | AmoraiCook 厨房助手小程序的官方 API 文档。 该 API 旨在提供一套完整的、面向资源的 RESTful 接口,用于支撑从菜品发现、菜谱执行、烹饪复盘到个性化菜谱进化的所有核心功能。 核心理念: 1. **菜品 (Dish) 与 菜谱 (Recipe) 分离**:用户先决策"吃什么"(Dish),再选择"怎么做"(Recipe)。 2. **成长式烹饪体验**:通过记录、复盘与迭代,帮助用户打造自己的专属菜谱库。 3. **UGC 支持**:用户不仅可以迭代菜谱,更可以创造属于自己的新菜品。 version: "1.0.0" # 微服务架构配置 x-microservices: # 服务映射规则:路由模块前缀 -> 云函数服务名 route-mapping: auth: authService recipes: contentService cookbook: userService mealPlans: kitchenService shoppingLists: kitchenService pantry: kitchenService me: userService cookingLogs: cookingService ai: aiService resources: resourceService # 服务详细信息 services: authService: description: "用户认证服务" request: "cloud" tags: ["Auth"] memory: "128MB" timeout: "5s" contentService: description: "菜品和菜谱内容管理" request: "cloud" tags: ["Recipes"] memory: "256MB" timeout: "10s" userService: description: "用户个人数据管理" request: "cloud" tags: ["User Cookbook", "User Profile"] memory: "256MB" timeout: "10s" kitchenService: description: "厨房功能:计划、采购、储藏" request: "cloud" tags: ["Meal Planning", "Shopping Lists", "User Pantry"] memory: "256MB" timeout: "15s" cookingService: description: "烹饪过程与日志" request: "cloud" tags: ["Cooking"] memory: "256MB" timeout: "10s" aiService: description: "AI智能辅助功能" request: "cloud" tags: ["AI"] memory: "1GB" timeout: "60s" resourceService: description: "资源文件管理服务" request: "native" tags: ["Resources"] memory: "256MB" timeout: "30s" servers: - url: https://api.amoraicook.com/v1 description: 生产环境服务器 - url: http://127.0.0.1:4010 description: 开发环境服务器 tags: - name: Auth description: 用户认证 - name: Recipes description: 菜谱管理 (执行层) - name: User Cookbook description: 用户的个人菜谱库 (拿手好菜) - name: User Pantry description: 用户的储藏室 (我的调料) - name: Meal Planning description: 膳食计划管理 - name: Shopping Lists description: 购物清单管理 - name: Cooking description: 烹饪过程与日志记录 - name: AI description: AI 智能辅助功能 - name: Resources description: 资源文件管理(图片、视频等) - name: User Profile description: 用户个人信息与成长体系 paths: /auth/login/wechat-miniprogram: $ref: './spec/paths/auth.yaml#/loginWithWechatMiniprogram' /recipes: $ref: './spec/paths/recipes.yaml#/root' /recipes/{recipeId}: $ref: './spec/paths/recipes.yaml#/byId' /dishes/{dishName}/recipes: $ref: './spec/paths/recipes.yaml#/byDishName' /cookbook: $ref: './spec/paths/cookbook.yaml#/root' /cookbook/cooked: $ref: './spec/paths/cookbook.yaml#/cooked' /cookbook/bookmarks: $ref: './spec/paths/cookbook.yaml#/bookmarks' /cookbook/bookmarks/{recipeId}: $ref: './spec/paths/cookbook.yaml#/bookmarksById' /cookbook/{recipeId}: $ref: './spec/paths/cookbook.yaml#/cookbookById' /kitchen/meal-plans: $ref: './spec/paths/meal-plans.yaml#/mealPlans' /kitchen/meal-plans/{mealPlanId}: $ref: './spec/paths/meal-plans.yaml#/mealPlanById' /kitchen/meal-plans/{mealPlanId}/items/{recipeId}: $ref: './spec/paths/meal-plans.yaml#/mealPlanItemById' /kitchen/shopping-lists: $ref: './spec/paths/shopping-lists.yaml#/shoppingLists' /kitchen/shopping-lists/{listId}: $ref: './spec/paths/shopping-lists.yaml#/shoppingListById' /kitchen/pantry: $ref: './spec/paths/pantry.yaml#/pantry' /kitchen/pantry/{pantryItemId}: $ref: './spec/paths/pantry.yaml#/pantryById' /me/achievements: $ref: './spec/paths/me.yaml#/achievements' /cooking-logs: $ref: './spec/paths/cooking-logs.yaml#/root' /cooking-logs/{logId}: $ref: './spec/paths/cooking-logs.yaml#/byId' /ai/recipe/generate: $ref: './spec/paths/ai.yaml#/generateRecipe' /ai/recipe/description/generate: $ref: './spec/paths/ai.yaml#/generateRecipeDescription' /ai/recipe/ingredients/generate: $ref: './spec/paths/ai.yaml#/generateRecipeIngredients' /ai/recipe/steps/generate: $ref: './spec/paths/ai.yaml#/generateRecipeSteps' /ai/recipe/adjust: $ref: './spec/paths/ai.yaml#/adjustRecipe' /resources/upload: $ref: './spec/paths/resources.yaml#/uploadResource' components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT responses: BadRequest: $ref: './spec/components/responses/BadRequestError.yaml' Unauthorized: $ref: './spec/components/responses/UnauthorizedError.yaml' Forbidden: $ref: './spec/components/responses/ForbiddenError.yaml' NotFound: $ref: './spec/components/responses/NotFoundError.yaml'