This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Service | |
@Profile("scanner") | |
open class EncryptedRestService | |
@Autowired constructor(val cryptoService: CryptoService) { | |
fun <T, R : Any> post(url: String, params: T): Request<T, R> { | |
return Request(url, HttpMethod.POST, params) | |
} | |
inner class Request<T, R : Any>(val url: String, val method: HttpMethod, val params: T? = null) { | |
fun withCredentials(username: String, password: String): EncryptedRequest<T, R> { | |
val headers = HttpHeaders() | |
val key = byteArrayOf() | |
return EncryptedRequest(this, headers, key) | |
} | |
} | |
inner class EncryptedRequest<T, R : Any>(req: Request<T, R>, | |
val headers: HttpHeaders, | |
val key: ByteArray) { | |
fun expect(clazz: KClass<R>): R? { | |
return null | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment