Commit 34c7325f authored by jyx's avatar jyx

代码优化

parent 41edb128
......@@ -11,3 +11,7 @@ app/build
picture_library/build
ucrop/build
videocache/build
wxpay/build
rxpay/build
alipay/build
\ No newline at end of file
package com.duben.dayplaylet.mvp.model
data class MusicBean(
val completeCount: Int, //完成的次数(这里的次数不包括翻倍)
val nextIsAd: Boolean, //接下来是不是要看广告了
val openCash: Boolean, //还能不能提现,不能提现就不展示提现入口了
val turnNeedCount: Int //提现需要的次数
)
\ No newline at end of file
package com.duben.dayplaylet.mvp.presenters
import com.duben.dayplaylet.manager.AppHttpManager
import com.duben.dayplaylet.mvp.model.BaseResponse
import com.duben.dayplaylet.mvp.model.MusicBean
import com.duben.dayplaylet.mvp.views.MusicView
import com.duben.library.net.neterror.BaseSubscriber
import com.duben.library.net.neterror.Throwable
class MusicPresenter : BasePresenter<MusicView>() {
// 猜歌页信息
fun rdSongMsg() {
AppHttpManager.getInstance(loanApplication)
.call(loanService.rdSongMsg(),
object : BaseSubscriber<BaseResponse<MusicBean>>() {
override fun onCompleted() {
if (isLinkView) return
}
override fun onError(e: Throwable) {
if (isLinkView) return
view.showToast(e.message)
}
override fun onNext(baseResponse: BaseResponse<MusicBean>) {
if (isLinkView) return
val code = baseResponse.status
val message = baseResponse.message
when (code) {
200 -> {
view.rdSongMsgSuc(baseResponse.data)
}
else -> {
view.showToast(message)
}
}
}
})
}
}
\ No newline at end of file
package com.duben.dayplaylet.mvp.views
import com.duben.dayplaylet.mvp.model.MusicBean
interface MusicView : BaseView {
fun rdSongMsgSuc(data: MusicBean)
}
\ No newline at end of file
......@@ -3,6 +3,7 @@ package com.duben.dayplaylet.net;
import android.content.Context;
import android.text.TextUtils;
import com.duben.dayplaylet.mvp.model.MusicBean;
import com.google.gson.JsonObject;
import com.duben.dayplaylet.BuildConfig;
import com.duben.dayplaylet.mvp.model.BannerList;
......@@ -225,6 +226,14 @@ public interface LoanService {
@POST("api/reportAddCoinMsg")
Observable<BaseResponse<JsonObject>> reportAddCoinMsg(@Body Map<String, Object> vo);
/**
* 猜歌页信息
*
* @return
*/
@POST("api/reward/rdSongMsg")
Observable<BaseResponse<MusicBean>> rdSongMsg();
/**
* 默认http工厂
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment