Files

26 lines
639 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Task Template: 新增 API + Mock轻量版
task:
id: add-api-and-mock
intent: "新增一个 API 调用函数,并同步补一个 Mock 路由(用于开发联调)"
inputs:
required:
- domain
- function_name
- method # get/post/...
- path # 例如 /router/getList
outputs:
files_to_change:
- "src/api/<domain>.ts"
- "mock/controller/<domain>.js"
rules:
- "API path 与 Mock path 必须一致"
- "Mock 路由对象必须包含 url/type/response"
acceptance:
- "开发环境请求能命中 mock"
- "API 函数能被页面调用且类型不报错(若涉及类型需补 types/"