Skip to content

Commit

Permalink
pref: 生成的ts文件名和api函数改为驼峰命名 (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
rookie-luochao committed Nov 15, 2023
1 parent 78eefa8 commit a853798
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/serviceGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {
SchemaObject,
} from 'openapi3-ts';
import { join } from 'path';
import { camelCase } from 'lodash';
import ReservedDict from 'reserved-words';
import rimraf from 'rimraf';
import pinyin from 'tiny-pinyin';
Expand Down Expand Up @@ -318,7 +319,7 @@ class ServiceGenerator {
}

tags.forEach((tagString) => {
const tag = resolveTypeName(tagString);
const tag = camelCase(resolveTypeName(tagString));

if (!this.apiData[tag]) {
this.apiData[tag] = [];
Expand Down Expand Up @@ -530,7 +531,7 @@ class ServiceGenerator {

return {
...newApi,
functionName,
functionName: camelCase(functionName),
typeName: this.getTypeName(newApi),
path: getPrefixPath(),
pathInComment: formattedPath.replace(/\*/g, '*'),
Expand Down

0 comments on commit a853798

Please sign in to comment.