Commit 2916e276 by konghaorui

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents e9424c46 21de161c
......@@ -186,7 +186,7 @@ dependencies {
implementation project(':m-confide')
implementation project(':m-home')
api project(':m-home')
// api "com.ydl:m-consultant-api:0.0.2"
// api 'com.ydl:m-consultant-module-ydl:0.0.18@aar'
......
......@@ -15,6 +15,7 @@ import com.tbruyelle.rxpermissions2.RxPermissions
import com.umeng.analytics.MobclickAgent
import com.ydl.audioim.YDLavManager
import com.ydl.component.music.FragmentContainerActivity
import com.ydl.component.home.HomeActivity
import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.confide.home.ConfideHomeActivity
......@@ -63,7 +64,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
override fun initDataAndEvent() {
YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
// YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
bindService()
reLoadData()
......@@ -100,10 +101,10 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
bt_to_tests.setOnClickListener {
startActivity(Intent(this, NewTestHomeActivity::class.java))
}
bt_to_confide.setOnClickListener {
YDLavManager.instances.login("1193016")
startActivity(Intent(this, ConfideHomeActivity::class.java))
}
// bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016")
// startActivity(Intent(this, ConfideHomeActivity::class.java))
// }
bt_to_muse.setOnClickListener {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_MUSE,
YDLRouterParams().putExtra(IYDLRouterConstant.MUSIC_URL, "http://video.yidianling.com/2019/05/30/e6d4a71e8c895f2156a2ff37d93ca3a9.mp3")
......@@ -136,7 +137,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.navigation()
}
bt_to_home.setOnClickListener {
startActivity(Intent(this, HomeActivity::class.java))
}
}
......
......@@ -86,9 +86,9 @@ public class DemoAppLifecycles implements IAppLifecycles {
//数据埋点初始化--一定要放在主进程中
YdlBuryPointUtil.init(application);
if (DemoGlobalConfig.appEnv.equals(YDLConstants.ENV_PROD)){
YDLavManager.Companion.getInstances().init(application, "3387e9b251f3491e9221a9877e8f7830");
// YDLavManager.Companion.getInstances().init(application, "3387e9b251f3491e9221a9877e8f7830");
}else {
YDLavManager.Companion.getInstances().init(application, "13b1536698f64905a1e7e5bb978ba821");
// YDLavManager.Companion.getInstances().init(application, "13b1536698f64905a1e7e5bb978ba821");
}
//bugly
......
......@@ -8,6 +8,7 @@
android:id="@+id/home_fragment"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:name="com.yidianling.home.ui.fragment.YdlHomeFragment"
/>
......
......@@ -43,7 +43,7 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.31.10",
"m-confide" : "0.0.40",
"m-consultant" : "0.0.44",
"m-fm" : "0.0.21",
"m-user" : "0.0.37",
......@@ -86,7 +86,7 @@ ext {
ydlCompileVersion = [
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.27.1",
"m-confide" : "0.0.40",
"m-consultant" : "0.0.26",
"m-course" : "0.0.22",
"m-fm" : "0.0.15",
......
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-consultant-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
//version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
......@@ -70,15 +70,16 @@ dependencies {
//开发时使用
implementation modularPublication('com.ydl:m-consultant-api')
implementation modularPublication('com.ydl:m-user-api')
implementation modularPublication('com.ydl:m-tests-api')
implementation project(':ydl-webview')
implementation project(':ydl-media')
implementation project(":ydl-platform")
} else {
//发布时使用
implementation "com.ydl:m-consultant-api:0.0.3"
implementation "com.ydl:m-user-api:0.0.7"
implementation "com.ydl:m-home-api:0.0.2"
compileOnly rootProject.ext.dependencies["ydl-m-consultant-api"]
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-home-api"]
api (rootProject.ext.dependencies["ydl-platform"]) {
transitive = true
}
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,6 +34,7 @@ import com.yidianling.home.constract.IHomeContract
import com.yidianling.home.model.bean.*
import com.yidianling.router.RouterManager
import com.yidianling.router.im.IMRequestCallback
import com.yidianling.tests.api.service.ITestsApiService
import com.yidianling.user.api.service.IUserService
import de.greenrobot.event.EventBus
import org.json.JSONObject
......@@ -339,6 +340,7 @@ class HomeImpl : IHomeEvent {
.putExtra(IYDLRouterConstant.EXTRA_TOUID, doctorId!!)
.putExtra(IYDLRouterConstant.EXTRA_USERTYPE, "1"))
}
//todo xj
RouterManager.getImRouter().createTextMessage(doctorId, "你好,我想找你倾诉,请尽快上线私聊我,我在等你。", object : IMRequestCallback<Void> {
override fun onSuccess(aVoid: Void?) {
(mContext as BaseActivity).dismissProgressDialog()
......@@ -572,7 +574,7 @@ class HomeImpl : IHomeEvent {
val uri = Uri.parse(linkUrl)
if ("ceshi" == uri.host) {
val id = uri.getQueryParameter("id")
RouterManager.getTestsRouter()?.testDetailH5(id)
ModularServiceManager.provide(ITestsApiService::class.java).testDetailH5(id)
}
} else if (linkUrl.startsWith("http")) {
YDLRouterManager.router(IYDLRouterConstant.ROUTER_H5_H5,
......@@ -580,7 +582,7 @@ class HomeImpl : IHomeEvent {
} else if (linkUrl.contains("ceshi/detail?")) {
val routerParamsUrls = YDLRouterParamsUrls(linkUrl)
val jsonObject = JSONObject(routerParamsUrls.getParams())
RouterManager.getTestsRouter()?.testDetailH5(jsonObject.getString("id").toString());
ModularServiceManager.provide(ITestsApiService::class.java).testDetailH5(jsonObject.getString("id").toString())
} else {
YDLRouterManager.router(linkUrl)
}
......
package com.yidianling.home.http
import com.ydl.ydlcommon.base.config.HttpConfig
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseResponse
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.home.model.bean.*
import com.yidianling.user.api.service.IUserService
import io.reactivex.Observable
/**
......@@ -59,30 +59,30 @@ class HomeHttp private constructor() {
//首页倾述请求
fun getConfideData(goodType: String): Observable<BaseAPIResponse<HomeConfideBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
val loginBean = ModularServiceManager.provide(IUserService::class.java).getUserInfo()
var userId = loginBean?.uid ?: "";
return getHomPagerApi().getConfideData(goodType, uid = userId);
}
//首页课程请求
fun getCourseData(listType: String = "10"): Observable<BaseAPIResponse<HomeCourseBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
val loginBean = ModularServiceManager.provide(IUserService::class.java).getUserInfo()
var userId = loginBean?.uid ?: "";
return getHomPagerApi().getCourseData(listType, uid = userId);
}
//首页测试请求
fun getTestData(): Observable<BaseAPIResponse<MutableList<HomeTestItemBean>>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
val loginBean = ModularServiceManager.provide(IUserService::class.java).getUserInfo()
var userId = loginBean?.uid ?: "";
return getHomPagerApi().getTestData(uid = userId)
}
//首页问答请求
fun getAskData(): Observable<BaseAPIResponse<HomeAskBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: "";
var token = loginBean?.token ?: "";
val loginBean = ModularServiceManager.provide(IUserService::class.java).getUserInfo()
var userId = loginBean?.uid ?: "";
var token = loginBean?.accessToken ?: "";
return getHomPagerApi().getAskData(accessToken = token, uid = userId);
}
......@@ -98,8 +98,8 @@ class HomeHttp private constructor() {
//首页咨询请求
fun getConsultData(goodType: String): Observable<BaseAPIResponse<HomeConsultBean>> {
val loginBean = YdlCommonRouterManager.getYdlCommonRoute().getUserInfo()
var userId = loginBean?.userId ?: ""
val loginBean = ModularServiceManager.provide(IUserService::class.java).getUserInfo()
var userId = loginBean?.uid ?: ""
return getHomPagerApi().getConsultData(category = goodType, uid = userId)
}
......@@ -120,4 +120,6 @@ class HomeHttp private constructor() {
fun newMuseRequest(): Observable<BaseAPIResponse<MuseModuleBean>> {
return getHomPagerApi().getMuseData()
}
}
\ No newline at end of file
package com.yidianling.home.model.bean
import com.yidianling.router.consultant.Keyworks
import com.yidianling.consultant.bean.Keyworks
/**
* Created by haorui on 2019/2/14.
......
......@@ -8,6 +8,7 @@ import com.google.gson.reflect.TypeToken
import com.ydl.ydlcommon.base.BaseApp
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.SimplePresenter
import com.ydl.ydlcommon.utils.SharedPreferencesEditor
import com.ydl.ydlcommon.utils.YDLAsyncUtils
......@@ -19,7 +20,7 @@ import com.yidianling.home.utils.HomeFileUtils
import com.yidianling.home.utils.HomeLogPrinter
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxAppTool
import com.yidianling.router.RouterManager
import com.yidianling.consultant.api.IConsultantService
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.disposables.Disposable
......@@ -100,7 +101,7 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
}
override fun asyncResult(`object`: Any?) {
//如果没有缓存数据,显示加载框
//如果没 有缓存数据,显示加载框
if (`object` !is String || TextUtils.isEmpty(`object`)) {
mView?.let { it.showRefreshLayout() }
}
......@@ -169,7 +170,7 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
}
homeList.add(HomePagerDataBean(YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW))
//保存热门搜索列表
it.keywordData?.let { RouterManager.getConsultantRouter()?.setHotSearch(it) }
it.keywordData?.let { ModularServiceManager.provide(IConsultantService::class.java).setHotSearch(it) }
},
HomeModelImpl.consultRequest(mConsultType).map {
//首页咨询数据
......@@ -252,7 +253,7 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
YdlHomeViewHolderConstract.PAGER_BANNER_VIEW -> {
homeBean.headerBean = dataBean.headerBean
dataBean.headerBean?.keywordData?.let {
RouterManager.getConsultantRouter()?.setHotSearch(it)
ModularServiceManager.provide(IConsultantService::class.java).setHotSearch(it)
}
}
YdlHomeViewHolderConstract.CONSULT_VIEW -> {
......@@ -370,18 +371,18 @@ class HomePresenterImpl : SimplePresenter<IHomeContract.View>() {
mConsultType = type
mConsultDisposable = HomeModelImpl.consultRequest(type)
.map { it }
.filter { true }
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
mView?.consultDataResponse(it, selectPosition)
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
mView?.homeDataFail(msg)
}
})
// mConsultDisposable = HomeModelImpl.consultRequest(type)
// .map { it }
// .filter { true }
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(Consumer {
// mView?.consultDataResponse(it, selectPosition)
// }, object : ThrowableConsumer() {
// override fun accept(msg: String) {
// mView?.homeDataFail(msg)
// }
// })
}
fun disposeConfide() {
......
......@@ -39,7 +39,7 @@ import com.yidianling.home.presenter.HomePresenterImpl
import com.yidianling.home.ui.view.CouponDialog
import com.yidianling.home.utils.Double11ActivityManagerUtils
import com.yidianling.home.utils.HomeAnimUtils
import com.yidianling.router.RouterManager
import com.yidianling.user.api.service.IUserService
import kotlinx.android.synthetic.ydl.home_module_fragment.*
......@@ -252,7 +252,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
if (RouterManager.getUserRouter()?.isLogin() != true) {
if (!ModularServiceManager.provide(IUserService::class.java).isLogin()) {
//未登录不显示
return
}
......
......@@ -18,7 +18,6 @@ import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_router.manager.YDLRouterManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.utils.MoonUtil
import com.ydl.ydlcommon.utils.Utils
import com.yidianling.common.tools.RxDeviceTool
......
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-tests-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
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