import RequestManager from '../request';


/**
 * 获取系统配置
 * @returns 
 */
export const getConfig = () => {
    return RequestManager.get("config", {});
}

/**
 * 获取平台配置
 * @returns 
 */
export const getPlatform = async () => {
    const res = await RequestManager.get("getPlatformConfig", {});
    return res.data;
}

/**
 * 获取轮播图
 * @param {number} type_id 类型
 * @returns 
 */
export const getAdvert = async (type_id) => {
    const res = await RequestManager.getCache("getAdvert", { type_id });
    return res.data;
}

/**
 * 获取单页规则
 * @param {number} type 类型
 * @returns 
 */
export const getDanYe = async (type) => {
    const res = await RequestManager.getCache("getDanye", { type });
    return res.data;
}

/**
 * 获取单页内容（POST方式）
 * @param {number} type 类型
 * @returns 
 */
export const getDanYeContent = async (type) => {
    return await RequestManager.getCache('/danye', { type });
}

/**
 * 获取悬浮球配置列表
 * @returns {Promise} 悬浮球配置列表
 */
export const getFloatBall = async () => {
    const res = await RequestManager.get("getFloatBall", {});
    return res.data || [];
}
