import http from "./http.js";
import config from "./index.config.js";

export const getcureList = (data) => http.POST(`${config.baseUrl}/api/cureList`, data);
// 小程序登录
export const getLogin = (data) => http.POST(`${config.baseUrl}/api/login`, data);
// 获取个人信息
export const getuserinfo = (data) => http.POST(`${config.baseUrl}/api/userInfo`, data);
// 修改个人信息
export const saveuserInfo = (data) => http.POST(`${config.baseUrl}/api/saveInfo`, data);
/*
* 切换身份
* 参数：identity:0普通用户，1咨询师，2机构
*/
export const switchIdentity = (data) => http.POST(`${config.baseUrl}/api/switchIdentity`, data);
/*
* 机构审核
* 参数：certificate (证书图片) nickname
*/
export const submitPushInstitutionReview = (data) => http.POST(`${config.baseUrl}/api/pushInstitutionReview`, data);
/*
* 咨询师审核
* 参数：certificate (证书图片) user_id (机构id)
*/
export const submitPushReview = (data) => http.POST(`${config.baseUrl}/api/pushReview`, data);
/*
* 机构列表
* 参数：page limit
*/
export const getInstitutionList = (data) => http.POST(`${config.baseUrl}/api/getInstitutionList`, data);
/*
* 关注
* 参数：user_id
*/
export const getFocus = (data) => http.POST(`${config.baseUrl}/api/focus`, data);
/*
* 取消关注
* 参数：user_id
*/
export const delFocus = (data) => http.POST(`${config.baseUrl}/api/delFocus`, data);
// 获取价格
export const getPrice = (data) => http.POST(`${config.baseUrl}/api/getPrice`, data);
// 提交化验单
export const submitReview = (data) => http.POST(`${config.baseUrl}/api/review`, data);
// 评测记录
export const getReviewLog = (data) => http.POST(`${config.baseUrl}/api/reviewLog`, data);
// 评测支付
export const reviewPay = (data) => http.POST(`${config.baseUrl}/api/pay`, data);
// 评测结果 参数: log_id
export const getResult = (data) => http.POST(`${config.baseUrl}/api/getResult`, data);

// 最新课程
export const getnewCourse = (data) => http.POST(`${config.baseUrl}/api/newCourse`, data);
// 课程排行
export const getCourseList = (data) => http.POST(`${config.baseUrl}/api/getCourseList`, data);
// 猜你想学
export const getGuessList = (data) => http.POST(`${config.baseUrl}/api/getGuessList`, data);
// 课程筛选
// ### 参数 one_label 1  tow_label 1 
export const getCourseListByLabel = (data) => http.POST(`${config.baseUrl}/api/getCourseListByLabel`, data);
// 课程章节列表
// ### 参数 course_id
export const getCourseChapter = (data) => http.POST(`${config.baseUrl}/api/getCourseChapter`, data);
// 领取
// ### 参数 course_id
export const receive = (data) => http.POST(`${config.baseUrl}/api/receive`, data);
// 课程分类标签
export const labelList = (data) => http.POST(`${config.baseUrl}/api/labelList`, data);
//问答列表
export const problemList = (data) => http.POST(`${config.baseUrl}/api/problemList`, data);
//评论列表
// ### 参数 limit 0  page 1
export const problemRecommend = (data) => http.POST(`${config.baseUrl}/api/problemRecommend`, data);
//评论
// ### 参数 problem_id 1  at_user_id 1
export const recommend = (data) => http.POST(`${config.baseUrl}/api/recommend`, data);
//有用
// ### 参数 problem_id 1
export const useful = (data) => http.POST(`${config.baseUrl}/api/useful`, data);
//提问
// ### 参数 title
export const questioning = (data) => http.POST(`${config.baseUrl}/api/questioning`, data);
//回答
// ### 参数 answer  problem_id 1 
export const reply = (data) => http.POST(`${config.baseUrl}/api/reply`, data);
