@@ -53,10 +53,10 @@ export class Generator extends Emitter<GeneratorEmits> {
5353 this . emit ( 'end' , payload ) ;
5454 }
5555
56- protected async generateOpenAPI ( index : number , count : number , name : string , openAPIOptions : OpenAPIOptions , generatorOptions : StrictGeneratorOptions ) {
56+ protected async generateOpenAPI ( index : number , count : number , module : string , openAPIOptions : OpenAPIOptions , generatorOptions : StrictGeneratorOptions ) {
5757 const { cwd, dest, ...globalPrinter } = generatorOptions ;
5858 const { document, ...scopePrinter } = openAPIOptions ;
59- const fileName = `${ name } .ts` ;
59+ const fileName = `${ module } .ts` ;
6060 const filePath = path . join ( cwd , dest , fileName ) ;
6161
6262 // 1. 参数合并
@@ -70,7 +70,7 @@ export class Generator extends Emitter<GeneratorEmits> {
7070 const makePayload = ( step : GeneratingStage ) : GeneratingPayload => ( {
7171 index,
7272 count,
73- name ,
73+ module ,
7474 stage : step ,
7575 options,
7676 filePath,
@@ -85,7 +85,7 @@ export class Generator extends Emitter<GeneratorEmits> {
8585 // 3. 输出
8686 this . emit ( 'process' , makePayload ( 'printing' ) ) ;
8787 const printer = new Printer ( openAPIV3Document , printerOptions ) ;
88- const code = printer . print ( ) ;
88+ const code = printer . print ( { module } ) ;
8989
9090 // 4. 写入
9191 this . emit ( 'process' , makePayload ( 'writing' ) ) ;
0 commit comments