Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vediosocial
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_vediosocial
Commits
331223d6
Commit
331223d6
authored
Jan 15, 2025
by
jyx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
9c1ee8d2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
82 additions
and
36 deletions
+82
-36
UserProfilePresenter.kt
.../duben/roseplaylet/mvp/presenters/UserProfilePresenter.kt
+82
-11
UserInfoView.kt
...main/java/com/duben/roseplaylet/mvp/views/UserInfoView.kt
+0
-15
shape_bg_reco1.xml
video/app/src/main/res/drawable/shape_bg_reco1.xml
+0
-10
No files found.
video/app/src/main/java/com/duben/roseplaylet/mvp/presenters/User
Info
Presenter.kt
→
video/app/src/main/java/com/duben/roseplaylet/mvp/presenters/User
Profile
Presenter.kt
View file @
331223d6
...
...
@@ -3,25 +3,24 @@ package com.duben.roseplaylet.mvp.presenters
import
com.duben.library.net.neterror.BaseSubscriber
import
com.duben.library.net.neterror.Throwable
import
com.duben.roseplaylet.manager.AppHttpManager
import
com.duben.roseplaylet.mvp.model.BaseResponse
import
com.duben.roseplaylet.mvp.model.NineListBean
import
com.duben.roseplaylet.mvp.model.UserProfileDataBean
import
com.duben.roseplaylet.mvp.views.UserInfoView
import
com.duben.roseplaylet.mvp.model.*
import
com.duben.roseplaylet.mvp.views.UserProfileView
import
com.google.gson.JsonObject
class
User
InfoPresenter
:
BasePresenter
<
UserInfo
View
>()
{
class
User
ProfilePresenter
:
BasePresenter
<
UserProfile
View
>()
{
fun
getMorePage
(
toUid
:
String
)
{
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"toUid"
]
=
toUid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getMorePage
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
UserProfileData
Bean
>>()
{
object
:
BaseSubscriber
<
BaseResponse
<
UserProfileData
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
UserProfileData
Bean
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
UserProfileData
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
...
...
@@ -50,14 +49,14 @@ class UserInfoPresenter : BasePresenter<UserInfoView>() {
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"toUid"
]
=
toUid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
getMorePage
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
NineListBean
>>()
{
.
call
(
loanService
.
seeWechat
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
SeeWechat
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
NineListBean
>)
{
override
fun
onNext
(
baseResponse
:
BaseResponse
<
SeeWechat
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
...
...
@@ -65,7 +64,7 @@ class UserInfoPresenter : BasePresenter<UserInfoView>() {
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
view
.
seeWechatSuc
()
200
->
view
.
seeWechatSuc
(
baseResponse
.
data
)
else
->
{
view
.
showToast
(
message
)
view
.
getMorePageFail
()
...
...
@@ -119,4 +118,76 @@ class UserInfoPresenter : BasePresenter<UserInfoView>() {
})
}
fun
toBlack
(
toUid
:
String
)
{
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"toUid"
]
=
toUid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
setBlack
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
{
view
.
toBlackSuc
()
}
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
fun
toWhite
(
toUid
:
String
)
{
val
vo
=
hashMapOf
<
String
,
Any
>()
vo
[
"toUid"
]
=
toUid
AppHttpManager
.
getInstance
(
loanApplication
)
.
call
(
loanService
.
setWhite
(
vo
),
object
:
BaseSubscriber
<
BaseResponse
<
JsonObject
>>()
{
override
fun
onCompleted
()
{
if
(
isLinkView
)
return
view
.
hideLoading
()
}
override
fun
onNext
(
baseResponse
:
BaseResponse
<
JsonObject
>)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
val
code
=
baseResponse
.
status
val
message
=
baseResponse
.
message
when
(
code
)
{
200
->
{
view
.
toWhiteSuc
()
}
else
->
{
view
.
showToast
(
message
)
}
}
}
override
fun
onError
(
e
:
Throwable
?)
{
if
(
isLinkView
)
return
view
.
hideLoading
()
view
.
showToast
(
e
?.
message
)
}
})
}
}
\ No newline at end of file
video/app/src/main/java/com/duben/roseplaylet/mvp/views/UserInfoView.kt
deleted
100644 → 0
View file @
9c1ee8d2
package
com.duben.roseplaylet.mvp.views
import
com.duben.roseplaylet.mvp.model.UserProfileDataBean
interface
UserInfoView
:
BaseView
{
fun
getMorePageSuc
(
data
:
UserProfileDataBean
)
fun
getMorePageFail
()
fun
seeWechatSuc
()
fun
seeWechatFail
()
fun
unlockWechatSuc
()
fun
unlockWechatFail
()
}
video/app/src/main/res/drawable/shape_bg_reco1.xml
deleted
100644 → 0
View file @
9c1ee8d2
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<!-- 填充的颜色 -->
<solid
android:color=
"#4bbdd5"
/>
<!-- 设置按钮的四个角为弧形 -->
<!-- android:radius 弧形的半径 -->
<corners
android:radius=
"5dip"
/>
</shape>
\ No newline at end of file
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