Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>generateCode-for-apiNew to Visual Studio Code? Get it now.
generateCode-for-api

generateCode-for-api

tanlh

|
4 installs
| (0) | Free
根据后端接口文档自动生成代码
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

generatecode-for-api README

Features

0.0.2(2025-02-17)

  • 添加API文档链接记录
  • bug fix

0.0.1(2025-02-11)

安装完插件之后,按[视频操作]。

在项目路径下增加配置文件generatecode-for-api.json,文件提供以下字段配置:

  • 支持通过配置输入的apiDocumentUrl来自动生成接口文档json文件和对应语言的API构造对象,支持通过Swagger生成接口文档的链接。

  • 支持通过配置字段codeLaunguage类型,确定生成的语法代码,支持dart、typescript和javascript。

  • fileOutPutPath待生成文件目录路径,可以是当前项目的相对路径。

  • apiHost接口文档发起请求的host地址。

  • aiApiKey调用LLM模型使用到的apiKey,为了安全该配置最好不要上传到远程仓库。

  • LLMModelType调用的LLM模型,支持chatGpt和deepSeek。

  • demoCodePath提供给Prompt的样本示例路径,当前项目的相对路径。

  • prompt支持添加自定义提示词,优化输出。

{
  "apiDocumentUrl": [
    "http://logan-gateway.test.logan.local/admin-boot/doc.html#/default//queryDlrAuthInfoUsingPOST"
  ],
  "fileOutPutPath": "./server/model/",
  "codeLaunguage": "dart",
  "apiHost": "http://logan-gateway.test.logan.local",
  "aiApiKey": "",
  "LLMModelType": "chatGpt",
  "demoCodePath": "./server/model/demo.dart",
  "prompt": [
    {
      "role": "user",
      "content": "将输出的结果以xxx形式输出"
    }
  ]
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft