import http from '@/axios'
import { ConfigBO, ConfigQuery, ConfigVO } from '@/api/interface/system/config'

class ConfigApi {
  /**
   * @name 查询分页
   * @returns returns
   */
  static page = (params: ConfigQuery): Promise<ResultData<any>> => {
    return http.get<ConfigVO>({ url: '/system/config/page', params })
  }

  /**
   * @name 查询列表
   * @returns returns
   */
  static list = (params: ConfigBO): Promise<ResultData<any>> => {
    return http.get<ConfigVO>({ url: '/system/config/list', params })
  }

  /**
   * @name 添加
   * @returns returns
   */
  static add = (data: ConfigBO): Promise<ResultData<any>> => {
    return http.post({ url: '/system/config/add', data })
  }
  /**
   * @name 更新
   * @returns returns
   */
  static edit = (data: ConfigBO): Promise<ResultData<any>> => {
    return http.put({ url: '/system/config/edit', data })
  }

  /**
   * @name 删除
   * @returns returns
   */
  static delete = (data: string[]): Promise<ResultData<any>> => {
    return http.delete({ url: '/system/config/delete', data })
  }
}
export default ConfigApi
