import { requestClient } from '#/api/request';

const prefix = 'user-membership/';
/**
 * 分页查询用户会员列表
 * @param data
 */
export async function getUserMembershipListApi(data: any) {
  return requestClient.get<any>(`${prefix}list`, { params: data });
}

/**
 * 获取用户会员下拉列表
 */
export async function getUserMembershipOptionApi() {
  return requestClient.get<any>(`${prefix}option`);
}

/**
 * 获取用户会员详情
 * @param id
 */
export async function getUserMembershipInfoApi(id: number) {
  return requestClient.get<any>(`${prefix}detail`, { params: { id } });
}

/**
 * 新增用户会员
 * @param data
 */
export async function createUserMembershipApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}create`, data);
}

/**
 * 编辑用户会员
 * @param data
 */
export async function updateUserMembershipApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}update`, data);
}

/**
 * 删除用户会员
 * @param data
 */
export async function deleteUserMembershipApi(data: Record<string, any>) {
  return requestClient.post<any>(`${prefix}delete`, data);
}
