File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed
pluto-kotlin-client-sdk/src/main/java/com/mushare/plutosdk Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,17 @@ fun Pluto.register(
41
41
}
42
42
43
43
fun Pluto.resendValidationEmail (
44
- address : String ,
44
+ account : String ,
45
45
success : () -> Unit ,
46
46
error : ((PlutoError ) -> Unit )? = null,
47
47
handler : Pluto .PlutoRequestHandler ? = null
48
48
) {
49
- plutoService.resendValidationEmail(EmailPostData (address, appId), getLanguage()).apply {
49
+ val postData =
50
+ if (account.contains(" @" ))
51
+ ResendValidationEmailPostData (null , account, appId)
52
+ else
53
+ ResendValidationEmailPostData (account, null , appId)
54
+ plutoService.resendValidationEmail(postData, getLanguage()).apply {
50
55
enqueue(object : Callback <PlutoResponse > {
51
56
override fun onFailure (call : Call <PlutoResponse >, t : Throwable ) {
52
57
t.printStackTrace()
@@ -107,8 +112,8 @@ fun Pluto.loginWithAccount(
107
112
}
108
113
})
109
114
}.also {
110
- handler?.setCall(it)
111
- }
115
+ handler?.setCall(it)
116
+ }
112
117
}
113
118
114
119
fun Pluto.loginWithGoogle (
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ interface PlutoService {
18
18
19
19
@POST(" v1/user/register/verify/mail" )
20
20
fun resendValidationEmail (
21
- @Body body : EmailPostData ,
21
+ @Body body : ResendValidationEmailPostData ,
22
22
@Header(" Accept-Language" ) language : String
23
23
): Call <PlutoResponse >
24
24
@@ -63,6 +63,12 @@ class RegisterPostData(
63
63
@field:SerializedName("app_id") var appId : String
64
64
)
65
65
66
+ class ResendValidationEmailPostData (
67
+ @field:SerializedName("user_id") var userId : String? ,
68
+ @field:SerializedName("mail") var mail : String? ,
69
+ @field:SerializedName("app_id") var appId : String
70
+ )
71
+
66
72
class EmailPostData (
67
73
@field:SerializedName("mail") var mail : String ,
68
74
@field:SerializedName("app_id") var appId : String
You can’t perform that action at this time.
0 commit comments