import request from "@/utils/request";
const baseURL = "/account/admin/activate";
// XXX-配置
const AuthAPI = {
  // 列表
  getList(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}/list`,
      method: "get",
      params,
    });
  },
  /** 分页*/
  getPage(params: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "get",
      params,
    });
  },
  // 获取会员码
  getVipCode(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}/getVipCode`,
      method: "post",
      data: { ...data },
    });
  },
  // 新增
  add(data: any) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "post",
      data: { ...data },
    });
  },
  // 详情
  getinfo(id: number) {
    return request<any, Responseres>({
      url: `${baseURL}/${id}`,
      method: "get",
    });
  },
  // 编辑
  update(data: Object) {
    return request<any, Responseres>({
      url: `${baseURL}`,
      method: "put",
      data,
    });
  },
  // 删除
  deleteByIds(id: number | String) {
    return request<any, Responseres>({
      url: `${baseURL}/${id}`,
      method: "delete",
    });
  },
  // 店铺详情
  shopInfodetail(params: any) {
    return request<any, Responseres>({
      url: `/account/admin/shopInfo/detail`,
      method: "get",
      params
    });
  },
  // 店铺修改
  shopInfoEidt(data: any) {
    return request<any, Responseres>({
      url: `/account/admin/shopInfo`,
      method: "put",
      data,
    });
  }
};
export interface Responseres {
  code?: number | null;
  data?: any;
  msg?: null | string;
  [property: string]: any;
}

export default AuthAPI;
