import request from '../request'
//金牌车教的open api
const openApi = process.env.NODE_ENV === 'development' ? 'https://nbjk1.zzxcx.net/nbjk-admin/' : 'https://nbjk1.zzxcx.net/nbjk-admin/'
const open = {
    //open-api/teachingVideo/info/treeList
    //获取免费的题库(旧)
    questionInfoSelectFreeQuestionInfo(params) {
        return request({
            url: openApi + "/open-api/question/info/selectFreeQuestionInfo",
            params
        })
    },
    //获取免费的题库(新)
    question2InfoSelectFreeQuestionInfo(params) {
        return request({
            url: openApi + "/open-api/question2/info/selectFreeQuestionInfo",
            params
        })


    },
    //获取视频列表
    teachingVideoInfoTreeList(params) {
        return request({
            url: "open-api/teachingVideo/info/treeList",
            params
        })

    },
    questionInfoSelectTestK14QuestionInfoList(params) {
        return request({
            url: `${openApi}/open-api/question/info/selectTestK14QuestionInfoList`,
            method: "GET",
            params
        })

    },
    lightingCombinationList() {
        return request({
            url: `${openApi}/open-api/lighting/combination/list`,
            method: "GET"
        })
    },
    lightingCombinationId(id) {
        return request({
            url: `${openApi}/open-api/lighting/combination/` + id,
            method: "GET",
        })
    },
    lightingItemList() {
        return request({
            url: `${openApi}/open-api/lighting/item/list`,
            method: "GET",
        })
    },
    //批量取题
    questionInfoGetQuestionInfoByIds(params) {
        return request({
            url: "/question/info/getQuestionInfoByIds",
            params
        })
    },
    //根据字典类型查询字典数据信息
    systemDictDataType(dictType) {
        return request({
            url: "open-api/system/dict/data/type/" + dictType
        })

    },
    //根据参数键名查询参数值
    systemDictDataConfigKey(configKey) {
        return request({
            url: "open-api/system/dict/data/configKey/" + configKey
        })

    },
    //八字结果
    openApiGanZhiGet8ziByDate(params) {
        // console.log('params',params)
        // params.birthday = encodeURIComponent(params.birthday)
        return request({
            url: "https://xpgx1.zzxcx.net/xpgx-admin/open-api/gan/zhi/get8ziByDate",
            method: 'get',
            params,
            headers: {
                'Content-Type': 'text/plain;charset=UTF-8'

            },
        })

    }
}
export default open