暫無描述

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

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

文件連結