import ajax from "@/libs/Ajax";

// 后台命名空间
const NAME_SPACE = "/SysQueryController";

export default {
  doQuery(params) {
    return ajax.get(`${NAME_SPACE}/query`, {params})
  },
  doGet(uuid) {
    return ajax.get(`${NAME_SPACE}/get/${uuid}`)
  },
  doDelete(uuid) {
    return ajax.delete(`${NAME_SPACE}/delete/${uuid}`)
  },
  doSave(data) {
    return ajax.post(`${NAME_SPACE}/save`, data)
  },
  // 获取所有查询列
  listColumns(querySql) {
    return ajax.post(`${NAME_SPACE}/listColumns`, {querySql})
  },
  // 加载查询视图
  loadViewJson(uuid) {
    return ajax.get(`${NAME_SPACE}/loadViewJson`, {params: {uuid}})
  },
  //执行查询
  executeQuery(uuid, params) {
    return ajax.get(`${NAME_SPACE}/${uuid}/executeQuery`, {params})
  }
};
