package com.dollearn.student.network
|
|
import cn.sinata.xldutils.data.ResultData
|
import com.google.gson.JsonObject
|
import com.dollearn.student.WeparkApplication
|
import com.dollearn.student.dialog.ChooseStudentDialog
|
import com.dollearn.student.network.entity.*
|
import com.dollearn.student.utils.pay.PayInfo
|
import com.google.gson.Gson
|
import io.reactivex.Flowable
|
import okhttp3.ResponseBody
|
import retrofit2.http.Field
|
|
object HttpManager {
|
private const val PAGE_SIZE = 20
|
|
/**
|
* 发起请求方法
|
*/
|
private fun request() =
|
RRetrofit.instance().create(ApiService::class.java)
|
|
/**
|
* 获取h5
|
* @param type 1=用户协议,2=隐私协议,3=注销
|
*/
|
fun getH5(type: Int): Flowable<ResultData<String>> {
|
return request().getH5(type)
|
}
|
|
|
/**
|
* 获取城市
|
*/
|
fun queryProvinceAndCity(code: String?): Flowable<ResultData<ArrayList<CommonData>>> {
|
return request().queryProvinceAndCity(code)
|
}
|
|
/**
|
* 获取门店
|
*/
|
fun queryStoreByCityCode(code: String,provinceCode:String): Flowable<ResultData<ArrayList<CommonData>>> {
|
return request().queryStoreByCityCode(code,provinceCode)
|
}
|
|
/**
|
* 获取最新版本
|
*/
|
fun queryVersionByType(): Flowable<ResultData<JsonObject>> {
|
return request().queryVersionByType()
|
}
|
|
/**
|
* 获取客服电话/推广中心图片/引导页等
|
* @param type 1=客服电话,2=推广中心图片,3=引导页
|
*/
|
fun querySystemSetByType(type: Int): Flowable<ResultData<JsonObject>> {
|
return request().querySystemSetByType(type)
|
}
|
|
/**
|
* 获取加入玩湃首页数据
|
*/
|
fun queryJoinPlayPai(lat: Double?, lon: Double?): Flowable<ResultData<HomeData>> {
|
return request().queryJoinPlayPai(lat, lon)
|
}
|
|
/**
|
* 买会员
|
*/
|
fun addVipPayment(payType: Int): Flowable<ResultData<PayInfo>> {
|
return request().addVipPayment(payType)
|
}
|
|
/**
|
* 买运动营
|
*/
|
fun paymentCourse(
|
payType: Int,
|
id: String,
|
courseId: String,
|
price: Double,
|
students: String,
|
coupon: Long,
|
orderId: String?
|
): Flowable<ResultData<PayInfo>> {
|
return request().paymentCourse(payType, id, courseId, price, students, coupon,orderId)
|
}
|
|
/**
|
* 已报运动营支付
|
*/
|
fun payment(
|
payType: Int,
|
id: String,
|
courseId: String,
|
courseCount: Int,
|
students: String,
|
useCoupon: Int,
|
coupon: Long
|
): Flowable<ResultData<PayInfo>> {
|
return request().payment(payType, id, courseId, courseCount, students, useCoupon, coupon)
|
}
|
|
fun paymentCourse2(map: HashMap<String, Any?>): Flowable<ResultData<PayInfo>> {
|
return request().paymentCourse2(map)
|
}
|
|
/**
|
* 赛事报名
|
*/
|
fun paymentCompetition(payType: Int, id: String, ids: String,coursePaymentId:String? = null): Flowable<ResultData<PayInfo>> {
|
return request().paymentCompetition(payType, id, ids,coursePaymentId)
|
}
|
|
/**
|
* 门店配置
|
*/
|
fun queryStoreConfig(shopId: String): Flowable<ResultData<List<Banner>>> {
|
return request().queryStoreConfig(shopId)
|
}
|
|
/**
|
* 门店更多配置
|
*/
|
fun queryIndexSet(shopId: String): Flowable<ResultData<List<Banner>>> {
|
return request().queryIndexSet(shopId)
|
}
|
|
/**
|
* 体检报告
|
*/
|
fun queryPhysical(id: String): Flowable<ResultData<Report>> {
|
return request().queryPhysical(id)
|
}
|
|
/**
|
* 预约
|
*/
|
fun reverse(time: String, stuId: String, courseId: String): Flowable<ResultData<Any>> {
|
return request().reverse(time, stuId, courseId)
|
}
|
|
/**
|
* 取消预约
|
*/
|
fun cancelCourse(id: String): Flowable<ResultData<Any>> {
|
return request().cancelCourse(id)
|
}
|
|
/**
|
* 预约记录
|
*/
|
fun stuAppointList(
|
page: Int,
|
id: String,
|
type: Int,
|
timeType: Int?,
|
search: String?
|
): Flowable<ResultData<List<ReserveRecord>>> {
|
return request().stuAppointList(id, type, timeType, search,page)
|
}
|
|
/**
|
* 兑换默认运动营成员或门店
|
*/
|
fun goodsOfCourseStore(isCourse: Int, id: String): Flowable<ResultData<DefaultData>> {
|
return request().goodsOfCourseStore(
|
isCourse,
|
id,
|
WeparkApplication.lat,
|
WeparkApplication.lon
|
)
|
}
|
|
/**
|
* 用户信息
|
*/
|
fun userDetails(): Flowable<ResultData<UserBean>> {
|
return request().userDetails()
|
}
|
|
/**
|
* 学习记录
|
*/
|
fun studyRecord(): Flowable<ResultData<StudyRecord>> {
|
return request().studyRecord()
|
}
|
|
/**
|
* 修改头像
|
*/
|
fun uploadImage(userImage: String): Flowable<ResultData<Any>> {
|
return request().uploadImage(userImage)
|
}
|
|
/**
|
* 视频列表
|
*/
|
fun queryClassificationBenefitsVideosList(
|
type: Int,
|
search: String?
|
): Flowable<ResultData<List<VideoTypeBean>>> {
|
return request().queryClassificationBenefitsVideosList(type, search)
|
}
|
|
/**
|
* 视频列表
|
*/
|
fun queryBenefitsVideosList(
|
type: String,
|
page: Int,
|
search: String?
|
): Flowable<ResultData<List<VideoBean>>> {
|
return request().queryBenefitsVideosList(type, page, PAGE_SIZE, search)
|
}
|
|
|
/**
|
* 视频详情
|
*/
|
fun queryBenefitsVideosInfo(id: String): Flowable<ResultData<VideoBean>> {
|
return request().queryBenefitsVideosInfo(id)
|
}
|
|
|
/**
|
* 课后练习视频详情
|
*/
|
fun afterSourceDetail(id: String, courseId: String,scId:String): Flowable<ResultData<Practice>> {
|
return request().afterSourceDetail(id, scId,courseId)
|
}
|
|
/**
|
* 视频奖励
|
*/
|
fun receiveAward(id: String): Flowable<ResultData<Any>> {
|
return request().receiveAward(id)
|
}
|
|
/**
|
* 课后练习完成观看
|
*/
|
fun updateVideoStatus(id: String,courseId: String,scId: String): Flowable<ResultData<Any>> {
|
return request().updateVideoStatus(id,courseId,scId)
|
}
|
|
/**
|
* 赛事列表
|
*/
|
fun querySiteList(
|
page: Int,
|
cityCode: String?,
|
startTime: String?,
|
endTime: String?,
|
siteType: Int?,
|
shopId: String?,
|
search: String?
|
): Flowable<ResultData<List<Place>>> {
|
return request().querySiteList(
|
page,
|
PAGE_SIZE,
|
WeparkApplication.lat,
|
WeparkApplication.lon,
|
cityCode,
|
startTime,
|
endTime,
|
siteType,
|
shopId,
|
search
|
)
|
}
|
|
/**
|
* 我的场地列表
|
*/
|
fun queryMySite(page: Int, state: Int?): Flowable<ResultData<List<Place>>> {
|
return request().queryMySite(page, PAGE_SIZE, state)
|
}
|
|
/**
|
* 取消场地
|
*/
|
fun cancelMySite(id: String): Flowable<ResultData<Any>> {
|
return request().cancelMySite(id)
|
}
|
|
/**
|
* 赛事列表
|
*/
|
fun queryCompetitionList(
|
cityCode: String?,
|
registerCondition: Int?,
|
heat: String?,
|
search: String?
|
): Flowable<ResultData<List<Match>>> {
|
return request().queryCompetitionList(cityCode, registerCondition, heat, search)
|
}
|
|
/**
|
* 我的赛事列表
|
*/
|
fun queryMyCompetitionList(type: Int, page: Int): Flowable<ResultData<List<Match>>> {
|
return request().queryMyCompetitionList(type, page, PAGE_SIZE)
|
}
|
|
/**
|
* 场地类型
|
*/
|
fun querySiteType(): Flowable<ResultData<List<CommonData>>> {
|
return request().querySiteType()
|
}
|
|
/**
|
* 支付运动营--完成后优惠券列表
|
*/
|
fun paymentCourseCouponList(id: Int? = null): Flowable<ResultData<List<Coupon>>> {
|
return request().paymentCourseCouponList(id)
|
}
|
|
/**
|
* 支付会员--完成后优惠券列表
|
*/
|
fun queryCouponList(): Flowable<ResultData<List<Coupon>>> {
|
return request().queryCouponList()
|
}
|
|
/**
|
* 查询预约详情
|
*/
|
fun queryMySiteById(id: String): Flowable<ResultData<MySite>> {
|
return request().queryMySiteById(id)
|
}
|
|
/**
|
* 课后练习-购课详情(用于购课)
|
*/
|
fun payCourseInfo(id: Int): Flowable<ResultData<PayCoursInfo>> {
|
return request().payCourseInfo(id)
|
}
|
|
/**
|
* 课后练习-购课(用于购课)
|
*/
|
fun payCourse(map: HashMap<String, Any>, time: List<String>): Flowable<ResultData<Any>> {
|
return request().payCourse(map, time)
|
}
|
|
/**
|
* 课后练习-可支付运动营列表(用于购课)
|
*/
|
fun getMyCourseList(): Flowable<ResultData<List<MyCourseList>>> {
|
return request().getMyCourseList()
|
}
|
|
/**
|
* 课后练习类型
|
*/
|
fun queryArrangeCourseList(): Flowable<ResultData<List<CommonData>>> {
|
return request().queryArrangeCourseList()
|
}
|
|
/**
|
* 已报名运动营
|
*/
|
fun registeredCourses(type: Int?, search: String?): Flowable<ResultData<List<JoinedCourse>>> {
|
return request().registeredCourses(type, search)
|
}
|
|
/**
|
* 场地时间段
|
*/
|
fun querySiteTimes(id: String, date: String,siteName:String?,halfName:String?): Flowable<ResultData<List<PlaceTime>>> {
|
return request().querySiteTimes(id, date,halfName,siteName)
|
}
|
|
/**
|
* 场地优惠券
|
*/
|
fun querySiteCouponList(id: String, price: Double): Flowable<ResultData<List<Coupon>>> {
|
return request().querySiteCouponList(
|
id,
|
WeparkApplication.lat,
|
WeparkApplication.lon,
|
price
|
)
|
}
|
|
/**
|
* 场地详情
|
*/
|
fun querySiteInfo(id: String): Flowable<ResultData<Place>> {
|
return request().querySiteInfo(id, WeparkApplication.lat, WeparkApplication.lon)
|
}
|
|
/**
|
* 场地下单
|
*/
|
fun reservationSite(
|
id: String,
|
name: String,
|
phone: String,
|
time: String,
|
payType: Int,
|
coupon: Long?,
|
isHalf: Int,
|
halfName: String?,
|
nextName: String
|
): Flowable<ResultData<PayInfo>> {
|
return request().reservationSite(
|
id,
|
name,
|
phone,
|
time,
|
payType,
|
coupon,
|
isHalf,
|
halfName,
|
nextName
|
)
|
}
|
|
/**
|
* 场地支付
|
*/
|
fun continuePaymentMySite(id: String, payType: Int): Flowable<ResultData<PayInfo>> {
|
return request().continuePaymentMySite(id, payType)
|
}
|
|
/**
|
* 赛事详情
|
*/
|
fun queryCompetitionInfo(id: String, lat: Double?, lon: Double?): Flowable<ResultData<Match>> {
|
return request().queryCompetitionInfo(id, lat, lon)
|
}
|
|
/**
|
* 赛事详情
|
*/
|
fun queryMyCompetitionInfo(id: String): Flowable<ResultData<Match>> {
|
return request().queryMyCompetitionInfo(id)
|
}
|
|
/**
|
* 赛事城市
|
*/
|
fun queryAllCity(): Flowable<ResultData<List<CommonData>>> {
|
return request().queryAllCity()
|
}
|
|
/**
|
* 运动营列表
|
*/
|
fun queryCourseList(
|
shopId: String,
|
lat: Double?,
|
lon: Double?,
|
type: Int?,
|
distanceSort: String?,
|
salesSort: String?,
|
search: String?
|
): Flowable<ResultData<List<Course>>> {
|
return request().queryCourseList(shopId, lat, lon, type, distanceSort, salesSort, search)
|
}
|
|
/**
|
* 运动营详情
|
*/
|
fun queryCourseInfo(id: String, lat: Double?, lon: Double?,stuId:String? = null): Flowable<ResultData<Course>> {
|
return request().queryCourseInfo(id,stuId, lat, lon)
|
}
|
|
/**
|
* 福利详情
|
*/
|
fun discountCourseDatas(
|
id: String,
|
lat: Double?,
|
lon: Double?
|
): Flowable<ResultData<WelfareDetail>> {
|
return request().discountCourseDatas(id, lat, lon)
|
}
|
|
/**
|
* 上课首页
|
*/
|
fun queryStudentData(stuId: String?): Flowable<ResultData<CourseHomeData>> {
|
return request().queryStudentData(stuId)
|
}
|
|
/**
|
* 充值选择列表
|
*/
|
fun voucherCenter(): Flowable<ResultData<List<RechargeItem>>> {
|
return request().voucherCenter()
|
}
|
|
/**
|
* 储值说明
|
*/
|
fun rechargeDescription(): Flowable<ResultData<String>> {
|
return request().rechargeDescription()
|
}
|
|
/**
|
* 运动营类型列表
|
*/
|
fun queryCoursePackageType(): Flowable<ResultData<List<CommonData>>> {
|
return request().queryCoursePackageType()
|
}
|
|
/**
|
* 已报名运动营类型列表
|
*/
|
fun getCourseAppUserDetails(): Flowable<ResultData<List<CommonData>>> {
|
return request().getCourseAppUserDetails()
|
}
|
|
/**
|
* 门店列表
|
*/
|
fun queryStoreLists(lat: Double?, lon: Double?, cityCode: String? = null): Flowable<ResultData<List<CommonData>>> {
|
return request().queryStoreLists(lat, lon,cityCode)
|
}
|
|
/**
|
* 获取课时记录
|
*/
|
fun recordDetails(
|
stuId: String,
|
courseId: String,
|
time: String?,
|
type: Int?
|
): Flowable<ResultData<ArrayList<CourseRecord>>> {
|
return request().recordDetails(stuId, courseId, time, type)
|
}
|
|
/**
|
* 获取奖章
|
*/
|
fun stuGoog(id: String): Flowable<ResultData<ArrayList<Medal>>> {
|
return request().stuGoog(id)
|
}
|
|
/**
|
* 获取奖章详细
|
*/
|
fun stuMedal(id: String): Flowable<ResultData<ArrayList<Medal>>> {
|
return request().stuMedal(id)
|
}
|
|
/**
|
* 评语
|
*/
|
fun stuComment(id: String): Flowable<ResultData<ArrayList<Evaluation>>> {
|
return request().stuComment(id)
|
}
|
|
/**
|
* 获取课后练习
|
*/
|
fun afterSourceList(stuId: String,id: Int?, search: String?): Flowable<ResultData<ArrayList<Practice>>> {
|
return request().afterSourceList(stuId,id, search)
|
}
|
|
/**
|
* 获取运动营排班
|
*/
|
fun weeksOfCourseDetails(
|
id: String,
|
storeID: String,
|
time: String
|
): Flowable<ResultData<WeeksOfCourseDetails>> {
|
return request().weeksOfCourseDetails(
|
id,
|
storeID,
|
time,
|
WeparkApplication.lat,
|
WeparkApplication.lon
|
)
|
}
|
|
/**
|
* 切换运动营成员
|
*/
|
fun switchStu(id: String): Flowable<ResultData<Any>> {
|
return request().switchStu(id)
|
}
|
|
/**
|
* 课时详情
|
*/
|
fun lessonDetails(id: String, stuId: String): Flowable<ResultData<MyCourseDetail>> {
|
return request().lessonDetails(stuId, id)
|
}
|
|
/**
|
* 设为默认运动营成员
|
*/
|
fun editDefault(stuId: String): Flowable<ResultData<Any>> {
|
return request().editDefault(stuId)
|
}
|
|
/**
|
* 获取验证码
|
*/
|
fun getCode(phone: String): Flowable<ResultData<Any>> {
|
return request().getCode(phone)
|
}
|
|
/**
|
* 注册/忘记密码/修改密码
|
* @param type 2:注册,3:修改密码,4:忘记密码,5:绑手机
|
*/
|
fun register(type: Int, phone: String, pwd: String, code: String, invitePhone: String?, openId: String?,lat: Double?,lon: Double?): Flowable<ResultData<Any>> {
|
val url = when (type) {
|
3 -> Apis.updatePassword
|
4 -> Apis.forgetPassword
|
5 -> Apis.bindWx
|
else -> Apis.register
|
}
|
return request().register(url, phone, pwd, code,invitePhone,openId,lat,lon)
|
}
|
|
/**
|
* 注册/忘记密码/修改密码
|
* @param type 2:注册,3:修改密码,4:忘记密码,5:绑手机
|
*/
|
fun bindPhone(phone: String, code: String, invitePhone: String?, openId: String,lat: Double?,lon: Double?): Flowable<ResultData<JsonObject>> {
|
return request().bindPhone(phone, code,invitePhone,openId,lat,lon)
|
}
|
|
/**
|
* 商品推荐
|
*/
|
fun goodRecommend(): Flowable<ResultData<ArrayList<Goods>?>> {
|
return request().goodRecommend()
|
}
|
|
|
/**
|
* 根据季度获取周目列表
|
*/
|
fun weekList(season:Int,type: Int = 1): Flowable<ResultData<ArrayList<Week>?>> {
|
return request().weekList(season,type)
|
}
|
|
/**
|
* 用户学习进度
|
*/
|
fun studySchedule(week:Int,day:Int): Flowable<ResultData<Schedule>> {
|
return request().studySchedule(week,day)
|
}
|
|
/**
|
* 验证码登录
|
*/
|
fun captchaLogin(code: String, phone: String): Flowable<ResultData<LoginBean?>> {
|
return request().captchaLogin(Gson().toJson(ReqLogin(phone,code)))
|
}
|
|
/**
|
* 轮播
|
* @param type 1=首页,2=首页底部,3=线上课得积分,4=看视频得奖励,5=常见问题
|
*/
|
fun queryBanner(type: Int = 1): Flowable<ResultData<ArrayList<Banner>>> {
|
return request().queryBanner(type)
|
}
|
|
/**
|
* 搜索运动营
|
*/
|
fun querySearchCourseList(
|
key: String?,
|
page: Int,
|
gradeId: Int,
|
subjectId: String?
|
): Flowable<ResultData<ArrayList<Course>>> {
|
return request().querySearchCourseList(key, page, gradeId, subjectId)
|
}
|
|
/**
|
* 获取String类型通用接口
|
*/
|
fun queryString(url: String, map: HashMap<String, Any>): Flowable<ResultData<String>> {
|
return request().queryString(url, map)
|
}
|
|
|
|
/**
|
* 充值支付
|
*/
|
fun recharge(money: Double, payType: Int): Flowable<ResultData<PayInfo>> {
|
return request().recharge(money, payType)
|
}
|
|
/**
|
* 添加运动营成员
|
*/
|
fun addStudent(
|
name: String,
|
birthday: String,
|
sex: Int,
|
avatar: String,
|
height: Double,
|
weight: Double,
|
idCard: String?,
|
phone: String?,
|
stuId: String?
|
): Flowable<ResultData<Any>> {
|
return request().addStudent(
|
if (stuId.isNullOrEmpty()) Apis.addStudent else Apis.commitEditStu,
|
birthday,
|
avatar,
|
height,
|
weight,
|
sex,
|
name,
|
phone,
|
idCard,
|
stuId,
|
stuId
|
)
|
}
|
|
/**
|
* 添加人员
|
*/
|
fun addParticipant(
|
avatar: String,
|
name: String,
|
birthday: String,
|
sex: Int,
|
height: Double,
|
weight: Double,
|
idCard: String?,
|
phone: String?
|
): Flowable<ResultData<Any>> {
|
return request().addParticipant(avatar,birthday, height, weight, sex, name, phone, idCard)
|
}
|
|
/**
|
* 改人员
|
*/
|
fun editParticipant(
|
avatar: String,
|
id: String,
|
height: Int?,
|
weight: Double?,
|
phone: String?,
|
name: String?,
|
idCard: String?,
|
sex: Int?,
|
birthday: String?
|
): Flowable<ResultData<Any>> {
|
return request().editParticipant(avatar,id, height, weight, phone, birthday, name, sex, idCard)
|
}
|
|
/**
|
* 删除人员
|
*/
|
fun delParticipant(id: String,isStudent:Int?): Flowable<ResultData<Any>> {
|
return request().delParticipant(id,isStudent)
|
}
|
|
/**
|
* 取消赛事报名
|
*/
|
fun cancelMyCompetition(id: String): Flowable<ResultData<Any>> {
|
return request().cancelMyCompetition(id)
|
}
|
|
/**
|
* 可用课时列表
|
*/
|
fun paymentCompetitionCourseList(id: String): Flowable<ResultData<List<PayCourse>>> {
|
return request().paymentCompetitionCourseList(id)
|
}
|
|
/**
|
* 保存进度
|
*/
|
fun exitLearning(day: Int,week: Int,type: Int,teamIds:String,topicIds:String): Flowable<ResultData<Any>> {
|
return request().exitLearning(Gson().toJson(ReqSaveProgress(day, week, type, teamIds, topicIds)))
|
}
|
|
/**
|
* 运动营成员列表
|
*
|
*/
|
fun listOfStu(type: Int = ChooseStudentDialog.TYPE_COURSE,isPre:Int? = null): Flowable<ResultData<List<Student>>> {
|
val url = when (type) {
|
ChooseStudentDialog.TYPE_MATCH,ChooseStudentDialog.TYPE_WORLD -> Apis.queryParticipantList
|
else -> Apis.listOfStu
|
}
|
return request().listOfStu(url,isPre)
|
}
|
|
/**
|
* 充值明细
|
*/
|
fun voucherDetail(
|
date: String,
|
typeId: Int?,
|
page: Int,
|
type: Int
|
): Flowable<ResultData<List<CoinRecord>>> {
|
return request().voucherDetail(
|
if (type == 1) Apis.voucherDetail else Apis.integralDetails,
|
date,
|
page,
|
PAGE_SIZE,
|
typeId
|
)
|
}
|
|
/**
|
* 账单
|
*/
|
fun userBilling(date: String, type: Int?): Flowable<ResultData<List<CoinRecord>>> {
|
return request().userBilling(date, type)
|
}
|
|
/**
|
* 券包列表
|
*/
|
fun queryCouponPackage(state: Int?, type: Int?): Flowable<ResultData<List<Coupon>>> {
|
return request().queryCouponPackage(type, state)
|
}
|
|
/**
|
* 商品
|
*/
|
fun integralMallList(
|
type: Int?,
|
page: Int,
|
sort: Int?,
|
search: String?,
|
shopId: String?
|
): Flowable<ResultData<List<Goods>>> {
|
return request().integralMallList(
|
type,
|
sort,
|
page,
|
PAGE_SIZE,
|
WeparkApplication.lat,
|
WeparkApplication.lon,
|
search,
|
shopId
|
)
|
}
|
|
/**
|
* 商品可用门店列表
|
*/
|
fun exchangeStoreIds(type: Int, id: String): Flowable<ResultData<List<Shop>>> {
|
return request().exchangeStoreIds(type, id)
|
}
|
|
/**
|
* 兑换记录
|
*/
|
fun exchangeRecords(type: Int?, state: Int?): Flowable<ResultData<List<ExchangeRecord>>> {
|
return request().exchangeRecords(type, state)
|
}
|
|
/**
|
* 兑换详情
|
*/
|
fun redemptionDetails(id: String): Flowable<ResultData<ExchangeDetail>> {
|
return request().redemptionDetails(id)
|
}
|
|
/**
|
* 注销
|
*/
|
fun cancellation(): Flowable<ResultData<Any>> {
|
return request().cancellation()
|
}
|
|
/**
|
* 兑换商品
|
*/
|
fun productRedemptionOperation(
|
goodsId: String,
|
goodsType: Int,
|
exchangeType: Int,
|
num: Int,
|
payType: Int?,
|
students: String?,
|
storeId: String?
|
): Flowable<ResultData<PayInfo>> {
|
return request().productRedemptionOperation(
|
goodsType,
|
exchangeType,
|
goodsId,
|
num,
|
payType,
|
students,
|
storeId
|
)
|
}
|
|
/**
|
* 查询免费福利
|
*/
|
fun queryStoreFreeBenefit(id: String): Flowable<ResultData<JsonObject>> {
|
return request().queryStoreFreeBenefit(id)
|
}
|
|
/**
|
* 福利
|
*/
|
fun weekLimitedBenefit(type: Int): Flowable<ResultData<ArrayList<Welfare>>> {
|
return request().weekLimitedBenefit(type, WeparkApplication.lat, WeparkApplication.lon)
|
}
|
|
/**
|
* 优惠券列表
|
*/
|
fun queryAvailableCouponList(
|
coursePackageId: String,
|
price: Double,
|
lat: Double?,
|
lon: Double?
|
): Flowable<ResultData<ArrayList<Coupon>>> {
|
return request().queryAvailableCouponList(coursePackageId, price, lat, lon)
|
}
|
|
/**
|
* 商品类型
|
*/
|
fun goodTypeStudy(): Flowable<ResultData<ArrayList<GoodsType>>> {
|
return request().goodTypeStudy()
|
}
|
|
/**
|
* 剩余分数
|
*/
|
fun getIntegralStudy(): Flowable<ResultData<Int?>> {
|
return request().getIntegralStudy()
|
}
|
|
/**
|
* 听音选图题
|
*/
|
fun listenSelectPicture(season: Int,week: Int,day: Int): Flowable<ResultData<SubjectBean>> {
|
return request().listenSelectPicture(day,season,week)
|
}
|
|
/**
|
* 立即兑换
|
*/
|
fun redeemNow(id:String): Flowable<ResultData<GoodsOrder>> {
|
return request().redeemNow(id)
|
}
|
|
/**
|
* 确认收货
|
*/
|
fun confirmStudy(id:String): Flowable<ResultData<Any>> {
|
return request().confirmStudy(id)
|
}
|
|
/**
|
* 设置默认地址
|
*/
|
fun setDefaultStudy(id:String): Flowable<ResultData<Any>> {
|
return request().setDefaultStudy(id)
|
}
|
|
/**
|
* 删除地址
|
*/
|
fun addressDelete(id:String): Flowable<ResultData<Any>> {
|
return request().addressDelete(id)
|
}
|
|
/**
|
* 积分明细
|
*/
|
fun integralDetail(page: Int,time: String?): Flowable<ResultData<ScoreRecordBean>> {
|
return request().integralDetail(page,time = time)
|
}
|
|
/**
|
* 省市
|
*/
|
fun addressTree(): Flowable<ResultData<List<Province>>> {
|
return request().addressTree()
|
}
|
|
/**
|
* 修改地址列表
|
*/
|
fun getOrderAddress(): Flowable<ResultData<List<Recipient>>> {
|
return request().getOrderAddress()
|
}
|
|
/**
|
* 地址列表
|
*/
|
fun shopAddress(): Flowable<ResultData<List<Recipient>>> {
|
return request().shopAddress()
|
}
|
|
/**
|
* 地址加 改
|
*/
|
fun addressSaveOrUpdate(address:String,cityCode: String,city:String,province:String,provinceCode: String,isDefault:Int,name:String,phone: String,id: String?): Flowable<ResultData<Any>> {
|
return request().addressSaveOrUpdate(Gson().toJson(ReqAddAddress(address,city,cityCode,isDefault,province,provinceCode,name,phone,id)))
|
}
|
|
/**
|
* 确认兑换
|
*/
|
fun goodExchangeStudy(id:String,number:Int,orderNumber:String,recipientId:String,remark:String): Flowable<ResultData<Any>> {
|
return request().goodExchangeStudy(Gson().toJson(ReqExchange(id,number, orderNumber, recipientId, remark)))
|
}
|
|
/**
|
* 修改地址
|
*/
|
fun updateOrderAddress(id:String,recipientId:String): Flowable<ResultData<Any>> {
|
return request().updateOrderAddress(id, recipientId)
|
}
|
|
/**
|
* 地址详情
|
*/
|
fun getAddressByIdStudy(id:String): Flowable<ResultData<Recipient>> {
|
return request().getAddressByIdStudy(id)
|
}
|
|
/**
|
* 商品列表
|
*/
|
fun goodListStudy(page: Int,search: String?,type: List<String>): Flowable<ResultData<GoodsList>> {
|
return request().goodListStudy(Gson().toJson(ReqGoodsList(search,page,16,type)))
|
}
|
|
/**
|
* 商品详情
|
*/
|
fun goodDetail(id: String): Flowable<ResultData<GoodsDetail>> {
|
return request().goodDetail(id)
|
}
|
|
/**
|
* 订单详情
|
*/
|
fun queryIsBindAlipay(): Flowable<ResultData<Boolean>> {
|
return request().queryIsBindAlipay()
|
}
|
|
/**
|
* 兑换记录
|
*/
|
fun exchangeRecord(): Flowable<ResultData<List<ExchangeRecord>>> {
|
return request().exchangeRecord()
|
}
|
|
/**
|
* 运动营退款
|
*/
|
fun optApplyRefund(
|
id: Int,
|
refundClassHours: Int,
|
refundMark: String,
|
refundMoney: Double
|
): Flowable<ResultData<JsonObject>> {
|
return request().optApplyRefund(id, refundClassHours, refundMark, refundMoney)
|
}
|
|
/**
|
* 撤销运动营退款
|
*/
|
fun optCancelApply(id: Int): Flowable<ResultData<JsonObject>> {
|
return request().optCancelApply(id)
|
}
|
|
/**
|
* 添加悬赏问题
|
*/
|
fun optAddQuestion(
|
question: String,
|
describe: String,
|
img: String,
|
gold: Int
|
): Flowable<ResultData<RewardQuestion>> {
|
return request().optAddQuestion(question, describe, img, gold)
|
}
|
|
/**
|
* 悬赏问题列表
|
*/
|
fun queryQuestionSquareList(
|
page: Int,
|
key: String? = null
|
): Flowable<ResultData<ArrayList<RewardQuestion>>> {
|
return request().queryQuestionSquareList(page, key)
|
}
|
|
/**
|
* 悬赏答案列表
|
*/
|
fun queryQuestionAnswerList(page: Int, id: Int): Flowable<ResultData<ArrayList<RewardAnswer>>> {
|
return request().queryQuestionAnswerList(page, id)
|
}
|
|
|
|
/**
|
* 已报运动营详情
|
*/
|
fun registeredData(id: String,orderId: String): Flowable<ResultData<JoinedCourse>> {
|
return request().registeredData(WeparkApplication.lat,WeparkApplication.lon,id,orderId)
|
}
|
/**
|
* 探索首页
|
*/
|
fun indexOfEx(): Flowable<ResultData<List<Shop>>> {
|
return request().indexOfEx(WeparkApplication.lat, WeparkApplication.lon)
|
}
|
|
/**
|
* 游戏列表
|
*/
|
fun queryGameList(storeID: String,siteId:Int): Flowable<ResultData<List<GameBean>>> {
|
return request().queryGameList(siteId,storeID)
|
}
|
|
/**
|
* 玩家记录
|
*/
|
fun gameRecord(userId: String,page:Int): Flowable<ResultData<List<GameRecordBean>>> {
|
return request().gameRecord(userId,page)
|
}
|
|
/**
|
* 游戏支付
|
*/
|
fun payGame(configId:Int,gameId:Int,spaceId:Int,sutuId:Int,type: Int,gameType: Int): Flowable<ResultData<PayInfo>> {
|
return request().payGame(configId,gameId,spaceId,sutuId, type,gameType)
|
}
|
|
/**
|
* 门店列表
|
*/
|
fun storeList(cityCode: String?, distanceSort: Int?,search: String?): Flowable<ResultData<List<ShopListBean>>> {
|
return request().storeList(
|
WeparkApplication.lat,
|
WeparkApplication.lon,
|
cityCode,
|
distanceSort,
|
search)
|
}
|
|
/**
|
* 公告列表
|
*/
|
fun noticeList(): Flowable<ResultData<List<Notice>>> {
|
return request().noticeList()
|
}
|
|
/**
|
* 问题列表
|
*/
|
fun exceptionList(): Flowable<ResultData<List<Notice>>> {
|
return request().exceptionList()
|
}
|
|
/**
|
* 公告详情
|
*/
|
fun noticeDetail(id: String, type: Int): Flowable<ResultData<Notice>> {
|
return request().noticeDetail(
|
if (type == 1) Apis.noticeDetail else Apis.exceptionDetail,
|
id,
|
id
|
)
|
}
|
|
/**
|
* 客服电话列表
|
*/
|
fun customerList(): Flowable<ResultData<List<String>>> {
|
return request().customerList()
|
}
|
|
/**
|
* 门店详情
|
*/
|
fun storeDetail(id: String): Flowable<ResultData<ShopDetail>> {
|
return request().storeDetail(id)
|
}
|
|
/**
|
* 店铺评价
|
*/
|
fun saveEvaluation(
|
id: String,
|
img: String?,
|
content: String?,
|
score: Double
|
): Flowable<ResultData<Any>> {
|
return request().saveEvaluation(id, content, img, score)
|
}
|
|
|
/**
|
* 获取未分配课时的数量
|
*/
|
fun weeksOfGetHours(): Flowable<ResultData<Int>> {
|
return request().weeksOfGetHours()
|
}
|
|
/**
|
* 分配课时
|
*/
|
fun weeksOfAddHours(id: Long): Flowable<ResultData<Any>> {
|
return request().weeksOfAddHours(id)
|
}
|
|
/**
|
* 更新用户信息
|
*/
|
fun updateInfo(name: String?,gender:Int?,birthday: String?): Flowable<ResultData<Any>> {
|
return request().updateInfo(birthday,gender,name)
|
}
|
|
/**
|
* 获取游戏列表
|
*/
|
fun getGameList(url: String): Flowable<ResponseBody> {
|
return request().getGameList(url)
|
}
|
|
/**
|
*获取平台配置模块详情【2.0】
|
*/
|
fun getHomeModule(): Flowable<ResultData<Banner>> {
|
return request().getHomeModule()
|
}
|
|
/**
|
* 首页获取完成比赛的提示
|
*/
|
fun getCompletedWorldCupTips(): Flowable<ResultData<Int>> {
|
return request().getCompletedWorldCupTips()
|
}
|
|
/**
|
* 世界杯列表
|
*/
|
fun getWorldCupList(id: String,lat: Double?,lon: Double?,sort: Int?,gender: Int?,storeId: Int?,search: String?): Flowable<ResultData<List<WorldCupBean>>> {
|
return request().getWorldCupList(id,lat,lon,gender,sort,storeId,search)
|
}
|
|
/**
|
* 裁判世界杯列表
|
*/
|
fun getWorldCupListCoach(storeId: Int?,search: String?): Flowable<ResultData<List<WorldCupBean>>> {
|
return request().getWorldCupListCoach(WeparkApplication.lat,WeparkApplication.lon,storeId,search)
|
}
|
|
/**
|
* 世界杯赛点列表
|
*/
|
fun getWorldCupStore(): Flowable<ResultData<List<CommonData>>> {
|
return request().getWorldCupStore()
|
}
|
|
/**
|
* 世界杯详情
|
*/
|
fun getWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> {
|
return request().getWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon)
|
}
|
|
/**
|
* 世界杯报名
|
*/
|
fun paymentWorldCup(id: String,ids: String,type: Int): Flowable<ResultData<PayInfo>> {
|
return request().paymentWorldCup(id,ids,type)
|
}
|
|
/**
|
* 世界杯报名
|
*/
|
fun getEntrantRank(id: String,isStudent: Int): Flowable<ResultData<Rank>> {
|
return request().getEntrantRank(id,isStudent)
|
}
|
|
/**
|
* 世界杯报名列表
|
*/
|
fun getMyWorldCupList(id: String,isStudent: Int,state: Int,page: Int): Flowable<ResultData<List<WorldCupBean>>> {
|
return request().getMyWorldCupList(id,isStudent,state, page)
|
}
|
|
/**
|
* 世界杯比赛记录
|
*/
|
fun getWorldCupMatchRecord(id: String,isStudent: Int,page: Int): Flowable<ResultData<WorldCupRecord>> {
|
return request().getWorldCupMatchRecord(id,isStudent, page)
|
}
|
|
/**
|
* 世界杯比赛排名
|
*/
|
fun getWorldCupRank(id: String,isStudent: Int,radius: Int,sort:Int,year:Int?): Flowable<ResultData<List<WorldRank>>> {
|
return request().getWorldCupRank(id,isStudent, radius, sort, year)
|
}
|
|
/**
|
* 世界杯我的已报名人员
|
*/
|
fun getParticipant(): Flowable<ResultData<List<Student>>> {
|
return request().getParticipant()
|
}
|
|
/**
|
* 世界杯报名详情
|
*/
|
fun getMyWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> {
|
return request().getMyWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon)
|
}
|
|
/**
|
* 世界杯报名取消
|
*/
|
fun cancelMyWorldCup(id: String): Flowable<ResultData<Any>> {
|
return request().cancelMyWorldCup(id)
|
}
|
|
/**
|
* 裁判扫码获取参赛人信息【2.0】
|
*/
|
fun getWorldCupPeople(id: String,code: String): Flowable<ResultData<CodeResultUser>> {
|
return request().getWorldCupPeople(code,id)
|
}
|
|
/**
|
* 裁判扫码获取设备信息【2.0】
|
*/
|
fun getDeviceInformation(code: String): Flowable<ResultData<DeviceBean>> {
|
return request().getDeviceInformation(code)
|
}
|
|
/**
|
* 裁判开始【2.0】
|
*/
|
fun startWorldCup(code: String,people:String,id: String): Flowable<ResultData<Any>> {
|
return request().startWorldCup(code,people,id)
|
}
|
}
|