Cloud Module
Import
dependencies {
implementation project(':bomocloud')
}
Sample - Bomo Cloud
val bomoCloud = BoMoCloud("clientId","clientSecret")
boMoCloud.authService
.signIn("email",
"password")
.subscribeOn(Scedulers.io())
.observeOn(AndroidScedulers.mainThread())
.subscribe({
it.toString()
},{
it.printStackTrace()})
Sample - AwsS3
val awsS3 = AwsS3()
val avatorUri = Uri.parse("avatorUri")
val requestBody = RequestBody.create(MediaType.parse("image/png"), File("filePath"))
awsS3.uploadFileService.uploadAvator(
avatorUri.lastPathSegment,
avatorUri.getQueryParameter(UploadFileService.ALGORITHM),
avatorUri.getQueryParameter(UploadFileService.CREDENTIAL),
avatorUri.getQueryParameter(UploadFileService.DATE),
avatorUri.getQueryParameter(UploadFileService.EXPIRES),
avatorUri.getQueryParameter(UploadFileService.SIGNED_HEADERS),
avatorUri.getQueryParameter(UploadFileService.SIGNATURE),
requestBody)
.enqueue(object : retrofit2.Callback<ResponseBody> {
override fun onFailure(call: Call<ResponseBody>?, t: Throwable?) { t?.printStackTrace()
}
override fun onResponse(call: Call<ResponseBody>?, response: Response<ResponseBody>?) {
response?.code()
}
})
API 文件
文件連結