lmw
2024-06-16 03172fc2d9a7717f4a9d8de1c5eca3158a550b30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
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)
    }
}