import request from '@/utils/request'
import Qs from 'qs'

export function listGoods(query) {
    return request({
        url: '/goods/list',
        method: 'get',
        params: query
    })
}

export function listGoods3(query) {
    return request({
        url: '/goods/list23',
        method: 'get',
        params: query
    })
}

export function deleteGoods(data) {
    return request({
        url: '/goods/delete',
        method: 'post',
        data
    })
}

export function publishGoods(data) {
    return request({
        url: '/goods/create',
        method: 'post',
        data
    })
}

// 商品上架按钮
export function onsale(data) {
    return request({
        url: '/goods/onsale',
        method: 'post',
        data
    })
}
// 商品热卖
export function onhot(data) {
    return request({
        url: '/goods/onhot',
        method: 'post',
        data
    })
}
// 商品新品
export function onnew(data) {
    return request({
        url: '/goods/onnew',
        method: 'post',
        data
    })
}
// 隐藏
export function onhide(data) {
    return request({
        url: '/goods/onhide',
        method: 'post',
        data
    })
}
export function detailGoods(id) {
    return request({
        url: '/goods/detail',
        method: 'get',
        params: { id }
    })
}

export function editGoods(data) {
    return request({
        url: '/goods/update',
        method: 'post',
        data
    })
}

export function listCatAndBrand() {
    return request({
        url: '/goods/catAndBrand',
        method: 'get'
    })
}


export function getSkills() {
    return request({
        url: '/goods/skills',
        method: 'get'
    })
}

export function getShop(query) {
    return request({
        url: '/goods/shop',
        method: 'get',
        params: query,
        paramsSerializer: function (params) {
            return Qs.stringify(params, { arrayFormat: 'repeat' })
        }
    })
}

export function getDyShop(query) {
    return request({
        url: '/goods/queryDyShop',
        method: 'get',
        params: query
    })
}

export function getStatisticsCategory() {
    return request({
        url: '/statisticsCategory/category',
        method: 'get'
    })
}

export function goodsExternalList(query) {
    return request({
        url: '/goodsExternal/list',
        method: 'get',
        params: query,
        paramsSerializer: function (params) {
            return Qs.stringify(params, { arrayFormat: 'repeat' })
        }
    })
}

export function goodsExternalDel(data) {
    return request({
        url: '/goodsExternal/delete',
        method: 'get',
        params: data
    })
}
export function goodsExternalInsert(data) {
    return request({
        url: '/goodsExternal/insert',
        method: 'post',
        data
    })
}
export function sync2Douyin(data) {
    return request({
        url: '/goods/sync2Douyin',
        method: 'get',
        params: data,
        paramsSerializer: function (params) {
            return Qs.stringify(params, { arrayFormat: 'repeat' })
        }

    })
}
export function updateGoodsInfo(data) {
    return request({
        url: '/goodsExternal/updateGoodsInfo',
        method: 'get',
        params: data

    })
}
export function operGoodsStatus(data) {
    return request({
        url: '/goodsExternal/operGoodsStatus',
        method: 'get',
        params: data

    })
}
export function auditList(data) {
    return request({
        url: '/goods/auditList',
        method: 'get',
        params: data

    })
}
export function goodsAudit(data) {
    return request({
        url: '/goods/audit',
        method: 'get',
        params: data

    })
}


export function goodsDYQrcode(query) {
    return request({
        url: '/goodsExternal/qrCode',
        method: 'get',
        params: query,
    })
}


export function getChannelCitys() {
    return request({
        url: '/goods/channelCitys',
        method: 'get'
    })
}

export function dyGoods(data) {
    return request({
        url: '/goods/dy',
        method: 'post',
        data
    })
}


//获取抖音短链
export function dyUrl(query) {
    return request({
        url: '/goods/dyUrl',
        method: 'get',
        params: query
    })
}

export function getFeeList(query) {
    return request({
        url: '/goodsServiceFee/getFeeList',
        method: 'get',
        params: query,
    })
}

export function addFee(data) {
    return request({
        url: '/goodsServiceFee/addFee',
        method: 'post',
        data
    })
}
export function batchCopy(data) {
    return request({
        url: '/goodsServiceFee/batchCopy',
        method: 'post',
        data
    })
}
export function updateFee(data) {
    return request({
        url: '/goodsServiceFee/updateFee',
        method: 'post',
        data
    })
}
export function deleteFee(query) {
    return request({
        url: '/goodsServiceFee/delete',
        method: 'get',
        params: query,

    })
}
export function getProduct(query) {
    return request({
        url: '/goods/getProduct',
        method: 'get',
        params: query,

    })
}
export function liveGetGoodsList(query) {
    return request({
        url: '/localLive/getGoodsList',
        method: 'get',
        params: query,

    })
}
export function liveAddLocalLiveGoods(data) {
    return request({
        url: '/localLive/addLocalLiveGoods',
        method: 'post',
        data,

    })
}
export function liveUpdateLiveGoods(data) {
    return request({
        url: '/localLive/updateLiveGoods',
        method: 'post',
        data,

    })
}
export function liveGetGoodsProduct(query) {
    return request({
        url: '/localLive/getGoodsProduct',
        method: 'get',
        params: query,

    })
}
export function liveRefreshStatus(query) {
    return request({
        url: '/localLive/refreshStatus',
        method: 'get',
        params: query,

    })
}
export function liveSpuListing(query) {
    return request({
        url: '/localLive/spuListing',
        method: 'get',
        params: query,

    })
}
export function liveDelete(query) {
    return request({
        url: '/localLive/delete',
        method: 'get',
        params: query,

    })
}
export function getGoodsTip(query) {
    return request({
        url: '/goods/getGoodsTip',
        method: 'get',
        params: query,

    })
}

export function getDiffDictList(query) {
  return request({
    url: '/goods/getDiffDictList',
    method: 'get',
    params: query

  })
}

export function goodsChannelQrCode(data) {
    return request({
        url: '/goods/goodsChannelQrCode',
        method: 'get',
        params: data
    })
}

export function deleteGoodsProduct(data) {
    return request({
        url: '/goods/deleteGoodsProduct',
        method: 'get',
        params: data
    })
}
