Skip to content

Commit

Permalink
Changed getFunctionsPath to static
Browse files Browse the repository at this point in the history
  • Loading branch information
Phara0h committed Nov 7, 2019
1 parent 566731b commit ffe1ade
Show file tree
Hide file tree
Showing 2 changed files with 3,043 additions and 5 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,17 +326,17 @@ var genClass = function (name, item, js, classObj, parent)
` `) : ''}
*/
class ${setClassName(name, parent)} {
constructor() {
`
var getPathObject = 'this._postgenClassUrls = {';
constructor() {}`
var getPathObject = `static get _postgenClassUrls() {
return {`;

var classFunctions = '';
for (var i = item.length - 1; i >= 0; i--)
{

if (!item[i].item)
{
getPathObject += `${setMethodName(item[i].name.toLowerCase())}:'${item[i].request.url.path.join('/')}',`
getPathObject += `${setMethodName(item[i].name).toLowerCase()}:'${item[i].request.url.path.join('/')}',`
//console.log(item[i])
classFunctions += `
${getDocs(item[i].name,item[i].request.description ? item[i].request.description.content : '', item[i].request.url, item[i].request.body, item[i].request.header || [])}
Expand All @@ -363,7 +363,7 @@ class ${setClassName(name, parent)} {
}
js += getPathObject + `};
}
getFunctionsPath(name) {
static getFunctionsPath(name) {
return this._postgenClassUrls[name.toLowerCase()];
}
Expand Down
Loading

0 comments on commit ffe1ade

Please sign in to comment.