0.3.10 • Published 5 months ago
gencode4swagger v0.3.10
generateService(schemaPath, config) ⇒ Promise.<void>
Kind: global function
Returns: Promise.<void> -
Param | Type | Description |
---|---|---|
schemaPath | string | schema 的路径。 |
config | ConfigOptions | 配置选项。 |
config.templateDir | string | 模板目录的路径。 |
config.outputPath | string | 输出目录的路径。 |
config.prefix | string | api 的前缀。 |
config.pathReg | string | 对路径进行正则判断,不符合的路径不生成。 |
config.ignore | Array.<string> | 忽略的路径列表。 |
config.dir | string | 生成的 api 文件的目录。 |
config.requestStr | string | 请求方法代码,默认为import request from '@/utils/request'; |
config.mode | 'ts' | 'js' | 生成文件的模式('ts' 或 'js')。 |
Example
// generateService 的使用示例
generateService('schemaPath', {
templateDir: 'path/to/template',
outputPath: 'path/to/output',
prefix: 'api',
ignore: ['ignore1', 'ignore2'],
dir: 'api',
mode: 'ts'
});
0.3.9
6 months ago
0.3.10
5 months ago
0.3.8
9 months ago
0.3.7
10 months ago
0.3.6
10 months ago
0.3.5
10 months ago
0.3.4
10 months ago
0.2.0
10 months ago
0.1.9
10 months ago
0.1.8
10 months ago
0.1.7
11 months ago
0.1.6
11 months ago
0.1.5
11 months ago
0.1.4
11 months ago
0.1.3
11 months ago
0.1.2
11 months ago
0.1.1
11 months ago
0.1.0
11 months ago