// 地址相关的请求
import http from "./request/index";

//  微信登录
export function wxLoginApi(params) {
  return http.request({
    method: "POST",
    url: `/loginByCode`,
    params,
  });
}

//  获取名片列表
export function getCardListApi() {
  return http.request({
    method: "GET",
    url: `/queryAll`,
    custom: {
      needToken: true,
    },
  });
}

//  获取名片详情
export function getCardDetailApi(params) {
  return http.request({
    method: "GET",
    url: `/query`,
    params,
  });
}

//  新建名片
export function createCardApi(data) {
  return http.request({
    method: "POST",
    url: `/add`,
    data,
    custom: {
      needToken: true,
    },
  });
}

//  修改名片
export function updateCardApi(data) {
  return http.request({
    method: "POST",
    url: `/update`,
    data,
    custom: {
      needToken: true,
    },
  });
}

//  删除名片
export function deleteCardApi(params) {
  return http.request({
    method: "POST",
    url: `/delete`,
    params,
    custom: {
      needToken: true,
    },
  });
}
