Commit 229096eb by 严久程

课程模块

parent c73350fe
...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse ...@@ -4,6 +4,7 @@ import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import io.reactivex.Observable import io.reactivex.Observable
import retrofit2.http.GET import retrofit2.http.GET
import retrofit2.http.HEAD
import retrofit2.http.QueryMap import retrofit2.http.QueryMap
/** /**
...@@ -16,6 +17,7 @@ import retrofit2.http.QueryMap ...@@ -16,6 +17,7 @@ import retrofit2.http.QueryMap
interface CourseSpecialListApi { interface CourseSpecialListApi {
//课程专题列表 //课程专题列表
//todo
@GET("auth/course/listCoursesBySpecialId") @GET("auth/course/listCoursesBySpecialId")
fun courseSpecialList(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<CourseSpecialListBean>> fun courseSpecialList(@QueryMap params: Map<String, String>): Observable<BaseAPIResponse<CourseSpecialListBean>>
} }
\ No newline at end of file
...@@ -44,7 +44,6 @@ class CourseSpecialListHttpImpl private constructor() : ICourseSpecialListHttp { ...@@ -44,7 +44,6 @@ class CourseSpecialListHttpImpl private constructor() : ICourseSpecialListHttp {
override fun courseSpecialList(param: CourseSpecialListParam): Observable<BaseAPIResponse<CourseSpecialListBean>> { override fun courseSpecialList(param: CourseSpecialListParam): Observable<BaseAPIResponse<CourseSpecialListBean>> {
val list = getPostList(param) val list = getPostList(param)
return YDLHttpUtils.getInstance().newBuilder().baseUrl(NetworkParamsUtils.SERVER_API_JAVA_URL) return YDLHttpUtils.obtainApi(CourseSpecialListApi::class.java!!).courseSpecialList(getMaps(list))
.build().create<CourseSpecialListApi>(CourseSpecialListApi::class.java!!).courseSpecialList(getMaps(list))
} }
} }
\ No newline at end of file
package com.yidianling.course.course_special_list.http package com.yidianling.course.course_special_list.http
import com.yidianling.course.course_special_list.bean.CourseSpecialItemBean import com.ydl.ydlcommon.data.http.BaseAPIResponse
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean import com.yidianling.course.course_special_list.bean.CourseSpecialListBean
import com.yidianling.ydlcommon.http.BaseAPIResponse
import com.yidianling.ydlcommon.http.BaseResponse
import io.reactivex.Observable import io.reactivex.Observable
/** /**
...@@ -13,9 +11,12 @@ import io.reactivex.Observable ...@@ -13,9 +11,12 @@ import io.reactivex.Observable
* @Company 壹点灵 * @Company 壹点灵
* @date 2018/9/18 * @date 2018/9/18
*/ */
interface ICourseSpecialListHttp{ interface ICourseSpecialListHttp {
/** /**
* 课程专题列表 * 课程专题列表
*
*
*/ */
fun courseSpecialList(param: CourseSpecialListParam): Observable<BaseAPIResponse<CourseSpecialListBean>> fun courseSpecialList(param: CourseSpecialListParam):
Observable<BaseAPIResponse<CourseSpecialListBean>>
} }
\ No newline at end of file
package com.yidianling.course.course_special_list.model package com.yidianling.course.course_special_list.model
import com.yidianling.course.course_special_list.bean.CourseSpecialItemBean import com.ydl.ydlcommon.data.http.RxUtils
import com.yidianling.course.course_special_list.bean.CourseSpecialListBean 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.contract.ICourseSpecialListContract
import com.yidianling.course.course_special_list.http.CourseSpecialListDataManager 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.http.CourseSpecialListParam
import com.yidianling.ydlcommon.http.RxUtils
import io.reactivex.Observable import io.reactivex.Observable
/** /**
...@@ -15,9 +14,10 @@ import io.reactivex.Observable ...@@ -15,9 +14,10 @@ import io.reactivex.Observable
* @Company 壹点灵 * @Company 壹点灵
* @date 2018/9/18 * @date 2018/9/18
*/ */
class CourseSpecialListModelImpl : ICourseSpecialListContract.Model{ class CourseSpecialListModelImpl : ICourseSpecialListContract.Model {
override fun specialListRequest(param: CourseSpecialListParam): Observable<CourseSpecialListBean> { override fun specialListRequest(param: CourseSpecialListParam): Observable<CourseSpecialListBean> {
return CourseSpecialListDataManager.getHttp().courseSpecialList(param).compose(RxUtils.resultJavaData()) return CourseSpecialListDataManager.getHttp().courseSpecialList(param)
.compose(RxUtils.resultJavaData())
} }
} }
\ No newline at end of file
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