const request = require('./WXHttpRequest.js'); const url = require('./const.js'); const HOST = url.apiUrl; function genAPIUrl(action) { return HOST + action; } module.exports = { // 获取我的data getMySchedule(header) { let url = genAPIUrl('wx/ucenter'); return request.getInstance().url(url).header(header).send(); }, //获取推荐课程 getRecommendSchedule(header) { let url = genAPIUrl('wx/course/recommend'); return request.getInstance().url(url).header(header).send(); }, //发送上传图片 getSendSchedule(header, data) { let url = genAPIUrl('wx/posts'); return request.getInstance().url(url).header(header).data(data).method('POST').send(); }, //获取分享作品list getProductionSchedule(header, data) { let url = genAPIUrl('wx/posts/reply'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //保存评论 getDiscussSchedule(header, data) { let url = genAPIUrl('wx/reply'); return request.getInstance().url(url).header(header).data(data).method('POST').send(); }, //分享查询单条 getOneSchedule(header, data) { let url = genAPIUrl('wx/posts/one'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //各个科目信息 getEachSchedule(header, data) { let url = genAPIUrl('wx/course'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //各个排名 getFriendSchedule(urls, header) { let url = genAPIUrl(urls); return request.getInstance().url(url).header(header).method('GET').send(); }, //更改昵称 getSetNameSchedule(header, data) { let url = genAPIUrl('wx/ucenter/user/update'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //分享后点赞 getLikeSchedule(header, data) { let url = genAPIUrl('wx/posts/attribute'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //取消小点 cancelDian(header, data) { let url = genAPIUrl('wx/posts/readCount'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); }, //获取错题本 getErrorsSchedule(header, data) { let url = genAPIUrl('wx/question/wrong'); return request.getInstance().url(url).header(header).data(data).method('GET').send(); } }