import request from './request'

/**
 * 获取配置值
 * @param {string} key - 配置的key
 * @returns {Promise<{success: boolean, data: string}>}
 */
export const getConfig = (key) => {
  return request({
    url: '/Config/GetConfig',
    method: 'get',
    params: { key }
  })
}

/**
 * 设置配置值
 * @param {string} key - 配置的key
 * @param {string} value - 配置的值
 * @returns {Promise<{success: boolean}>}
 */
export const setConfig = (key, value) => {
  return request({
    url: '/Config/SetConfig',
    method: 'post',
    params: { key, value }
  })
}
