import request from '@/utils/request'
import { parseStrEmpty } from "@/utils/ruoyi";
 
// 查询table列表
export function listTableApi(url,query) {
    return request({
      url: url,
      method: 'get',
      params: query
    })
}

// 查询table详细
export function getTableDeatilsApi(url,userId) {
    return request({
      url: url + parseStrEmpty(userId),
      method: 'get'
    })
  }
  
// 查询table详细,更具ID
export function getTableDeatilsByIdApi(url,params) {
  return request({
    url: url,
    method: 'get',
    params
  })
}
  // 新增table
  export function addTableApi(url,data) {
    return request({
      url: url,
      method: 'post',
      data: data
    })
  }
  
  // 修改table PUT
  export function updateTableApi(url,data) {
    return request({
      url: url,
      method: 'put',
      data: data
    })
  }
  
  // 删除table
  export function delTableApi(url,userId) {
    return request({
      url: url + userId,
      method: 'delete'
    })
  }

  // 删除table
  export function delTableParamsApi(url,params) {
    return request({
      url: url,
      method: 'delete',
      params
    })
  }


  /**  通用接口  */
  // get
  export function publicByGetApi(url,params) {
    return request({
      url: url,
      method: 'get',
      params
    })
  }
  // post
  export function publicByPostApi(url,data) {
    return request({
      url: url,
      method: 'post',
      data: data
    })
  }
  // put
  export function publicByPutApi(url,data) {
    return request({
      url: url,
      method: 'put',
      data: data
    })
  }
