import service from '@/utils/service'

const baseUrl = process.env.VUE_APP_HOST + '/manager/api';

const giftListApi = {};

giftListApi.baseUrl = baseUrl;



giftListApi.getGameList = () => {
    return service({
        url: `${baseUrl}/gift/v1/game`,
        method: 'get',
    })
};
giftListApi.getGiftList = params => {
    return service({
        url: `${baseUrl}/gift/v1/page`,
        method: 'get',
        params: params
    })
};
giftListApi.addGift = data => {
    return service({
        url: `${baseUrl}/gift/v1/insert`,
        method: 'post',
        data: data
    })
};
giftListApi.updateGift = data =>{
    return service({
        url: `${baseUrl}/gift/v1`,
        method: 'put',
        data: data
    })
}

giftListApi.getGiftById = id => {
    return service({
        url: `${baseUrl}/gift/v1/${id}`,
        method: 'get',
    })
};
giftListApi.deleteGift = id =>{
    return service({
        url: `${baseUrl}/gift/v1`,
        method: 'put',
        data:{
            id,
            deleted : 1
        }
    })
};


giftListApi.getGiftGameList = () =>{
    return service({
        url: `${baseUrl}/giftCode/v1/game`,
        method: 'get',
    })
};
giftListApi.getGiftCodeList = params =>{
    return service({
        url: `${baseUrl}/giftCode/v1/page`,
        method: 'get',
        params:params
    })
};
giftListApi.getGiftCodeById = id =>{
    return service({
        url: `${baseUrl}/giftCode/v1/${id}`,
        method: 'get',
    })
};
giftListApi.updateGiftCode = data =>{
    return service({
        url: `${baseUrl}/giftCode/v1`,
        method: 'put',
        data:data
    })
};
giftListApi.deleteGiftCode = id =>{
    return service({
        url: `${baseUrl}/giftCode/v1`,
        method: 'put',
        data:{
            id,
            deleted:1
        }
    })
};
giftListApi.addGiftCode = data => {
    return service({
        url: `${baseUrl}/giftCode/v1/insert`,
        method: 'post',
        data: data
    })
};



export default giftListApi
