Skip to content

Commit

Permalink
方法参数顺序调整
Browse files Browse the repository at this point in the history
  • Loading branch information
liujingxing committed Dec 20, 2020
1 parent 1014c0a commit a486433
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ public RxHttpBodyParam setBody(File file, @Nullable MediaType mediaType) {
return this;
}

public RxHttpBodyParam setBody(Context context, Uri uri) {
param.setBody(context, uri);
public RxHttpBodyParam setBody(Uri uri, Context context) {
param.setBody(uri, context);
return this;
}

public RxHttpBodyParam setBody(Context context, Uri uri, @Nullable MediaType contentType) {
param.setBody(context, uri, contentType);
public RxHttpBodyParam setBody(Uri uri, Context context, @Nullable MediaType contentType) {
param.setBody(uri, context, contentType);
return this;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1113,13 +1113,13 @@ object ClassHelper {
return this;
}
public RxHttpBodyParam setBody(Context context, Uri uri) {
param.setBody(context, uri);
public RxHttpBodyParam setBody(Uri uri, Context context) {
param.setBody(uri, context);
return this;
}
public RxHttpBodyParam setBody(Context context, Uri uri, @Nullable MediaType contentType) {
param.setBody(context, uri, contentType);
public RxHttpBodyParam setBody(Uri uri, Context context, @Nullable MediaType contentType) {
param.setBody(uri, context, contentType);
return this;
}
Expand Down
6 changes: 3 additions & 3 deletions rxhttp/src/main/java/rxhttp/wrapper/param/BodyParam.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import android.net.Uri
import okhttp3.MediaType
import okhttp3.RequestBody
import okio.ByteString
import rxhttp.wrapper.entity.UriRequestBody
import rxhttp.wrapper.utils.BuildUtil
import rxhttp.wrapper.utils.asRequestBody
import java.io.File

/**
Expand Down Expand Up @@ -63,11 +63,11 @@ class BodyParam(

@JvmOverloads
fun setBody(
context: Context,
uri: Uri,
context: Context,
contentType: MediaType? = null,
): BodyParam {
requestBody = UriRequestBody(context, uri, contentType)
requestBody = uri.asRequestBody(context, contentType)
return this
}

Expand Down

0 comments on commit a486433

Please sign in to comment.