generatecode-for-api README
Features
0.0.2(2025-02-17)
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形式输出"
}
]
}
| |