/* eslint-disable */
// @ts-ignore
import request from '@/http/vue-query';
import type { CustomRequestOptions } from '@/http/types';

import * as API from './types';

/** 新增用户地址 POST /app/userAddress/add */
export async function appUserAddressAddPost({
  body,
  options,
}: {
  body: API.UserAddressBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/userAddress/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 编辑用户地址 POST /app/userAddress/edit */
export async function appUserAddressEditPost({
  body,
  options,
}: {
  body: API.UserAddressBo;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/userAddress/edit', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 用户地址列表 POST /app/userAddress/list */
export async function appUserAddressListPost({
  params,
  options,
}: {
  // 叠加生成的Param类型 (非body参数openapi默认没有生成对象)
  params: API.AppUserAddressListPostParams;
  options?: CustomRequestOptions;
}) {
  return request<API.TableDataInfo>('/app/userAddress/list', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  });
}

/** 批量删除用户地址 POST /app/userAddress/remove */
export async function appUserAddressRemovePost({
  body,
  options,
}: {
  body: API.AppUserAddressRemovePostBody;
  options?: CustomRequestOptions;
}) {
  return request<API.R>('/app/userAddress/remove', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
