Commit 2b2eb4ee by 严久程

课程模块

parent a9a7a92e
......@@ -5,7 +5,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.ydl.ydlcommon.adapter.CommonAdapter;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.bean.Course;
/**
* Created by zqk on 6/22/17.
......
......@@ -17,11 +17,10 @@ import com.ydl.ydlcommon.bean.ShareData;
import com.ydl.ydlcommon.data.http.RxUtils;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.NetworkParamsUtils;
import com.ydl.ydlcommon.utils.UMEventUtils;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.course.courseNew.LoadMoreView;
import com.yidianling.course.coursePlay.common.net.RetrofitUtils;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.net.RetrofitUtils;
import com.yidianling.course.bean.Course;
import com.yidianling.course.router.CourseIn;
import in.srain.cube.views.loadmore.LoadMoreContainer;
import in.srain.cube.views.loadmore.LoadMoreHandler;
......
......@@ -10,7 +10,7 @@ import android.widget.TextView;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.yidianling.course.coursePlay.CourseCommentActivity;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.bean.Course;
import com.yidianling.course.widget.CourseItemNewView;
import butterknife.BindView;
......
......@@ -5,7 +5,7 @@ import android.view.View;
import android.view.ViewGroup;
import com.ydl.ydlcommon.adapter.CommonAdapter;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.bean.Course;
import com.yidianling.course.widget.CourseItemNewView;
public class CourseNewListAdapter extends CommonAdapter<Course> {
......
......@@ -18,7 +18,7 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.view.dialog.YDLShareDialog
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.bean.PostersShareBean
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.RetrofitUtils
import com.yidianling.course.widget.CoursePosterTemplate
import com.yidianling.course.widget.CustomPagerTransformer
import io.reactivex.android.schedulers.AndroidSchedulers
......
......@@ -17,7 +17,7 @@ import com.ydl.ydlcommon.utils.actionutil.BIConstants
import com.ydl.ydlcommon.utils.remind.ToastHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.bean.CourseCouponBean
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.RetrofitUtils
import com.yidianling.course.flutterPlugin.CourseSendPlugin
import com.yidianling.course.widget.CourseCouponDialog
import com.yidianling.router.RouterManager
......
package com.yidianling.course.coursePlay.moudle;
package com.yidianling.course.bean;
import com.ydl.ydlcommon.bean.ShareData;
import com.yidianling.course.bean.CourseHostInfoBean;
......
package com.yidianling.course.coursePlay.moudle
package com.yidianling.course.bean
import com.ydl.ydlcommon.bean.YDLBaseDataBean
......
package com.yidianling.course.coursePlay.moudle
package com.yidianling.course.bean
import com.ydl.ydlcommon.bean.ShareData
import java.util.*
......
......@@ -20,8 +20,8 @@ import com.ydl.ydlcommon.utils.UMEventUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxNetTool
import com.yidianling.course.R
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.net.RetrofitUtils
import com.yidianling.course.bean.Course
import com.yidianling.course.model.TopicCourseBean
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
......
......@@ -7,10 +7,9 @@ import android.view.View
import android.view.ViewGroup
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.view.BaseViewHolder
import com.yidianling.course.CourseConstants
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.bean.Course
import com.yidianling.course.widget.CourseItemNewView
/**
......
......@@ -24,7 +24,6 @@ import com.ydl.ydlcommon.bean.ShareData
import com.ydl.ydlcommon.data.http.RxUtils
import com.ydl.ydlcommon.ui.LogoLoadingView
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlcommon.utils.UMEventUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.ydl.ydlcommon.utils.actionutil.BIConstants
import com.ydl.ydlcommon.utils.remind.ToastHelper
......@@ -37,8 +36,8 @@ import com.yidianling.course.courseNew.LoadMoreView
import com.yidianling.course.courseNew.courseList.widget.CourseFilterPopupWindow
import com.yidianling.course.courseNew.courseList.widget.CourseGoodPopupWindow
import com.yidianling.course.courseNew.courseList.widget.CourseSortPopupWindow
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.net.RetrofitUtils
import com.yidianling.course.bean.Course
import com.yidianling.course.model.CourseCategoryBean
import com.yidianling.course.router.CourseIn
import com.yidianling.course.widget.SearchBarView
......
......@@ -14,8 +14,8 @@ import com.ydl.ydlcommon.utils.log.LogHelper
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.CourseConstants
import com.yidianling.course.R
import com.yidianling.course.coursePlay.common.net.Command
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.Command
import com.yidianling.course.net.RetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
import kotlinx.android.synthetic.main.activity_course_commeny.*
......
......@@ -4,7 +4,7 @@ import android.annotation.SuppressLint
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.bean.CourseMediaDetailBean
import com.yidianling.course.coursePlay.CoursePlayActivity
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.RetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.schedulers.Schedulers
......
......@@ -20,7 +20,7 @@ import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.course.CourseConstants
import com.yidianling.course.R
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.bean.Course
import com.yidianling.course.courseSearch.http.CourseSearchApiUtils
import com.yidianling.course.courseSearch.view.ICourseSearchView
import com.yidianling.course.widget.SearchBarView
......
......@@ -4,7 +4,7 @@ import android.content.Context
import android.support.v7.widget.RecyclerView
import android.view.ViewGroup
import com.yidianling.common.tools.RxImageTool
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.bean.Course
import com.yidianling.course.courseSearch.view.ICourseSearchView
import com.yidianling.course.widget.CourseItemNewView
......
package com.yidianling.course.courseSearch;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.bean.Course;
import java.util.List;
......
......@@ -2,7 +2,6 @@ package com.yidianling.course.courseSearch.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.course.coursePlay.common.net.NetApiStore
import com.yidianling.course.courseSearch.CourseSearchBean
import io.reactivex.Observable
......
package com.yidianling.course.course_special_list.http
package com.yidianling.course.course_special_list.bean
import com.ydl.ydlcommon.data.http.BaseCommand
......
......@@ -6,7 +6,7 @@ import com.ydl.ydlcommon.mvp.base.IPresenter
import com.ydl.ydlcommon.mvp.base.IView
import com.yidianling.course.course_special_list.bean.CourseSpecialItemBean
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import com.yidianling.course.course_special_list.http.CourseSpecialListParam
import com.yidianling.course.course_special_list.bean.CourseSpecialListParam
import io.reactivex.Observable
/**
......
package com.yidianling.course.course_special_list.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import io.reactivex.Observable
import retrofit2.http.GET
import retrofit2.http.HEAD
import retrofit2.http.QueryMap
/**
* @author yuanwai
* @描述:课程专题列表Api
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/18
*/
interface CourseSpecialListApi {
//课程专题列表
//todo
@GET("auth/course/listCoursesBySpecialId")
fun courseSpecialList(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<CourseSpecialListBean>>
}
\ No newline at end of file
package com.yidianling.course.course_special_list.http
/**
* @author yuanwai
* @描述:课程专题列表接口实现模型
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/18
*/
object CourseSpecialListDataManager{
fun getHttp(): ICourseSpecialListHttp = CourseSpecialListHttpImpl.getInstance()
}
\ No newline at end of file
package com.yidianling.course.course_special_list.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.ydl.ydlcommon.data.http.BaseCommand
import com.ydl.ydlcommon.data.http.FormatText
import com.ydl.ydlcommon.utils.NetworkParamsUtils
import com.ydl.ydlnet.YDLHttpUtils
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import io.reactivex.Observable
/**
* @author yuanwai
* @描述:课程专题列表接口实现类
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/18
*/
class CourseSpecialListHttpImpl private constructor() : ICourseSpecialListHttp {
companion object {
fun getInstance(): CourseSpecialListHttpImpl {
return Holder.INSTANCE
}
fun clearCourseSpecialListApi() {
Holder.INSTANCE.courseSpecialListApi = null
}
}
object Holder {
val INSTANCE = CourseSpecialListHttpImpl()
}
fun getPostList(crq: BaseCommand): List<FormatText> {
return NetworkParamsUtils.getPostList(crq)
}
fun getMaps(list: List<FormatText>): Map<String, String> {
return NetworkParamsUtils.getMaps(list)
}
private var courseSpecialListApi: CourseSpecialListApi? = null
override fun courseSpecialList(param: CourseSpecialListParam): Observable<BaseAPIResponse<CourseSpecialListBean>> {
val list = getPostList(param)
return YDLHttpUtils.obtainApi(CourseSpecialListApi::class.java!!).courseSpecialList(getMaps(list))
}
}
\ No newline at end of file
package com.yidianling.course.course_special_list.http
import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import io.reactivex.Observable
/**
* @author yuanwai
* @描述:课程专题列表请求接口
* @Copyright Copyright (c) 2018
* @Company 壹点灵
* @date 2018/9/18
*/
interface ICourseSpecialListHttp {
/**
* 课程专题列表
*
*
*/
fun courseSpecialList(param: CourseSpecialListParam):
Observable<BaseAPIResponse<CourseSpecialListBean>>
}
\ No newline at end of file
package com.yidianling.course.course_special_list.model
import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.course.net.RetrofitUtils
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import com.yidianling.course.course_special_list.contract.ICourseSpecialListContract
import com.yidianling.course.course_special_list.http.CourseSpecialListDataManager
import com.yidianling.course.course_special_list.http.CourseSpecialListParam
import com.yidianling.course.course_special_list.bean.CourseSpecialListParam
import io.reactivex.Observable
/**
......@@ -17,7 +17,7 @@ import io.reactivex.Observable
class CourseSpecialListModelImpl : ICourseSpecialListContract.Model {
override fun specialListRequest(param: CourseSpecialListParam): Observable<CourseSpecialListBean> {
return CourseSpecialListDataManager.getHttp().courseSpecialList(param)
return RetrofitUtils.specialListRequest(param)
.compose(RxUtils.resultJavaData())
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.ydl.ydlcommon.mvp.base.BasePresenter
import com.yidianling.common.tools.RxNetTool
import com.yidianling.course.course_special_list.bean.CourseSpecialItemBean
import com.yidianling.course.course_special_list.contract.ICourseSpecialListContract
import com.yidianling.course.course_special_list.http.CourseSpecialListParam
import com.yidianling.course.course_special_list.bean.CourseSpecialListParam
import com.yidianling.course.course_special_list.model.CourseSpecialListModelImpl
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
......@@ -68,7 +68,12 @@ class CourseSpecialListPresenterImpl (var view: ICourseSpecialListContract.View)
* @param loadMore 是否为上拉加载更多
*/
private fun requestList(page: Int,loadMore : Boolean){
val disposable = mModel.specialListRequest(CourseSpecialListParam(page,0))
val disposable = mModel.specialListRequest(
CourseSpecialListParam(
page,
0
)
)
.subscribeOn(Schedulers.io())
.map { it }
.filter { it != null }
......
package com.yidianling.course.model
import com.ydl.ydlcommon.bean.ShareData
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.bean.Course
/**
* Created by Jim on 2018/7/16 0016.
......
package com.yidianling.course.coursePlay.common.net;
package com.yidianling.course.net;
import com.ydl.ydlcommon.data.http.BaseCommand;
import com.ydl.ydlcommon.router.YdlCommonOut;
......
package com.yidianling.course.coursePlay.common.net;
package com.yidianling.course.net;
import com.ydl.ydlcommon.data.http.BaseAPIResponse;
import com.ydl.ydlcommon.data.http.BaseResponse;
......@@ -6,10 +6,11 @@ import com.yidianling.course.bean.CouponHintResponseBean;
import com.yidianling.course.bean.CourseCouponBean;
import com.yidianling.course.bean.CourseMediaDetailBean;
import com.yidianling.course.bean.PostersShareBean;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.coursePlay.moudle.CourseAddOrderBean;
import com.yidianling.course.coursePlay.moudle.CourseListDataBean;
import com.yidianling.course.coursePlay.moudle.CoursePlayBean;
import com.yidianling.course.bean.Course;
import com.yidianling.course.bean.CourseAddOrderBean;
import com.yidianling.course.bean.CourseListDataBean;
import com.yidianling.course.bean.CoursePlayBean;
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean;
import com.yidianling.course.model.CourseCategoryBean;
import com.yidianling.course.model.TopicCourseBean;
......@@ -18,13 +19,7 @@ import java.util.Map;
import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Url;
import retrofit2.http.*;
/**
* Created by Jim on 2018/2/26 0026.
......@@ -116,4 +111,10 @@ public interface NetApiStore {
//获取课程播放页 java 接口
@GET("auth/course/get/all/audio-video")
Observable<BaseResponse<CourseMediaDetailBean>> getCoursePlayData(@Query("courseId") String courseId);
//课程专题列表
//todo
@GET("auth/course/listCoursesBySpecialId")
Observable<BaseAPIResponse<CourseSpecialListBean>> courseSpecialList(@QueryMap Map<String, String> params);
}
package com.yidianling.course.coursePlay.common.net;
package com.yidianling.course.net;
import android.content.Context;
import com.ydl.ydlcommon.data.http.BaseAPIResponse;
......@@ -8,9 +8,11 @@ import com.ydl.ydlcommon.utils.NetworkParamsUtils;
import com.ydl.ydlcommon.utils.remind.HttpErrorUtils;
import com.ydl.ydlnet.YDLHttpUtils;
import com.yidianling.course.bean.*;
import com.yidianling.course.coursePlay.moudle.Course;
import com.yidianling.course.coursePlay.moudle.CourseListDataBean;
import com.yidianling.course.coursePlay.moudle.CoursePlayBean;
import com.yidianling.course.bean.Course;
import com.yidianling.course.bean.CourseListDataBean;
import com.yidianling.course.bean.CoursePlayBean;
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean;
import com.yidianling.course.course_special_list.bean.CourseSpecialListParam;
import com.yidianling.course.model.CourseCategoryBean;
import com.yidianling.course.model.TopicCourseBean;
import io.reactivex.Observable;
......@@ -104,16 +106,20 @@ public class RetrofitUtils {
}
public static Observable<BaseAPIResponse<CourseListDataBean>> getCourseList(String url) {
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).getCourseList(YdlRetrofitUtils.SERVER_API_JAVA_URL + "auth/course/getList?"+url);
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).getCourseList(YdlRetrofitUtils.SERVER_API_JAVA_URL + "auth/course/getList?" + url);
}
/**
* 获取课程播放页 java 接口
*
*/
public static Observable<BaseResponse<CourseMediaDetailBean>> getCoursePlayData(String courseId) {
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).getCoursePlayData(courseId);
}
public static Observable<BaseAPIResponse<CourseSpecialListBean>> specialListRequest(CourseSpecialListParam param) {
List<FormatText> list = NetworkParamsUtils.getPostList(param);
return YDLHttpUtils.Companion.obtainApi(NetApiStore.class).courseSpecialList(NetworkParamsUtils.getMaps(list));
}
}
......@@ -4,7 +4,6 @@ import android.annotation.SuppressLint
import android.content.Context
import android.text.TextUtils
import android.util.AttributeSet
import android.util.Log
import android.view.View
import android.widget.RelativeLayout
import com.ydl.ydl_router.manager.YDLRouterManager
......@@ -14,7 +13,7 @@ import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.course.R
import com.yidianling.course.bean.CouponHintParam
import com.yidianling.course.bean.CouponHintResponseBean
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.RetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.coupon_hint_view.view.*
......
......@@ -12,7 +12,7 @@ import com.ydl.ydl_image.module.GlideApp
import com.yidianling.common.tools.RxImageTool
import com.yidianling.course.CourseConstants
import com.yidianling.course.R
import com.yidianling.course.coursePlay.moudle.Course
import com.yidianling.course.bean.Course
/**
* @author jiucheng
......
......@@ -12,7 +12,7 @@ import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.course.R
import com.yidianling.course.bean.RedListParam
import com.yidianling.course.coursePlay.common.net.RetrofitUtils
import com.yidianling.course.net.RetrofitUtils
import io.reactivex.android.schedulers.AndroidSchedulers
import io.reactivex.functions.Consumer
import kotlinx.android.synthetic.main.course_redpacket_view.view.*
......
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