Skip to content

Commit

Permalink
fixed url
Browse files Browse the repository at this point in the history
  • Loading branch information
kaisawind committed Sep 8, 2019
1 parent b0bff66 commit 94ebd1a
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 84 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</p>

<p align="center">
<a href="#getting-started">Getting started</a>
<a href="#contributors">Contributors</a>
<a href="#getting-started">Getting started</a>
<a href="#contributors">Contributors</a>
<a href="#license">License</a>
</p>

Expand Down
100 changes: 60 additions & 40 deletions example/dist/json_apis.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,11 @@ export const AddPet = (parameters = {}) => {
*/
export const AddPetURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -107,10 +108,11 @@ export const UpdatePet = (parameters = {}) => {
*/
export const UpdatePetURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -144,10 +146,11 @@ export const FindPetsByStatus = (parameters = {}) => {
*/
export const FindPetsByStatusURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/findByStatus'
querys['status'] = parameters['status']
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -183,10 +186,11 @@ export const FindPetsByTags = (parameters = {}) => {
*/
export const FindPetsByTagsURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/findByTags'
querys['tags'] = parameters['tags']
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -220,10 +224,11 @@ export const GetPetById = (parameters = {}) => {
*/
export const GetPetByIdURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/{petId}'
url = url.replace('{petId}', parameters['petId'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -265,12 +270,13 @@ export const UpdatePetWithForm = (parameters = {}) => {
*/
export const UpdatePetWithFormURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/{petId}'
url = url.replace('{petId}', parameters['petId'])
// formData name
// formData status
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -308,11 +314,12 @@ export const DeletePet = (parameters = {}) => {
*/
export const DeletePetURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/{petId}'
// header api_key
url = url.replace('{petId}', parameters['petId'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -354,12 +361,13 @@ export const UploadFile = (parameters = {}) => {
*/
export const UploadFileURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/pet/{petId}/uploadImage'
url = url.replace('{petId}', parameters['petId'])
// formData additionalMetadata
// formData file
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand All @@ -386,9 +394,10 @@ export const GetInventory = (parameters = {}) => {
*/
export const GetInventoryURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/store/inventory'
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -422,10 +431,11 @@ export const PlaceOrder = (parameters = {}) => {
*/
export const PlaceOrderURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/store/order'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -459,10 +469,11 @@ export const GetOrderById = (parameters = {}) => {
*/
export const GetOrderByIdURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/store/order/{orderId}'
url = url.replace('{orderId}', parameters['orderId'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -496,10 +507,11 @@ export const DeleteOrder = (parameters = {}) => {
*/
export const DeleteOrderURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/store/order/{orderId}'
url = url.replace('{orderId}', parameters['orderId'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -533,10 +545,11 @@ export const CreateUser = (parameters = {}) => {
*/
export const CreateUserURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -570,10 +583,11 @@ export const CreateUsersWithArrayInput = (parameters = {}) => {
*/
export const CreateUsersWithArrayInputURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/createWithArray'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -607,10 +621,11 @@ export const CreateUsersWithListInput = (parameters = {}) => {
*/
export const CreateUsersWithListInputURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/createWithList'
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -651,11 +666,12 @@ export const LoginUser = (parameters = {}) => {
*/
export const LoginUserURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/login'
querys['username'] = parameters['username']
querys['password'] = parameters['password']
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand All @@ -682,9 +698,10 @@ export const LogoutUser = (parameters = {}) => {
*/
export const LogoutUserURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/logout'
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -718,10 +735,11 @@ export const GetUserByName = (parameters = {}) => {
*/
export const GetUserByNameURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/{username}'
url = url.replace('{username}', parameters['username'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -762,11 +780,12 @@ export const UpdateUser = (parameters = {}) => {
*/
export const UpdateUserURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/{username}'
url = url.replace('{username}', parameters['username'])
// body body
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

/**
Expand Down Expand Up @@ -800,9 +819,10 @@ export const DeleteUser = (parameters = {}) => {
*/
export const DeleteUserURL = (parameters = {}) => {
let url = ''
const querys = []
const querys = {}
url = '/user/{username}'
url = url.replace('{username}', parameters['username'])
return domain + url + (querys.length > 0 ? '?' + (querys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
const keys = Object.keys(querys)
return domain + url + (keys.length > 0 ? '?' + (keys.map(key => key + '=' + encodeURIComponent(querys[key])).join('&')) : '')
}

Loading

0 comments on commit 94ebd1a

Please sign in to comment.