/**
 * 收藏相关接口
 */
import request from '@/utils/request'
import qs from 'qs'
const baseUrl = '/v1/api'

//用户点击收藏
export const collect = params => {
    return request({
        url: baseUrl + '/user/collect',
        method: 'post',
        params
    })
}
// 获取我的收藏列表
export const getCollect = params => {
    return request({
        url: baseUrl + '/user/collect/mine',
        method: 'get',
        params
    })
}

// 点击添加收藏
export const addFavorite = data => {
    return request({
        url: baseUrl + '/folder/file/addFavorite',
        method: 'post',
        data: qs.stringify(data),
        headers: { 'content-type': 'application/x-www-form-urlencoded' }
    })
}


// 取消收藏
export const cancelCollect = params => {
    return request({
        url: baseUrl + '/folder/file/removeFavorite',
        method: 'get',
        params
    })
}
