| | |
| | | |
| | | import cn.sinata.xldutils.data.ResultData |
| | | import com.google.gson.JsonObject |
| | | import com.dollearn.student.WeparkApplication |
| | | import com.dollearn.student.DollearnApplication |
| | | 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 |
| | |
| | | */ |
| | | 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) |
| | | } |
| | | |
| | | /** |
| | |
| | | return request().payment(payType, id, courseId, courseCount, students, useCoupon, coupon) |
| | | } |
| | | |
| | | fun paymentCourse2(map: HashMap<String, Any?>): Flowable<ResultData<PayInfo>> { |
| | | return request().paymentCourse2(map) |
| | | } |
| | | |
| | | /** |
| | | * 赛事报名 |
| | | */ |
| | |
| | | } |
| | | |
| | | /** |
| | | * 门店配置 |
| | | */ |
| | | 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) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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 shareInfo(): Flowable<ResultData<ConfigBean>> { |
| | | return request().shareInfo() |
| | | } |
| | | |
| | | /** |
| | |
| | | return request().querySiteList( |
| | | page, |
| | | PAGE_SIZE, |
| | | WeparkApplication.lat, |
| | | WeparkApplication.lon, |
| | | DollearnApplication.lat, |
| | | DollearnApplication.lon, |
| | | cityCode, |
| | | startTime, |
| | | endTime, |
| | |
| | | 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) |
| | | } |
| | | |
| | | /** |
| | | * 我的赛事列表 |
| | |
| | | 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 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 |
| | | ) |
| | | } |
| | | |
| | | /** |
| | |
| | | id, |
| | | storeID, |
| | | time, |
| | | WeparkApplication.lat, |
| | | WeparkApplication.lon |
| | | DollearnApplication.lat, |
| | | DollearnApplication.lon |
| | | ) |
| | | } |
| | | |
| | | /** |
| | | * 切换运动营成员 |
| | | */ |
| | | fun switchStu(id: String): Flowable<ResultData<Any>> { |
| | | return request().switchStu(id) |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | fun getCode(phone: String): Flowable<ResultData<Any>> { |
| | | return request().getCode(phone) |
| | | } |
| | | |
| | | /** |
| | | * 获取正确和错误语音 |
| | | */ |
| | | fun promptVoice(): Flowable<ResultData<ConfigBean>> { |
| | | return request().promptVoice() |
| | | } |
| | | |
| | | /** |
| | |
| | | */ |
| | | fun studySchedule(week:Int,day:Int): Flowable<ResultData<Schedule>> { |
| | | return request().studySchedule(week,day) |
| | | } |
| | | |
| | | /** |
| | | * 获取在线时间赠送积分信息(单位分钟) |
| | | */ |
| | | fun onlineDuration(): Flowable<ResultData<String>> { |
| | | return request().onlineDuration() |
| | | } |
| | | |
| | | /** |
| | | * 获取在线时间赠送积分信 |
| | | */ |
| | | fun giveIntegral(): Flowable<ResultData<Boolean>> { |
| | | return request().giveIntegral() |
| | | } |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 保存进度 |
| | | */ |
| | | fun exitLearning(answerNumber: Int,correctNumber: Int,day: Int,week: Int,type: Int,teamIds:String,topicIds:String): Flowable<ResultData<Any>> { |
| | | return request().exitLearning(Gson().toJson(ReqSaveProgress(answerNumber,correctNumber,day, week, type, teamIds, topicIds))) |
| | | fun exitLearning(schedule: Int,season: Int,studyTime: Int,answerNumber: Int,correctNumber: Int,day: Int,week: Int,type: Int,teamIds:String,topicIds:String): Flowable<ResultData<Any>> { |
| | | return request().exitLearning(Gson().toJson(ReqSaveProgress(schedule+1,season,answerNumber,correctNumber,day, week, studyTime,type, teamIds, topicIds))) |
| | | } |
| | | |
| | | /** |
| | | * 保存游戏和故事时间 |
| | | */ |
| | | fun exitGameOrStory(studyTime: Int): Flowable<ResultData<Any>> { |
| | | return request().exitGameOrStory(studyTime) |
| | | } |
| | | |
| | | /** |
| | | * 完成学习 |
| | | */ |
| | | fun completeLearning(rate: Int,time: Int,day: Int,week: Int,season: Int,type: Int,teamIds:String): Flowable<ResultData<Any>> { |
| | | fun completeLearning(rate: Int,time: Int,day: Int,week: Int,season: Int,type: Int,teamIds:String): Flowable<ResultData<Int?>> { |
| | | return request().completeLearning(Gson().toJson(ReqFinishStudy(rate,day,season,teamIds,time,type,week))) |
| | | } |
| | | |
| | | /** |
| | | * 完成学习 |
| | | * 完成故事 |
| | | */ |
| | | fun completeStory(rate: Int,type: Int,storyId:String): Flowable<ResultData<Any>> { |
| | | return request().completeStory(Gson().toJson(ReqFinishStory(rate,storyId, type))) |
| | | fun completeStory(rate: Int,type: Int,storyId:String,time: Int): Flowable<ResultData<Int?>> { |
| | | return request().completeStory(rate,storyId, type,time) |
| | | } |
| | | |
| | | /** |
| | | * 完成游戏 |
| | | */ |
| | | fun gameAchievement(rate: Int,difficulty: Int,gameId:String,gameName:String,useTime:Int): Flowable<ResultData<Any>> { |
| | | fun gameAchievement(rate: Int,difficulty: Int,gameId:String,gameName:String,useTime:Int): Flowable<ResultData<Int?>> { |
| | | return request().gameAchievement(Gson().toJson(ReqFinishGame(rate,difficulty,gameId,gameName, useTime))) |
| | | } |
| | | |
| | |
| | | sort, |
| | | page, |
| | | PAGE_SIZE, |
| | | WeparkApplication.lat, |
| | | WeparkApplication.lon, |
| | | DollearnApplication.lat, |
| | | DollearnApplication.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 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>> { |
| | |
| | | * 福利 |
| | | */ |
| | | fun weekLimitedBenefit(type: Int): Flowable<ResultData<ArrayList<Welfare>>> { |
| | | return request().weekLimitedBenefit(type, WeparkApplication.lat, WeparkApplication.lon) |
| | | return request().weekLimitedBenefit(type, DollearnApplication.lat, DollearnApplication.lon) |
| | | } |
| | | |
| | | /** |
| | |
| | | return request().goodDetail(id) |
| | | } |
| | | |
| | | /** |
| | | * 订单详情 |
| | | */ |
| | | fun queryIsBindAlipay(): Flowable<ResultData<Boolean>> { |
| | | return request().queryIsBindAlipay() |
| | | } |
| | | |
| | | /** |
| | | * 兑换记录 |
| | | */ |
| | | fun exchangeRecord(): Flowable<ResultData<List<ExchangeRecord>>> { |
| | | return request().exchangeRecord() |
| | | fun exchangeRecord(page: Int): Flowable<ResultData<ExchangeRecordBean>> { |
| | | return request().exchangeRecord(page) |
| | | } |
| | | |
| | | /** |
| | | * 运动营退款 |
| | | */ |
| | | 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) |
| | | return request().registeredData(DollearnApplication.lat,DollearnApplication.lon,id,orderId) |
| | | } |
| | | |
| | | /** |
| | |
| | | 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, |
| | | DollearnApplication.lat, |
| | | DollearnApplication.lon, |
| | | cityCode, |
| | | distanceSort, |
| | | search) |
| | |
| | | } |
| | | |
| | | /** |
| | | * 获取游戏列表 |
| | | */ |
| | | fun getGameList(url: String): Flowable<ResponseBody> { |
| | | return request().getGameList(url) |
| | | } |
| | | |
| | | /** |
| | | *获取平台配置模块详情【2.0】 |
| | | */ |
| | | fun getHomeModule(): Flowable<ResultData<Banner>> { |
| | |
| | | * 裁判世界杯列表 |
| | | */ |
| | | fun getWorldCupListCoach(storeId: Int?,search: String?): Flowable<ResultData<List<WorldCupBean>>> { |
| | | return request().getWorldCupListCoach(WeparkApplication.lat,WeparkApplication.lon,storeId,search) |
| | | return request().getWorldCupListCoach(DollearnApplication.lat,DollearnApplication.lon,storeId,search) |
| | | } |
| | | |
| | | /** |
| | |
| | | * 世界杯详情 |
| | | */ |
| | | fun getWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> { |
| | | return request().getWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon) |
| | | return request().getWorldCupInfo(id,DollearnApplication.lat, DollearnApplication.lon) |
| | | } |
| | | |
| | | /** |
| | |
| | | * 世界杯报名详情 |
| | | */ |
| | | fun getMyWorldCupInfo(id: String): Flowable<ResultData<WorldCupBean>> { |
| | | return request().getMyWorldCupInfo(id,WeparkApplication.lat, WeparkApplication.lon) |
| | | return request().getMyWorldCupInfo(id,DollearnApplication.lat, DollearnApplication.lon) |
| | | } |
| | | |
| | | /** |