/**
 * 命名=》API_xxx_methodName
 */

import { request } from '../request'
export default {
  API_DICT_GET(dictType) {
    return request({
      url: '/system/dict/data/type/' + dictType
    })
  },

  API_EVENT_LIST(params = {}) {
    return request({
      url: '/system/event/list',
      method: 'get',
      params
    })
  },
  API_EVENT_GET(id) {
    return request({
      url: '/system/event/' + id,
      method: 'get'
    })
  },
  API_EVENT_UPDATE(data) {
    return request({
      url: '/system/event',
      method: 'put',
      data
    })
  },
  API_EVENT_GEN(id) {
    return request({
      url: `/system/event/generate/${id}`,
      method: 'post'
    })
  },
  // 根据参数键名查询参数值
  API_CONFIG_GET(configKey) {
    return request({
      url: '/system/config/configKey/' + configKey,
      method: 'get'
    })
  },
  API_CONFIG_UPDATE(key, value) {
    return request({
      url: '/system/config/updateByKey',
      method: 'put',
      data: {
        configKey: key,
        configValue: value
      }
    })
  }
}
