Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_freeworld
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_freeworld
Commits
e4f090c2
Commit
e4f090c2
authored
Jul 17, 2021
by
张释方
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
提交代码
parent
be03d715
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
8 deletions
+14
-8
MainApi.kt
app/src/main/java/com/mints/street/api/MainApi.kt
+1
-1
BaseResponse.java
app/src/main/java/com/mints/street/bean/BaseResponse.java
+7
-1
LoginViewModel.kt
app/src/main/java/com/mints/street/login/LoginViewModel.kt
+4
-4
ApiModel.kt
app/src/main/java/com/mints/street/model/ApiModel.kt
+1
-1
ResponseThrowable.java
...main/java/me/goldze/mvvmhabit/http/ResponseThrowable.java
+1
-1
No files found.
app/src/main/java/com/mints/street/api/MainApi.kt
View file @
e4f090c2
...
@@ -23,7 +23,7 @@ interface MainApi {
...
@@ -23,7 +23,7 @@ interface MainApi {
* @return
* @return
*/
*/
@POST
(
"api/sendMobileCode"
)
@POST
(
"api/sendMobileCode"
)
fun
sendMobileCode
(
@Body
vo
:
@JvmSuppressWildcards
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
fun
sendMobileCode
(
@Body
vo
:
Map
<
String
,
String
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
/**
/**
* 登录
* 登录
...
...
app/src/main/java/com/mints/street/bean/BaseResponse.java
View file @
e4f090c2
...
@@ -12,7 +12,8 @@ import java.io.Serializable;
...
@@ -12,7 +12,8 @@ import java.io.Serializable;
*/
*/
public
class
BaseResponse
<
T
>
implements
Serializable
{
public
class
BaseResponse
<
T
>
implements
Serializable
{
private
int
status
;
private
int
status
;
private
String
message
;
private
String
message
=
""
;
// @JsonAdapter(value = JsonAdapterGsonDeserializer.class)
// @JsonAdapter(value = JsonAdapterGsonDeserializer.class)
@SerializedName
(
"data"
)
@SerializedName
(
"data"
)
...
@@ -27,6 +28,11 @@ public class BaseResponse<T> implements Serializable {
...
@@ -27,6 +28,11 @@ public class BaseResponse<T> implements Serializable {
this
.
result
=
result
;
this
.
result
=
result
;
}
}
public
BaseResponse
(
int
status
)
{
this
.
status
=
status
;
}
public
int
getstatus
()
{
public
int
getstatus
()
{
return
status
;
return
status
;
}
}
...
...
app/src/main/java/com/mints/street/login/LoginViewModel.kt
View file @
e4f090c2
...
@@ -32,15 +32,15 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
...
@@ -32,15 +32,15 @@ class LoginViewModel(application: Application) : BaseViewModel(application) {
* @param mobile
* @param mobile
*/
*/
fun
sendMobileCode
(
mobile
:
String
)
{
fun
sendMobileCode
(
mobile
:
String
)
{
val
vo
=
HashMap
<
String
,
Any
>()
val
vo
=
HashMap
<
String
,
String
>()
vo
[
"mobile"
]
=
mobile
vo
[
"mobile"
]
=
mobile
vo
[
"type"
]
=
1
//
vo["type"] = 1
ApiModel
.
sendMobileCode
(
lifecycleProvider
,
vo
).
s
afeS
ubscribe
(
ApiModel
.
sendMobileCode
(
lifecycleProvider
,
vo
).
subscribe
(
object
:
HttpSubscribeImpl
<
BaseResponse
<
Any
>>(
object
:
HttpSubscribeImpl
<
BaseResponse
<
Any
>>(
this
@LoginViewModel
,
true
)
{
this
@LoginViewModel
,
true
)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
Any
>)
{
override
fun
onBusinessSuccess
(
response
:
BaseResponse
<
Any
>)
{
KLog
.
e
(
"sendMobileCode"
,
response
.
result
.
toString
())
//
KLog.e("sendMobileCode", response.result.toString())
}
}
override
fun
onError
(
e
:
Throwable
)
{
override
fun
onError
(
e
:
Throwable
)
{
data
.
value
=
"失败"
data
.
value
=
"失败"
...
...
app/src/main/java/com/mints/street/model/ApiModel.kt
View file @
e4f090c2
...
@@ -16,7 +16,7 @@ object ApiModel {
...
@@ -16,7 +16,7 @@ object ApiModel {
/**
/**
* 发送验证码
* 发送验证码
*/
*/
fun
sendMobileCode
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
Any
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
fun
sendMobileCode
(
lifecycleProvider
:
LifecycleProvider
<
Any
>?,
map
:
Map
<
String
,
String
>):
Observable
<
Response
<
BaseResponse
<
Any
>>>
{
return
HttpManager
.
getInstance
()
return
HttpManager
.
getInstance
()
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
sendMobileCode
(
map
))
.
execute
(
lifecycleProvider
,
MainApi
.
newInstance
().
sendMobileCode
(
map
))
}
}
...
...
mvvmhabit/src/main/java/me/goldze/mvvmhabit/http/ResponseThrowable.java
View file @
e4f090c2
...
@@ -6,7 +6,7 @@ package me.goldze.mvvmhabit.http;
...
@@ -6,7 +6,7 @@ package me.goldze.mvvmhabit.http;
public
class
ResponseThrowable
extends
Exception
{
public
class
ResponseThrowable
extends
Exception
{
public
int
code
;
public
int
code
;
public
String
message
;
public
String
message
=
""
;
public
ResponseThrowable
(
Throwable
throwable
,
int
code
)
{
public
ResponseThrowable
(
Throwable
throwable
,
int
code
)
{
super
(
throwable
);
super
(
throwable
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment