import http from "@/util/http.js";

// 团购管理列表
export function groupList(params) {
    return http({
        url: "/api/group",
        method: "get",
        params
    });
}

// 新增
export function addGroup(data) {
    return http({
        url: "/api/group",
        method: "post",
        data,
    });
}

// 查看
export function showGroup(id) {
    return http({
        url: `/api/group/${id}`,
        method: "get",
    });
}

// 编辑
export function editGroup(id, data) {
    return http({
        url: `/api/group/${id}`,
        method: "patch",
        data,
    });
}

// 获取团购商品列表
export function getGroupGoods(params) {
    return http({
        url: `/api/groupGoods`,
        method: "get",
        params,
    });
}

// 增加团购商品
export function addGroupGoods(params) {
    return http({
        url: `/api/groupGoods`,
        method: "post",
        params,
    });
}
