123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- import efunRequest from '../util/efunRequest';
- import APIConfig from '../res/values/api.json';
- function genLessonAPIUrl(path) {
- return APIConfig.course_api_url + path;
- }
- export default class matchApi {
-
- static getRaceAll(grade) {
- return efunRequest.getHttpRequest().params({
- grade
- }).url(genLessonAPIUrl('kt/race/all')).get();
- }
-
- static getMyRace(grade) {
- return efunRequest.getHttpRequest().params({
- grade
- }).url(genLessonAPIUrl('kt/race/my')).get();
- }
-
- static getRaceInfo(raceId) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/race/info')).params({
- raceId
- }).get();
- }
-
- static postQuestion(data) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/question')).data(data).post();
- }
-
- static postQuestionSubmit(data) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/question/submit')).data(data).post();
- }
-
- static postSubscribe(data) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/subscribe')).data(data).post();
- }
-
- static getRankingList(grade) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/race/rankingList')).params({
- grade,
- pageSize: 99999
- }).get();
- }
-
- static getRaceRanking(raceId, grade) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/race/raceRanking')).params({
- raceId,
- grade,
- pageSize: 99999
- }).get();
- }
-
- static getNewMistake(data) {
- return efunRequest.getHttpRequest().params(data).url(genLessonAPIUrl('kt/question/mistakeBook')).get();
- }
-
- static getRaceJoin(raceId) {
- return efunRequest.getHttpRequest().url(genLessonAPIUrl('kt/race/join')).params({
- raceId
- }).get();
- }
- }
|