import Request from '../common/request.js';
let request = new Request().http
 
 //获取是否收藏
 export function checkFavorite(courseId) {
 	 return request('/app/course/checkFavorite?courseId='+courseId,null,'GET');
 }
 
 //获取是否关注
 export function checkFollow(talentId) { 
 	 return request('/app/talent/checkFollow?talentId='+talentId,null,'GET');
 }
 
 //获取是否点赞
 export function checkLike(courseId) {
 	 return request('/app/course/checkLike?courseId='+courseId,null,'GET');
 }
 
 //收藏
 export function doFavorite(courseId) {
	 const data={"courseId":courseId};
 	 return request('/app/course/doFavorite',data,'POST','application/json;charset=UTF-8');
 }
 
 //关注
 export function doFollow(talentId) {
	 const data={"talentId":talentId};
 	 return request('/app/talent/doFollow',data,'POST','application/json;charset=UTF-8');
 }
 
 //点赞
 export function doLike(courseId) {
	  const data={"courseId":courseId};
 	 return request('/app/course/doLike',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //获取课程详情
 export function getCourseById(courseId) {
 	 return request('/app/course/getCourseById?courseId='+courseId,null,'GET');
 }
 
 //获取课程分类
 export function getCourseCate() {
 	 return request('/app/course/getCourseCate',null,'GET');
 }
 
 
 //获取课程简介
 export function getCourseDescription(courseId) {
 	 return request('/app/course/getCourseDescription?courseId='+courseId,null,'GET');
 }
 
 

 
 //课程列表
 export function getCourseList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/getCourseList',data,'GET');
 }
 
 //获取在学课程
 export function getCourseStudyList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/getCourseStudyList',data,'GET');
 }
 
 //获取课程目录
 export function getCourseVideoList(parmars,page = 1, size = 20) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/getCourseVideoList',data,'GET');
 }
 
 //获取收藏课程
 export function getMyFavoriteCourseList(parmars,page = 1, size = 100) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/getMyFavoriteCourseList',data,'GET');
 }
 
 //获取子分类
 export function getProductCateByPid(pid) {
 	 return request('/app/course/getProductCateByPid?pid='+pid,null,'GET');
 }
 
 //分享课程
 export function shareCourse(courseId) {
 	 return request('/app/course/shareCourse?courseId='+courseId,null,'GET');
 }
 
 
 //添加笔记
 export function addCourseNote(data) {
 	 return request('/app/course/note/addCourseNote',data,'POST','application/json;charset=UTF-8');
 }
 
 
 
 //点赞
 export function noteDoLike(data) {
 	 return request('/app/course/note/doLike',data,'POST','application/json;charset=UTF-8');
 }
 
 //编辑笔记
 export function editCourseNote(data) {
 	 return request('/app/course/note/editCourseNote',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //删除笔记
 export function delCourseNote(data) {
 	 return request('/app/course/note/delCourseNote',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //课堂笔记列表
 export function getCourseNoteList(parmars,page = 1, size = 10) {
    let data = {"pageNum":page,"pageSize":size};
    data=Object.assign(parmars, data);
    return request('/app/course/note/getCourseNoteList',data,'GET');
 }
 
 
 //课堂笔记详情
 export function getMyCourseNoteByNoteId(noteId) {
 	 return request('/app/course/note/getMyCourseNoteByNoteId?noteId='+noteId,null,'GET');
 }
 
 //我的笔记列表
 export function getMyCourseNoteList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/note/getMyCourseNoteList',data,'GET');
 }
 

 //新增课堂评论
 export function addComment(data) {
 	 return request('/app/course/comment/addComment',data,'POST','application/json;charset=UTF-8');
 }
 
 //修改课堂评论
 export function updateComment(data) {
 	 return request('/app/course/comment',data,'PUT','application/json;charset=UTF-8');
 }
 
 //删除课堂评论
 export function deleteComment(commentId) {
 	 return request('/app/course/comment/'+commentId,null,'DELETE','application/json;charset=UTF-8');
 }
 
 
 //点赞
 export function commentDoLike(data) {
 	 return request('/app/course/comment/doLike',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //课堂课堂评论
 export function getCommentList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/comment/list',data,'GET');
 }
 
 
 //我的评论
 export function getMyCommentList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/course/comment/myList',data,'GET');
 }


 //创建在学课程
 export function addDuration(data) {
 	 return request('/app/course/addStudyCourse',data,'POST','application/json;charset=UTF-8');
 }
 
 //笔记转存
 export function saveNote(data) {
 	 return request('/app/course/note/save',data,'POST','application/json;charset=UTF-8');
 }
 

 
 //创建课程订单
 export function createCourseOrder(data) {
 	 return request('/app/courseOrder/createOrder',data,'POST','application/json;charset=UTF-8');
 }
 
 //创建课程订单
 export function createIntegralOrder(data) {
 	 return request('/app/courseOrder/createIntegralOrder',data,'POST','application/json;charset=UTF-8');
 }
 
 
 
 //课程微信支付
 export function wxPayment(data) {
 	 return request('/app/courseOrder/wxpayment',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //课程支付宝支付
 export function aliPayment(data) {
  	return request('/app/courseOrder/aliPayment',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //vip套餐列表
 export function getPackageList(data) {
 	 return request('/app/userVip/getPackageList',null,'GET');
 }
 
 
 
 //创建Vip订单
 export function createVipOrder(data) {
 	 return request('/app/userVip/createOrder',data,'POST','application/json;charset=UTF-8');
 }
 
 
 //会员支付宝支付
 export function vipZfbPayment(data) {
  	return request('/app/userVip/aliPayment',data,'POST','application/json;charset=UTF-8');
 }
 
 //会员支付宝支付
 export function getIntegral(data) {
  	return request('/app/course/getIntegral',data,'POST','application/json;charset=UTF-8');
 }
 
 
 
 //获取订单列表
 export function getCourseOrderList(parmars,page = 1, size = 10) {
   let data = {"pageNum":page,"pageSize":size};
   data=Object.assign(parmars, data);
   return request('/app/courseOrder/getCourseOrderList',data,'GET');
 }
 
 //获取Vip订单详情
 export function getVipOrderById(orderId) {
 	 return request('/app/userVip/getVipOrderById?orderId='+orderId,null,'GET');
 }
 
 //获取订单详情
 export function getCourseOrderById(orderId) {
 	 return request('/app/courseOrder/getCourseOrderById?orderId='+orderId,null,'GET');
 }
 