import request from '@/utils/request' //引入axios请求及拦截器
export default {
    //新增商品
    addGoods(data) {
        return request({
            url: '/goods',
            method: 'post',
            data
        })
    },
    //修改商品
    editGoods(data) {
        return request({
            url: '/goods/edit',
            method: 'post',
            data
        })
    },
    //新增题库商品
    addGoodsbank(data) {
        return request({
            url: '/goods/bank',
            method: 'post',
            data
        })
    },
    //修改题库商品
    editGoodsbank(data) {
        return request({
            url: '/goods/bank/edit',
            method: 'post',
            data
        })
    },
    //查询商品题库列表
    inquireGoodsbanklist(data) {
        return request({
            url: '/goods/bank/list',
            method: 'get',
            params: data
        })
    },
    // 获取题库商品每日一练试卷列表
    getBankGoodsExamList(id) {
        return request({
            url: '/goods/getBankGoodsExamList/'+id,
            method: 'get',
        })
    },
    
    //查询前培或补考商品列表
    inquireGoodslistGoods(data) {
        return request({
            url: '/goods/listGoods',
            method: 'get',
            params: data
        })
    },
    //查询商品列表
    inquireGoods(data) {
        return request({
            url: '/goods/list',
            method: 'get',
            params: data
        })
    },
    //获取商品详细信息
    obtainGoods(data) {
        return request({
            url: `/goods/` + data,
            method: 'get',
        })
    },
    //新增补考商品
    addGoodsmake(data) {
        return request({
            url: '/goods/make',
            method: 'post',
            data
        })
    },
    //修改补考商品
    editGoodsmake(data) {
        return request({
            url: '/goods/make/edit',
            method: 'post',
            data
        })
    },
    //新增前培商品
    addGoodsfront(data) {
        return request({
            url: '/goods/front',
            method: 'post',
            data
        })
    },
    //修改前培商品
    editGoodsfront(data) {
        return request({
            url: '/goods/front/edit',
            method: 'post',
            data
        })
    },
    //查询编辑数据是否有用户通过学时
    gradecheckGoodsChange(data) {
        return request({
            url: '/grade/grade/checkGoodsStudy',
            method: 'get',
            params: data
        })
    },
    //查询免费题库商品列表
    inquiregoodslistFreeGoodsList(data) {
        return request({
            url: '/goods/listFreeGoodsList',
            method: 'get',
            params: data
        })
    },
    //查询用户题库商品列表
    inquiregoodslistBankGoodsList(data) {
        return request({
            url: '/goods/listBankGoodsList',
            method: 'get',
            params: data
        })
    },
    //导出直播商品列表
    inquiregoodslistBankexport_list(data) {
        return request({
            url: '/goods/export_list',
            method: 'get',
            params: data
        })
    },
    //商品专题页查询
    inquirecoursetopiclist(data) {
        return request({
            url: '/course/topic/list',
            method: 'get',
            params: data
        })
    },
}