Žiadny popis

Wayne cfe3893472 Merge branch 'subscription' 6 rokov pred
build ab2256d019 Remove some files that don't need to track from stage 6 rokov pred
src cfe3893472 Merge branch 'subscription' 6 rokov pred
.gitignore 442bbc31a2 New: add some files to gitgnore 6 rokov pred
bomocloud.iml 8a8d801644 New: update cloud module 6 rokov pred
build.gradle 2a8e0386ff New: aws s3 service to upload avator image api 6 rokov pred
proguard-rules.pro 8a8d801644 New: update cloud module 6 rokov pred
readme.md d015b9dd31 Fix: upload avator api parameter to request body 6 rokov pred

readme.md

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 文件

文件連結