import request from '@/utils/request';
//


// 这个是资格考试的借口

var host ="http://www.xinsiketang.com"
host =""

var prefix = '/app_dev.php/api';
if (1) //线上黄精
{
  prefix =host+'/api';

}


// 书籍信息
var bookinfo ={
  category : (params) =>{
    return request({
      url: `${prefix}/smile/local_view_catalog`,
      method: 'GET',
      data: params,
    }) 
  },
  detail : (params) =>{
    return request({
      url: `${prefix}/smile/local_view_detail`,
      method: 'GET',
      data: params,
    }) 
  }, 
  data : (params) =>{
    return request({
      url: `${prefix}/smile/local_view_data`,
      method: 'GET',
      data: params,
    }) 
  },  
}

// 笔记

var note = {
  list : (params) =>{
    return request({
      url: `${prefix}/smile/listNote`,
      method: 'GET',
      data: params,
    }) 
  },


  add : (params) =>{
    return request({
      url: `${prefix}/smile/addNote`,
      method: 'POST',
      data: params,
    }) 
  },

  edit : (params) =>{
    return request({
      url: `${prefix}/smile/editNote`,
      method: 'POST',
      data: params,
    }) 
  },

  delete : (params) =>{
    return request({
      url: `${prefix}/smile/deleteNote`,
      method: 'POST',
      data: params,
    }) 
  },


}

// 书签

var bookmark = {
  list : (params) =>{
    return request({
      url: `${prefix}/smile/bookmark/list`,
      method: 'GET',
      data: params,
    }) 
  },


  add : (params) =>{
    return request({
      url: `${prefix}/smile/bookmark/store`,
      method: 'POST',
      data: params,
    }) 
  },

  edit : (params) =>{
    return request({
      url: `${prefix}/smile/bookmark/edit`,
      method: 'POST',
      data: params,
    }) 
  },

  delete : (params) =>{
    return request({
      url: `${prefix}/smile/bookmark/del`,
      method: 'POST',
      data: params,
    }) 
  },


}


// 高亮

var highlight = {
  list : (params) =>{
    return request({
      url: `${prefix}/smile/highlightList`,
      method: 'GET',
      data: params,
    }) 
  },


  add : (params) =>{
    return request({
      url: `${prefix}/smile/addHighlight`,
      method: 'POST',
      data: params,
    }) 
  },

  delete : (params) =>{
    return request({
      url: `${prefix}/smile/deleteHighlight`,
      method: 'POST',
      data: params,
    }) 
  },


}

// 授课
var resource ={
  list : (params) =>{
    return request({
      url: `${prefix}/smile/resourcesList`,
      method: 'GET',
      data: params,
    }) 
  },


  add : (params) =>{
    return request({
      url: `${prefix}/smile/addResources`,
      method: 'POST',
      data: params,
    }) 
  },

  edit : (params) =>{
    return request({
      url: `${prefix}/smile/editResources`,
      method: 'POST',
      data: params,
    }) 
  },

  delete : (params) =>{
    return request({
      url: `${prefix}/smile/deleteResource`,
      method: 'POST',
      data: params,
    }) 
  },

  downloadFile: (params) =>{
    return request({
      url: `${prefix}/smile/downloadFile`,
      method: 'POST',
      data: params,
    })  
  }

}

// 存储用户的一些数据
var userAction = {
  //更新阅读进度
  updateReadLocation : (params) =>{
    return request({
      url: `${prefix}/smile/updateReadLocation`,
      method: 'POST',
      data: params,
    }) 
  },
    //更新阅读进度
    getReadLocation : (params) =>{
      return request({
        url: `${prefix}/smile/getReadLocation`,
        method: 'GET',
        data: params,
      }) 
    },  

}



export var bookApi ={
    bookinfo,
    note,
    bookmark,
    highlight,
    resource,
    userAction
}





// htzgks/get_qualification_list
