import request from '@/utils/request'


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

export function list(data) {
    return request({
        url: '/system/goods/list',
        method: 'post',
        params: {pageNum: data.pageNum, pageSize: data.pageSize},
        data
    })
}

export function remove(goodsId) {
    return request({
        url: '/system/goods/remove',
        method: 'get',
        params: {goodsId}
    })
}

export function onShelf(goodsId) {
    return request({
        url: '/system/goods/onShelf',
        method: 'get',
        params: {goodsId}
    })
}

export function offShelf(goodsId) {
    return request({
        url: '/system/goods/offShelf',
        method: 'get',
        params: {goodsId}
    })
}

export function detail(goodsId) {
    return request({
        url: '/system/goods/detail',
        method: 'get',
        params: {goodsId}
    })
}

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

// 新增团购服务
export function saveGroupGoods(data) {
    return request({
        url: '/system/goods/saveGroupGoods',
        method: 'post',
        data: data
    })
}

// 查询团购服务分页列表
export function listGroupGoods(params) {
    return request({
        url: '/system/goods/listGroupGoods',
        method: 'get',
        params
    })
}

// 查询团购服务详情
export function getGroupGoodsDetail(goodsId) {
    return request({
        url: '/system/goods/getGroupGoodsDetail',
        method: 'get',
        params: {goodsId}
    })
}

// 上架团购服务
export function onShelfGroup(data) {
    return request({
        url: '/system/goods/onShelfGroup',
        method: 'post',
        data: data
    })
}