0.3.10 • Published 5 months ago

gencode4swagger v0.3.10

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

generateService(schemaPath, config) ⇒ Promise.<void>

Kind: global function
Returns: Promise.<void> -

ParamTypeDescription
schemaPathstringschema 的路径。
configConfigOptions配置选项。
config.templateDirstring模板目录的路径。
config.outputPathstring输出目录的路径。
config.prefixstringapi 的前缀。
config.pathRegstring对路径进行正则判断,不符合的路径不生成。
config.ignoreArray.<string>忽略的路径列表。
config.dirstring生成的 api 文件的目录。
config.requestStrstring请求方法代码,默认为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