Merge remote-tracking branch 'origin/master' into 7.0.x

This commit is contained in:
William Cheng
2022-07-19 11:54:20 +08:00
2800 changed files with 126318 additions and 33030 deletions

View File

@@ -42,7 +42,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue
class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath) {
class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
@@ -182,7 +182,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A
return RequestConfig(
method = RequestMethod.DELETE,
path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
path = "/pet/{petId}".replace("{"+"petId"+"}", petId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -405,7 +405,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A
return RequestConfig(
method = RequestMethod.GET,
path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
path = "/pet/{petId}".replace("{"+"petId"+"}", petId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -548,7 +548,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A
return RequestConfig(
method = RequestMethod.POST,
path = "/pet/{petId}".replace("{"+"petId"+"}", "$petId"),
path = "/pet/{petId}".replace("{"+"petId"+"}", petId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -626,7 +626,7 @@ class PetApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = A
return RequestConfig(
method = RequestMethod.POST,
path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", "$petId"),
path = "/pet/{petId}/uploadImage".replace("{"+"petId"+"}", petId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody

View File

@@ -41,7 +41,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue
class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath) {
class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
@@ -109,7 +109,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient =
return RequestConfig(
method = RequestMethod.DELETE,
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"),
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", orderId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -246,7 +246,7 @@ class StoreApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient =
return RequestConfig(
method = RequestMethod.GET,
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", "$orderId"),
path = "/store/order/{orderId}".replace("{"+"orderId"+"}", orderId.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody

View File

@@ -41,7 +41,7 @@ import org.openapitools.client.infrastructure.ResponseType
import org.openapitools.client.infrastructure.Success
import org.openapitools.client.infrastructure.toMultiValue
class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath) {
class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient = ApiClient.defaultClient) : ApiClient(basePath, client) {
companion object {
@JvmStatic
val defaultBasePath: String by lazy {
@@ -310,7 +310,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient =
return RequestConfig(
method = RequestMethod.DELETE,
path = "/user/{username}".replace("{"+"username"+"}", "$username"),
path = "/user/{username}".replace("{"+"username"+"}", username.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -380,7 +380,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient =
return RequestConfig(
method = RequestMethod.GET,
path = "/user/{username}".replace("{"+"username"+"}", "$username"),
path = "/user/{username}".replace("{"+"username"+"}", username.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody
@@ -591,7 +591,7 @@ class UserApi(basePath: kotlin.String = defaultBasePath, client: OkHttpClient =
return RequestConfig(
method = RequestMethod.PUT,
path = "/user/{username}".replace("{"+"username"+"}", "$username"),
path = "/user/{username}".replace("{"+"username"+"}", username.toString()),
query = localVariableQuery,
headers = localVariableHeaders,
body = localVariableBody

View File

@@ -119,16 +119,20 @@ open class ApiClient(val baseUrl: String, val client: OkHttpClient = defaultClie
return null
}
if (T::class.java == File::class.java) {
// return tempfile
val f = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// return tempFile
val tempFile = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
java.nio.file.Files.createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null).toFile()
} else {
@Suppress("DEPRECATION")
createTempFile("tmp.net.medicineone.teleconsultationandroid.openapi.openapicommon", null)
}
f.deleteOnExit()
body.byteStream().use { java.nio.file.Files.copy(it, f.toPath(), java.nio.file.StandardCopyOption.REPLACE_EXISTING) }
return f as T
tempFile.deleteOnExit()
body.byteStream().use { inputStream ->
tempFile.outputStream().use { tempFileOutputStream ->
inputStream.copyTo(tempFileOutputStream)
}
}
return tempFile as T
}
val bodyContent = body.string()
if (bodyContent.isEmpty()) {