import request from "@/utils/request";
const { api } = process.env.CONFIG;

/**
 * 新增人群包
 * @param data 
 * @returns 
 */
export async function addSiftPopulationConfigApi(data: BUSINES_SPLAN_API.SiftPopulationConfigProps) {
    return request({
        url: api + `/corpOperation/siftPopulationConfig/add`,
        method: 'POST', 
        data 
    });
}

/**
 * 修改人群包
 * @param data 
 * @returns 
 */
export async function updateSiftPopulationConfigApi(data: BUSINES_SPLAN_API.SiftPopulationConfigProps) {
    return request({
        url: api + `/corpOperation/siftPopulationConfig/update`,
        method: 'POST', 
        data 
    });
}

/**
 * 删除人群包
 * @param id 
 * @returns 
 */
export async function delSiftPopulationConfigApi(id: number) {
    return request({
        url: api + `/corpOperation/siftPopulationConfig/delete/${id}`,
        method: 'DELETE'
    });
}

/**
 * 获取人群包
 * @param data 
 * @returns 
 */
export async function getSiftPopulationConfigApi(data: BUSINES_SPLAN_API.GetSiftPopulationConfigProps) {
    return request({
        url: api + `/corpOperation/siftPopulationConfig/pageOfList`,
        method: 'POST', 
        data 
    });
}

/**
 * 详情
 * @param id 
 * @returns 
 */
export async function getSiftPopulationConfigDetailsApi(id: number) {
    return request({
        url: api + `/corpOperation/siftPopulationConfig/getOneById/${id}`,
        method: 'GET'
    });
}