import request from '@/utils/request'

//* *********** 通用接口 **************
// 查询列表
export function _list(data) {
  return request({
    url: '/api/query/list',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}


export function _list_get(data) {
  return request({
    url: '/api/query/list',
    method: 'get',
    params: {
      ...data
    },
  })
}

// 查询详情
export function _view(data) {
  return request({
    url: '/api/query/view',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 导出xls文件
export function _export(data) {
  return request({
    url: '/api/Export',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 添加数据
export function _add(data) {
  return request({
    url: '/api/add',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 批量添加
export function _adds(data) {
  return request({
    url: '/api/adds',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 更新数据
export function _up(data) {
  return request({
    url: '/api/up',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 批量更新
export function _ups(data) {
  return request({
    url: '/api/ups',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 删除
export function _del(data) {
  return request({
    url: '/api/del',
    method: 'post',
    data,
    params: {
      pagevalue: data.pagevalue,
    },
  })
}

// 添加图片并返回id
export function _addimg(data) {
  return request({
    url: '/api/attachment/addimg',
    method: 'post',
    data,
    params: {
      pagevalue: '82',
    },
    headers: { 'Content-Type': 'multipart/form-data' },
  })
}

// 申请组织 - 废弃
export function organizationtreeList(data) {
  return request({
    url: '/api/organizationtree',
    method: 'post',
    data,
    params: {
      pagevalue: 231,
    },
  })
}

// 初始化数据库
export function installShuJu(data) {
  return request({
    url: '/api/sys/initialize',
    method: 'get',
    data,
  })
}


// 微信菜单配置 
//商户获取微信菜单-列表
export function admin_sh_wxmenu_list(params) {
  return request({
    url: '/api/query/list?pagevalue=142',
    method: 'post',
    data: params
  });
}
//商户获取微信菜单-详情
export function admin_sh_wxmenu_detail(params) {
  return request({
    url: '/api/query/view?pagevalue=143',
    method: 'post',
    data: params
  });
}

//商户获取微信菜单-新增
export function admin_sh_wxmenu_add(params) {
  return request({
    url: '/api/wx/wxmenu/add?pagevalue=144',
    method: 'post',
    data: params
  });
}

//商户获取微信菜单-删除
export function admin_sh_wxmenu_del(params) {
  return request({
    url: '/api/wx/wxmenu/del?pagevalue=145',
    method: 'post',
    data: params
  });
}

//商户获取微信菜单-修改
export function admin_sh_wxmenu_up(params) {
  return request({
    url: '/api/wx/wxmenu/up?pagevalue=146',
    method: 'post',
    data: params
  });
}

//商户获取微信菜单-同步
export function admin_sh_wxmenu_tongbu(params) {
  return request({
    url: '/api/wx/wxmenu/tongbu?pagevalue=147',
    method: 'post',
    data: params
  });
}


// 商户获取微信配置-列表
export function admin_sh_get_wxconfig_list(params) {
  return request({
    url: '/api/query/list/list?pagevalue=57',
    method: 'post',
    data: params
  });
}

// 其他接口
export function shdls(params) {
  return request({
    url: '/api/wx/shdls?pagevalue=330',
    method: 'post',
    data: params
  });
}

// 企业账户余额新增
export function increaseamout(data) {
  return request({
    url: '/api/agents/increaseamout?pagevalue=336',
    method: 'post',
    data
  });
}

// 企业账户余额扣除
export function decreaseamout(data) {
  return request({
    url: '/api/agents/decreaseamout?pagevalue=337',
    method: 'post',
    data
  });
}


// 生成ip地址
export function generateip(data) {
  return request({
    url: '/api/ip/generate?pagevalue=342',
    method: 'post',
    data
  });
}

// 添加停复机记录
export function tfjlogAdd(data) {
  return request({
    url: '/api/tfjlog/add?pagevalue=356',
    method: 'post',
    data
  });
}
