[Kotlin SpringBoot Server] alternative: fix optional parameter not correctly declared in service (#2539)

* fix kotlin optional parameters

* ensure kotlin samples up to date
This commit is contained in:
Esteban Marin
2019-03-28 15:30:58 +01:00
committed by William Cheng
parent 3a0d520c38
commit 88cdbbc41f
8 changed files with 23 additions and 22 deletions

View File

@@ -7,7 +7,7 @@ interface PetApiService {
fun addPet(body: Pet): Unit
fun deletePet(petId: Long,apiKey: String): Unit
fun deletePet(petId: Long, apiKey: String?): Unit
fun findPetsByStatus(status: List<String>): List<Pet>
@@ -17,7 +17,7 @@ interface PetApiService {
fun updatePet(body: Pet): Unit
fun updatePetWithForm(petId: Long,name: String,status: String): Unit
fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit
fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.core.io.Resource): ModelApiResponse
fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse
}

View File

@@ -10,7 +10,7 @@ class PetApiServiceImpl : PetApiService {
TODO("Implement me")
}
override fun deletePet(petId: Long,apiKey: String): Unit {
override fun deletePet(petId: Long, apiKey: String?): Unit {
TODO("Implement me")
}
@@ -30,11 +30,11 @@ class PetApiServiceImpl : PetApiService {
TODO("Implement me")
}
override fun updatePetWithForm(petId: Long,name: String,status: String): Unit {
override fun updatePetWithForm(petId: Long, name: String?, status: String?): Unit {
TODO("Implement me")
}
override fun uploadFile(petId: Long,additionalMetadata: String,file: org.springframework.core.io.Resource): ModelApiResponse {
override fun uploadFile(petId: Long, additionalMetadata: String?, file: org.springframework.core.io.Resource?): ModelApiResponse {
TODO("Implement me")
}
}

View File

@@ -14,9 +14,9 @@ interface UserApiService {
fun getUserByName(username: String): User
fun loginUser(username: String,password: String): String
fun loginUser(username: String, password: String): String
fun logoutUser(): Unit
fun updateUser(username: String,body: User): Unit
fun updateUser(username: String, body: User): Unit
}

View File

@@ -25,7 +25,7 @@ class UserApiServiceImpl : UserApiService {
TODO("Implement me")
}
override fun loginUser(username: String,password: String): String {
override fun loginUser(username: String, password: String): String {
TODO("Implement me")
}
@@ -33,7 +33,7 @@ class UserApiServiceImpl : UserApiService {
TODO("Implement me")
}
override fun updateUser(username: String,body: User): Unit {
override fun updateUser(username: String, body: User): Unit {
TODO("Implement me")
}
}